[PATCH v2 00/21] Add qemu RDP server support
by marcandre.lureau@redhat.com
From: Marc-André Lureau <marcandre.lureau(a)redhat.com>
Hi,
This patch series offers an out-of-process Remote Desktop Protocol (RDP)
server solution utilizing QEMU's -display dbus interface, offering improved
modularity and potential security benefits compared to built-in server.
This initiative was spearheaded by Mihnea Buzatu during the QEMU Summer of Code
2023. The project's goal was to develop an out-of-process RDP server using the
-display dbus interface, implemented in Rust. Given that the IronRDP crate
lacked some server support at the time, investments in IronRDP were required.
I finally released an initial v0.1 version of qemu-rdp on crates.io
(https://crates.io/crates/qemu-rdp). That should allow more people to review and
evaluate the state of this work.
On unix systems, with cargo/rust toolchain installed, it should be as easy as
running "cargo install qemu-rdp", apply this patch series for libvirt, set the
"rdp_tls_x509_cert_dir" location for your TLS certificates, and configure a VM
with both dbus & rdp graphics (run "virsh domdisplay DOMAIN" to get the display
connection details).
Thanks for the reviews & feedback!
v2: thanks to Daniel review
- drop extra error report from "qemu: report an error for unsupported graphics"
- replace g_return pre-conditions with ATTRIBUTE_NONNULL
- improve "qemu/dbus: keep a connection to the VM D-Bus" to also reconnect
- use domainLogContext for logging (for virtiofs as well)
- check for qemu-rdp availabilty for setting 'rdp' capability
- make dbus-addr qemu-rdp capability mandatory
- rebased
- add r-b tags
Marc-André Lureau (21):
build-sys: drop -Winline when optimization=g
build: fix -Werror=maybe-uninitialized
qemu-slirp: drop unneeded check for OOM
util: annotate non-null arguments for virGDBusCallMethod()
qemu: fall-through for unsupported graphics
qemu: add rdp state directory
qemu: add qemu RDP configuration
conf: parse optional RDP username & password
conf: generalize virDomainDefHasSpiceGraphics
qemu: use virDomainDefHasGraphics
qemu: add RDP ports range allocator
qemu: limit to one <graphics type='rdp'>
qemu/virtiofs: use domainLogContext
qemu/dbus: keep a connection to the VM D-Bus
qemu/dbus: log daemon stdout/err, use domainLogContext
qemu: validate RDP configuration
qemu: add qemu-rdp helper unit
qemu: pass virQEMUDriverConfig to capabilities
qemu: add 'rdp' capability if qemu-rdp is available
qemu: add RDP support
tests: add qemu <graphics type='rdp'/> test
docs/formatdomain.rst | 25 +-
meson.build | 7 +-
po/POTFILES | 1 +
src/conf/domain_conf.c | 28 +-
src/conf/domain_conf.h | 5 +-
src/conf/schemas/domaincommon.rng | 10 +
src/libvirt_private.syms | 2 +-
src/qemu/libvirtd_qemu.aug | 7 +
src/qemu/meson.build | 1 +
src/qemu/qemu.conf.in | 31 ++
src/qemu/qemu_capabilities.c | 24 +-
src/qemu/qemu_capabilities.h | 12 +-
src/qemu/qemu_command.c | 9 +-
src/qemu/qemu_conf.c | 56 ++-
src/qemu/qemu_conf.h | 13 +
src/qemu/qemu_dbus.c | 69 ++-
src/qemu/qemu_dbus.h | 3 +
src/qemu/qemu_domain.c | 1 +
src/qemu/qemu_domain.h | 4 +
src/qemu/qemu_driver.c | 20 +
src/qemu/qemu_extdevice.c | 46 +-
src/qemu/qemu_hotplug.c | 49 ++-
src/qemu/qemu_hotplug.h | 1 +
src/qemu/qemu_process.c | 170 ++++++-
src/qemu/qemu_rdp.c | 416 ++++++++++++++++++
src/qemu/qemu_rdp.h | 73 +++
src/qemu/qemu_slirp.c | 6 -
src/qemu/qemu_validate.c | 48 +-
src/qemu/qemu_virtiofs.c | 53 +--
src/qemu/test_libvirtd_qemu.aug.in | 5 +
src/util/virgdbus.h | 13 +-
.../domaincapsdata/qemu_10.0.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_10.0.0-tcg.x86_64.xml | 1 +
tests/domaincapsdata/qemu_10.0.0.s390x.xml | 1 +
tests/domaincapsdata/qemu_10.0.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_7.0.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_7.0.0-tcg.x86_64.xml | 1 +
tests/domaincapsdata/qemu_7.0.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_7.1.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_7.1.0-tcg.x86_64.xml | 1 +
tests/domaincapsdata/qemu_7.1.0.x86_64.xml | 1 +
.../qemu_7.2.0-hvf.x86_64+hvf.xml | 1 +
.../domaincapsdata/qemu_7.2.0-q35.x86_64.xml | 1 +
.../qemu_7.2.0-tcg.x86_64+hvf.xml | 1 +
.../domaincapsdata/qemu_7.2.0-tcg.x86_64.xml | 1 +
tests/domaincapsdata/qemu_7.2.0.ppc.xml | 1 +
tests/domaincapsdata/qemu_7.2.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_8.0.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_8.0.0-tcg.x86_64.xml | 1 +
tests/domaincapsdata/qemu_8.0.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_8.1.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_8.1.0-tcg.x86_64.xml | 1 +
tests/domaincapsdata/qemu_8.1.0.s390x.xml | 1 +
tests/domaincapsdata/qemu_8.1.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_8.2.0-q35.x86_64.xml | 1 +
.../qemu_8.2.0-tcg-virt.loongarch64.xml | 1 +
.../domaincapsdata/qemu_8.2.0-tcg.x86_64.xml | 1 +
.../qemu_8.2.0-virt.aarch64.xml | 1 +
.../qemu_8.2.0-virt.loongarch64.xml | 1 +
tests/domaincapsdata/qemu_8.2.0.aarch64.xml | 1 +
tests/domaincapsdata/qemu_8.2.0.armv7l.xml | 1 +
tests/domaincapsdata/qemu_8.2.0.s390x.xml | 1 +
tests/domaincapsdata/qemu_8.2.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_9.0.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_9.0.0-tcg.x86_64.xml | 1 +
tests/domaincapsdata/qemu_9.0.0.sparc.xml | 1 +
tests/domaincapsdata/qemu_9.0.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_9.1.0-q35.x86_64.xml | 1 +
.../qemu_9.1.0-tcg-virt.riscv64.xml | 1 +
.../domaincapsdata/qemu_9.1.0-tcg.x86_64.xml | 1 +
.../qemu_9.1.0-virt.riscv64.xml | 1 +
tests/domaincapsdata/qemu_9.1.0.s390x.xml | 1 +
tests/domaincapsdata/qemu_9.1.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_9.2.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_9.2.0-tcg.x86_64.xml | 1 +
tests/domaincapsdata/qemu_9.2.0.s390x.xml | 1 +
tests/domaincapsdata/qemu_9.2.0.x86_64.xml | 1 +
tests/domaincapstest.c | 7 +-
.../graphics-rdp.x86_64-latest.args | 35 ++
.../graphics-rdp.x86_64-latest.xml | 1 +
tests/qemuxmlconfdata/graphics-rdp.xml | 43 ++
tests/qemuxmlconftest.c | 2 +
tests/testutilsqemu.c | 10 +
tools/nss/libvirt_nss_leases.c | 2 +-
tools/nss/libvirt_nss_macs.c | 2 +-
85 files changed, 1218 insertions(+), 138 deletions(-)
create mode 100644 src/qemu/qemu_rdp.c
create mode 100644 src/qemu/qemu_rdp.h
create mode 100644 tests/qemuxmlconfdata/graphics-rdp.x86_64-latest.args
create mode 120000 tests/qemuxmlconfdata/graphics-rdp.x86_64-latest.xml
create mode 100644 tests/qemuxmlconfdata/graphics-rdp.xml
--
2.47.0
3 hours, 35 minutes
[PATCH v8 00/18] *** qemu: block: Support block disk along with throttle filters ***
by Harikumar Rajkumar
*** Support block disk along with throttle filters ***
Chun Feng Wu (17):
schema: Add new domain elements to support multiple throttle groups
schema: Add new domain elements to support multiple throttle filters
config: Introduce ThrottleGroup and corresponding XML parsing
config: Introduce ThrottleFilter and corresponding XML parsing
qemu: monitor: Add support for ThrottleGroup operations
tests: Test qemuMonitorJSONGetThrottleGroup and
qemuMonitorJSONUpdateThrottleGroup
remote: New APIs for ThrottleGroup lifecycle management
qemu: Refactor qemuDomainSetBlockIoTune to extract common methods
qemu: Implement qemu driver for throttle API
qemu: helper: throttle filter nodename and preparation processing
qemu: block: Support block disk along with throttle filters
config: validate: Verify iotune, throttle group and filter
qemuxmlconftest: Add 'throttlefilter' tests
test_driver: Test throttle group lifecycle APIs
virsh: Refactor iotune options for re-use
virsh: Add support for throttle group operations
virsh: Add option "throttle-groups" to "attach_disk"
Harikumar Rajkumar (1):
qemustatusxml2xmldata: Add 'throttlefilter' tests
This patch version addresses the feedback provided on patch v5, which includes the following modifications:
* Reimplementation of the "get throttle group" to query from the XML.
* Allowing the SET API to reset the throttle group config fields to its default in QEMU.
* Updating the version to 11.1.0.
* Implementing various coding style changes as suggested.
* Removal of unnecessary comments.
docs/formatdomain.rst | 47 ++
docs/manpages/virsh.rst | 137 +++-
include/libvirt/libvirt-domain.h | 14 +
src/conf/domain_conf.c | 407 ++++++++++
src/conf/domain_conf.h | 47 ++
src/conf/domain_validate.c | 118 ++-
src/conf/schemas/domaincommon.rng | 293 ++++---
src/conf/virconftypes.h | 4 +
src/driver-hypervisor.h | 14 +
src/libvirt-domain.c | 122 +++
src/libvirt_private.syms | 8 +
src/libvirt_public.syms | 6 +
src/qemu/qemu_block.c | 136 ++++
src/qemu/qemu_block.h | 49 ++
src/qemu/qemu_command.c | 180 +++++
src/qemu/qemu_command.h | 6 +
src/qemu/qemu_domain.c | 77 +-
src/qemu/qemu_driver.c | 485 +++++++++---
src/qemu/qemu_hotplug.c | 29 +
src/qemu/qemu_monitor.c | 21 +
src/qemu/qemu_monitor.h | 9 +
src/qemu/qemu_monitor_json.c | 129 +++
src/qemu/qemu_monitor_json.h | 14 +
src/remote/remote_daemon_dispatch.c | 105 +++
src/remote/remote_driver.c | 3 +
src/remote/remote_protocol.x | 50 +-
src/remote_protocol-structs | 28 +
src/test/test_driver.c | 367 ++++++---
tests/qemumonitorjsontest.c | 86 ++
.../throttlefilter-in.xml | 392 ++++++++++
.../throttlefilter-out.xml | 393 ++++++++++
tests/qemuxmlactivetest.c | 1 +
.../throttlefilter-invalid.x86_64-latest.err | 1 +
.../throttlefilter-invalid.xml | 89 +++
.../throttlefilter.x86_64-latest.args | 55 ++
.../throttlefilter.x86_64-latest.xml | 105 +++
tests/qemuxmlconfdata/throttlefilter.xml | 95 +++
tests/qemuxmlconftest.c | 2 +
tools/virsh-completer-domain.c | 82 ++
tools/virsh-completer-domain.h | 16 +
tools/virsh-domain.c | 736 ++++++++++++++----
41 files changed, 4428 insertions(+), 530 deletions(-)
create mode 100644 tests/qemustatusxml2xmldata/throttlefilter-in.xml
create mode 100644 tests/qemustatusxml2xmldata/throttlefilter-out.xml
create mode 100644 tests/qemuxmlconfdata/throttlefilter-invalid.x86_64-latest.err
create mode 100644 tests/qemuxmlconfdata/throttlefilter-invalid.xml
create mode 100644 tests/qemuxmlconfdata/throttlefilter.x86_64-latest.args
create mode 100644 tests/qemuxmlconfdata/throttlefilter.x86_64-latest.xml
create mode 100644 tests/qemuxmlconfdata/throttlefilter.xml
--
2.39.5 (Apple Git-154)
7 hours, 20 minutes
[PATCH 0/5] qemu: Introduce nvme disk emulation support
by honglei.wang@smartx.com
From: hongleiwang <honglei.wang(a)smartx.com>
QEMU has supported nvme disk emulation for a long time,
see: https://qemu-project.gitlab.io/qemu/system/devices/nvme.html.
The following patches introduce nvme and nvme-ns disk bus type:
A disk with nvme as bus is represented as nvme disk that contains
only one nvme namespace. In XML, it can be used like this:
<devices>
...
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='/tmp/data.img'/>
<target dev='nvmea' bus='nvme'/>
<serial>nvme-serial-value</serial>
</disk>
...
</devices>
A disk with nvme-ns as bus is represented as an nvme namespace
and needs to be attached to an nvme controller. In XML, it can be
used like this:
<devices>
...
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='/tmp/data.img'/>
<target dev='nvmensa' bus='nvme-ns'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<controller type='nvme' index='0'>
<serial>nvme-controller-serial-value</serial>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</controller>
...
</devices>
ray (5):
qemu: Add support for NVMe disk bus type
qemu: Add support for NVMe namespace disk bus type
qemu_capabilities: Add support for NVMe disk capabilities
docs: Add NVMe and NVMe namespace disk bus types to documentation
tests: Add test case for NVMe device configuration
docs/formatdomain.rst | 5 ++-
src/conf/domain_conf.c | 42 +++++++++++++++++++
src/conf/domain_conf.h | 8 ++++
src/conf/domain_postparse.c | 4 ++
src/conf/domain_validate.c | 5 ++-
src/conf/schemas/domaincommon.rng | 12 +++++-
src/conf/virconftypes.h | 2 +
src/hyperv/hyperv_driver.c | 4 ++
src/qemu/qemu_alias.c | 2 +
src/qemu/qemu_capabilities.c | 10 +++++
src/qemu/qemu_capabilities.h | 2 +
src/qemu/qemu_command.c | 31 ++++++++++++++
src/qemu/qemu_domain_address.c | 30 +++++++++++--
src/qemu/qemu_domain_address.h | 4 ++
src/qemu/qemu_hotplug.c | 14 +++++++
src/qemu/qemu_postparse.c | 1 +
src/qemu/qemu_validate.c | 40 ++++++++++++++++++
src/test/test_driver.c | 4 ++
src/util/virutil.c | 2 +-
src/vbox/vbox_common.c | 3 ++
src/vmx/vmx.c | 2 +
tests/domaincapsdata/qemu_10.0.0-q35.x86_64.xml | 2 +
tests/domaincapsdata/qemu_10.0.0-tcg.x86_64.xml | 2 +
tests/domaincapsdata/qemu_10.0.0.s390x.xml | 2 +
tests/domaincapsdata/qemu_10.0.0.x86_64.xml | 2 +
tests/domaincapsdata/qemu_5.2.0-q35.x86_64.xml | 2 +
.../domaincapsdata/qemu_5.2.0-tcg-virt.riscv64.xml | 2 +
tests/domaincapsdata/qemu_5.2.0-tcg.x86_64.xml | 2 +
tests/domaincapsdata/qemu_5.2.0-virt.aarch64.xml | 2 +
tests/domaincapsdata/qemu_5.2.0-virt.riscv64.xml | 2 +
tests/domaincapsdata/qemu_5.2.0.aarch64.xml | 2 +
tests/domaincapsdata/qemu_5.2.0.ppc64.xml | 2 +
tests/domaincapsdata/qemu_5.2.0.x86_64.xml | 2 +
tests/domaincapsdata/qemu_6.0.0-q35.x86_64.xml | 2 +
tests/domaincapsdata/qemu_6.0.0-tcg.x86_64.xml | 2 +
tests/domaincapsdata/qemu_6.0.0-virt.aarch64.xml | 2 +
tests/domaincapsdata/qemu_6.0.0.aarch64.xml | 2 +
tests/domaincapsdata/qemu_6.0.0.x86_64.xml | 2 +
tests/domaincapsdata/qemu_6.1.0-q35.x86_64.xml | 2 +
tests/domaincapsdata/qemu_6.1.0-tcg.x86_64.xml | 2 +
tests/domaincapsdata/qemu_6.1.0.x86_64.xml | 2 +
tests/domaincapsdata/qemu_6.2.0-q35.x86_64.xml | 2 +
tests/domaincapsdata/qemu_6.2.0-tcg.x86_64.xml | 2 +
tests/domaincapsdata/qemu_6.2.0-virt.aarch64.xml | 2 +
tests/domaincapsdata/qemu_6.2.0.aarch64.xml | 2 +
tests/domaincapsdata/qemu_6.2.0.ppc64.xml | 2 +
tests/domaincapsdata/qemu_6.2.0.x86_64.xml | 2 +
.../domaincapsdata/qemu_7.0.0-hvf.aarch64+hvf.xml | 2 +
tests/domaincapsdata/qemu_7.0.0-q35.x86_64.xml | 2 +
tests/domaincapsdata/qemu_7.0.0-tcg.x86_64.xml | 2 +
tests/domaincapsdata/qemu_7.0.0-virt.aarch64.xml | 2 +
tests/domaincapsdata/qemu_7.0.0.aarch64.xml | 2 +
tests/domaincapsdata/qemu_7.0.0.ppc64.xml | 2 +
tests/domaincapsdata/qemu_7.0.0.x86_64.xml | 2 +
tests/domaincapsdata/qemu_7.1.0-q35.x86_64.xml | 2 +
tests/domaincapsdata/qemu_7.1.0-tcg.x86_64.xml | 2 +
tests/domaincapsdata/qemu_7.1.0.ppc64.xml | 2 +
tests/domaincapsdata/qemu_7.1.0.x86_64.xml | 2 +
tests/domaincapsdata/qemu_7.2.0-hvf.x86_64+hvf.xml | 2 +
tests/domaincapsdata/qemu_7.2.0-q35.x86_64.xml | 2 +
tests/domaincapsdata/qemu_7.2.0-tcg.x86_64+hvf.xml | 2 +
tests/domaincapsdata/qemu_7.2.0-tcg.x86_64.xml | 2 +
tests/domaincapsdata/qemu_7.2.0.ppc.xml | 2 +
tests/domaincapsdata/qemu_7.2.0.x86_64.xml | 2 +
tests/domaincapsdata/qemu_8.0.0-q35.x86_64.xml | 2 +
.../domaincapsdata/qemu_8.0.0-tcg-virt.riscv64.xml | 2 +
tests/domaincapsdata/qemu_8.0.0-tcg.x86_64.xml | 2 +
tests/domaincapsdata/qemu_8.0.0-virt.riscv64.xml | 2 +
tests/domaincapsdata/qemu_8.0.0.x86_64.xml | 2 +
tests/domaincapsdata/qemu_8.1.0-q35.x86_64.xml | 2 +
tests/domaincapsdata/qemu_8.1.0-tcg.x86_64.xml | 2 +
tests/domaincapsdata/qemu_8.1.0.x86_64.xml | 2 +
tests/domaincapsdata/qemu_8.2.0-q35.x86_64.xml | 2 +
.../qemu_8.2.0-tcg-virt.loongarch64.xml | 2 +
tests/domaincapsdata/qemu_8.2.0-tcg.x86_64.xml | 2 +
tests/domaincapsdata/qemu_8.2.0-virt.aarch64.xml | 2 +
.../domaincapsdata/qemu_8.2.0-virt.loongarch64.xml | 2 +
tests/domaincapsdata/qemu_8.2.0.aarch64.xml | 2 +
tests/domaincapsdata/qemu_8.2.0.armv7l.xml | 2 +
tests/domaincapsdata/qemu_8.2.0.s390x.xml | 2 +
tests/domaincapsdata/qemu_8.2.0.x86_64.xml | 2 +
tests/domaincapsdata/qemu_9.0.0-q35.x86_64.xml | 2 +
tests/domaincapsdata/qemu_9.0.0-tcg.x86_64.xml | 2 +
tests/domaincapsdata/qemu_9.0.0.x86_64.xml | 2 +
tests/domaincapsdata/qemu_9.1.0-q35.x86_64.xml | 2 +
.../domaincapsdata/qemu_9.1.0-tcg-virt.riscv64.xml | 2 +
tests/domaincapsdata/qemu_9.1.0-tcg.x86_64.xml | 2 +
tests/domaincapsdata/qemu_9.1.0-virt.riscv64.xml | 2 +
tests/domaincapsdata/qemu_9.1.0.s390x.xml | 2 +
tests/domaincapsdata/qemu_9.1.0.x86_64.xml | 2 +
tests/domaincapsdata/qemu_9.2.0-q35.x86_64.xml | 2 +
tests/domaincapsdata/qemu_9.2.0-tcg.x86_64.xml | 2 +
tests/domaincapsdata/qemu_9.2.0.s390x.xml | 2 +
tests/domaincapsdata/qemu_9.2.0.x86_64.xml | 2 +
tests/qemucapabilitiesdata/caps_10.0.0_s390x.xml | 2 +
tests/qemucapabilitiesdata/caps_10.0.0_x86_64.xml | 2 +
tests/qemucapabilitiesdata/caps_5.2.0_aarch64.xml | 2 +
tests/qemucapabilitiesdata/caps_5.2.0_ppc64.xml | 2 +
tests/qemucapabilitiesdata/caps_5.2.0_riscv64.xml | 2 +
tests/qemucapabilitiesdata/caps_5.2.0_x86_64.xml | 2 +
tests/qemucapabilitiesdata/caps_6.0.0_aarch64.xml | 2 +
tests/qemucapabilitiesdata/caps_6.0.0_x86_64.xml | 2 +
tests/qemucapabilitiesdata/caps_6.1.0_x86_64.xml | 2 +
tests/qemucapabilitiesdata/caps_6.2.0_aarch64.xml | 2 +
tests/qemucapabilitiesdata/caps_6.2.0_ppc64.xml | 2 +
tests/qemucapabilitiesdata/caps_6.2.0_x86_64.xml | 2 +
.../caps_7.0.0_aarch64+hvf.xml | 2 +
tests/qemucapabilitiesdata/caps_7.0.0_aarch64.xml | 2 +
tests/qemucapabilitiesdata/caps_7.0.0_ppc64.xml | 2 +
tests/qemucapabilitiesdata/caps_7.0.0_x86_64.xml | 2 +
tests/qemucapabilitiesdata/caps_7.1.0_ppc64.xml | 2 +
tests/qemucapabilitiesdata/caps_7.1.0_x86_64.xml | 2 +
tests/qemucapabilitiesdata/caps_7.2.0_ppc.xml | 2 +
.../qemucapabilitiesdata/caps_7.2.0_x86_64+hvf.xml | 2 +
tests/qemucapabilitiesdata/caps_7.2.0_x86_64.xml | 2 +
tests/qemucapabilitiesdata/caps_8.0.0_riscv64.xml | 2 +
tests/qemucapabilitiesdata/caps_8.0.0_x86_64.xml | 2 +
tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml | 2 +
tests/qemucapabilitiesdata/caps_8.2.0_aarch64.xml | 2 +
tests/qemucapabilitiesdata/caps_8.2.0_armv7l.xml | 2 +
.../caps_8.2.0_loongarch64.xml | 2 +
tests/qemucapabilitiesdata/caps_8.2.0_s390x.xml | 2 +
tests/qemucapabilitiesdata/caps_8.2.0_x86_64.xml | 2 +
tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml | 2 +
tests/qemucapabilitiesdata/caps_9.1.0_riscv64.xml | 2 +
tests/qemucapabilitiesdata/caps_9.1.0_s390x.xml | 2 +
tests/qemucapabilitiesdata/caps_9.1.0_x86_64.xml | 2 +
tests/qemucapabilitiesdata/caps_9.2.0_s390x.xml | 2 +
tests/qemucapabilitiesdata/caps_9.2.0_x86_64.xml | 2 +
.../disk-nvme-device.x86_64-latest.args | 38 +++++++++++++++++
.../disk-nvme-device.x86_64-latest.xml | 49 ++++++++++++++++++++++
tests/qemuxmlconfdata/disk-nvme-device.xml | 46 ++++++++++++++++++++
tests/qemuxmlconftest.c | 1 +
133 files changed, 569 insertions(+), 8 deletions(-)
create mode 100644 tests/qemuxmlconfdata/disk-nvme-device.x86_64-latest.args
create mode 100644 tests/qemuxmlconfdata/disk-nvme-device.x86_64-latest.xml
create mode 100644 tests/qemuxmlconfdata/disk-nvme-device.xml
--
2.11.0
14 hours, 21 minutes
[PATCH 00/26] integrate auto-shutdown of VMs with daemons
by Daniel P. Berrangé
This series starts the work needed to obsolete the libvirt-guests.sh
script which has grown a surprisingly large amount of functionality.
Currently the virt daemons will acquire inhibitors to delay OS shutdown
when VMs are running. The libvirt-guests.service unit can be used to
call libvirt-guests.sh to shutdown running VMs on system shutdown.
This split is a bad architecture because libvirt-guests.service will
only run once the system has decided to initiate the shutdown sequence.
When the user requests as shutdown while inhibitors are present, logind
will emit a "PrepareForShutdown" signal over dbus. Applications are
supposed to respond to this by preserving state & releasing their
inhibitors, which in turns allows shutdown to be initiated.
The remote daemon already has support for listening for the
"PrepareForShutdown" signal, but only does this for session instances,
not system instances.
This series essentially takes that logic and expands it to run in the
system instances too, thus conceptually making libvirt-guests.service
obsolete.
It is slightly more complicated than that though for many reasons...
Saving running VMs can take a very long time. The inhibitor delay
can be as low as 5 seconds, and when killing a service, systemd may
not wait very long for it to terminate. libvirt-guests.service deals
with this by setting TimeoutStopSecs=0 to make systemd wait forever.
This is undesirable to set in libvirtd.service though, as we would
like systemd to kill the daemon aggressively if it hangs. The series
thus uses the notification protocol to request systemd give it more
time to shutdown, as long as we're in the phase of saving running
VMs. A bug in this code will still result in systemd waiting forever,
which is no different from libvirt-guests.service, but a bug in any
other part of the libvirt daemon shutdown code will result in systemd
killing us.
The existing logic for saving VMs in the session daemons had many
feature gaps compared to libvirt-guests.sh. Thus there is code to
add support
* Requesting graceful OS shutdown if managed save failed
* Force poweroff of VMs if no other action worked
* Optionally enabling/disabling use of managed save,
graceful shutdown and force poweroff, which is more flexible
than ON_SHUTDOWN=nnn, as we can try the whole sequence of
options
* Ability to bypass cache in managed save
* Support for one-time autostart of VMs as an official API
To aid in testing this logic, virt-admin gains a new command
'virt-admin daemon-shutdown --preserve'
All this new functionality is wired up into the QEMU driver, and is
made easily accessible to other hypervisor drivers, so would easily
be extendable to Xen, CH, LXC drivers, but this is not done in this
series. IOW, libvirt-guests.service is not yet fully obsolete.
The new functionality is also not enabled by default for the system
daemon, it requires explicit admin changes to /etc/libvirt/qemu.conf
to enable it. This is because it would clash with execution of the
libvirt-guests.service if both were enabled.
It is highly desirable that we enable this by default though, so we
need to figure out a upgrade story wrt libvirt-guests.service.
The only libvirt-guests.sh features not implemented are:
* PARALLEL_SHUTDOWN=nn.
When doing a graceful shutdown we initiate it on every single VM
at once, and then monitor progress of all of them in parallel.
* SYNC_TIME=nn
When make not attempt to sync guest time when restoring from
managed save. This ought to be fixed
Daniel P. Berrangé (26):
util: add APIs for more systemd notifications
remote: notify systemd when reloading config
hypervisor: introduce helper for autostart
src: convert drivers over to use new autostart helper
hypervisor: add support for delay interval during autostart
qemu: add 'auto_start_delay' configuration parameter
hypervisor: move support for auto-shutdown out of QEMU driver
remote: always invoke virStateStop for all daemons
hypervisor: expand available shutdown actions
hypervisor: custom shutdown actions for transient vs persistent VMs
qemu: support automatic VM managed save in system daemon
qemu: improve shutdown defaults for session daemon
qemu: configurable delay for shutdown before poweroff
hypervisor: support bypassing cache for managed save
qemu: add config parameter to control auto-save bypass cache
src: add new APIs for marking a domain to autostart once
conf: implement support for autostart once feature
hypervisor: wire up support for auto restore of running domains
qemu: wire up support for once only autostart
qemu: add config to control if auto-shutdown VMs are restored
rpc: move state stop into virNetDaemon class
rpc: don't unconditionally quit after preserving state
rpc: fix shutdown sequence when preserving state
admin: add 'daemon-shutdown' command
rpc: don't let systemd shutdown daemon while saving VMs
hypervisor: send systemd status messages while saving
include/libvirt/libvirt-admin.h | 13 ++
include/libvirt/libvirt-domain.h | 4 +
src/admin/admin_protocol.x | 11 +-
src/admin/admin_server_dispatch.c | 13 ++
src/admin/libvirt-admin.c | 33 ++++
src/admin/libvirt_admin_public.syms | 5 +
src/bhyve/bhyve_driver.c | 53 ++----
src/conf/domain_conf.c | 6 +-
src/conf/domain_conf.h | 1 +
src/conf/virdomainobjlist.c | 7 +-
src/driver-hypervisor.h | 10 ++
src/hypervisor/domain_driver.c | 250 ++++++++++++++++++++++++++++
src/hypervisor/domain_driver.h | 42 +++++
src/libvirt-domain.c | 87 ++++++++++
src/libvirt_private.syms | 10 +-
src/libvirt_public.syms | 6 +
src/libvirt_remote.syms | 2 +-
src/libxl/libxl_driver.c | 36 ++--
src/lxc/lxc_driver.c | 13 +-
src/lxc/lxc_process.c | 18 +-
src/lxc/lxc_process.h | 2 +
src/qemu/libvirtd_qemu.aug | 7 +
src/qemu/qemu.conf.in | 59 +++++++
src/qemu/qemu_conf.c | 63 +++++++
src/qemu/qemu_conf.h | 7 +
src/qemu/qemu_driver.c | 203 +++++++++++++---------
src/qemu/test_libvirtd_qemu.aug.in | 7 +
src/remote/libvirtd.service.in | 2 +-
src/remote/remote_daemon.c | 78 +++------
src/remote/remote_driver.c | 2 +
src/remote/remote_protocol.x | 30 +++-
src/remote_protocol-structs | 12 ++
src/rpc/gendispatch.pl | 4 +-
src/rpc/virnetdaemon.c | 212 +++++++++++++++++++----
src/rpc/virnetdaemon.h | 20 ++-
src/util/virsystemd.c | 41 ++++-
src/util/virsystemd.h | 6 +-
src/virtd.service.in | 2 +-
tools/virsh-domain-monitor.c | 5 +
tools/virsh-domain.c | 39 ++++-
tools/virt-admin.c | 41 +++++
41 files changed, 1181 insertions(+), 281 deletions(-)
--
2.47.1
1 day, 4 hours
[PATCH 0/3] Full boot order support on s390x
by Boris Fiuczynski
This series adds on s390x full boot order support which has been
introduced recently in QEMU with the PR
https://lore.kernel.org/qemu-devel/20241023131710.906748-1-thuth@redhat.com/
The replies and xml files are removed from the patch in this series and
are available in https://gitlab.com/fiuczy/libvirt/-/commits/fullbootorder
Boris Fiuczynski (3):
qemu: capabilities: Add QEMU_CAPS_VIRTIO_CCW_DEVICE_LOADPARM
tests: add capabilities for QEMU 9.2.0 on s390x
qemu: command: add multi boot device support on s390x
src/qemu/qemu_capabilities.c | 8 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 40 +-
src/qemu/qemu_command.h | 6 +-
src/qemu/qemu_hotplug.c | 6 +-
tests/domaincapsdata/qemu_9.2.0.s390x.xml | 311 +
.../caps_5.2.0_s390x.replies | 321 +-
.../caps_6.0.0_s390x.replies | 321 +-
.../caps_8.1.0_s390x.replies | 321 +-
.../caps_8.2.0_s390x.replies | 321 +-
.../caps_9.1.0_s390x.replies | 321 +-
.../caps_9.2.0_s390x.replies | 36741 ++++++++++++++++
.../qemucapabilitiesdata/caps_9.2.0_s390x.xml | 3752 ++
.../machine-loadparm-hostdev.s390x-9.1.0.args | 33 +
.../machine-loadparm-hostdev.s390x-9.1.0.xml | 33 +
...machine-loadparm-hostdev.s390x-latest.args | 4 +-
...-multiple-disks-nets-s390.s390x-9.1.0.args | 40 +
...m-multiple-disks-nets-s390.s390x-9.1.0.xml | 51 +
...multiple-disks-nets-s390.s390x-latest.args | 8 +-
...machine-loadparm-net-s390.s390x-9.1.0.args | 34 +
.../machine-loadparm-net-s390.s390x-9.1.0.xml | 32 +
...achine-loadparm-net-s390.s390x-latest.args | 4 +-
.../machine-loadparm-s390.s390x-9.1.0.args | 34 +
.../machine-loadparm-s390.s390x-9.1.0.xml | 33 +
.../machine-loadparm-s390.s390x-latest.args | 4 +-
tests/qemuxmlconftest.c | 4 +
26 files changed, 42664 insertions(+), 120 deletions(-)
create mode 100644 tests/domaincapsdata/qemu_9.2.0.s390x.xml
create mode 100644 tests/qemucapabilitiesdata/caps_9.2.0_s390x.replies
create mode 100644 tests/qemucapabilitiesdata/caps_9.2.0_s390x.xml
create mode 100644 tests/qemuxmlconfdata/machine-loadparm-hostdev.s390x-9.1.0.args
create mode 100644 tests/qemuxmlconfdata/machine-loadparm-hostdev.s390x-9.1.0.xml
create mode 100644 tests/qemuxmlconfdata/machine-loadparm-multiple-disks-nets-s390.s390x-9.1.0.args
create mode 100644 tests/qemuxmlconfdata/machine-loadparm-multiple-disks-nets-s390.s390x-9.1.0.xml
create mode 100644 tests/qemuxmlconfdata/machine-loadparm-net-s390.s390x-9.1.0.args
create mode 100644 tests/qemuxmlconfdata/machine-loadparm-net-s390.s390x-9.1.0.xml
create mode 100644 tests/qemuxmlconfdata/machine-loadparm-s390.s390x-9.1.0.args
create mode 100644 tests/qemuxmlconfdata/machine-loadparm-s390.s390x-9.1.0.xml
--
2.45.0
1 day, 16 hours
[PATCH v1 0/3] Introduce qemuDomainSetVcpuTuneParameters API
by yong.huang@smartx.com
From: Hyman Huang <yong.huang(a)smartx.com>
This patchset is the prerequisite for the vCPU dirty-limit feature:
https://patchew.org/Libvirt/cover.1703135535.git.yong.huang@smartx.com/
As suggested by Daniel:
We've generally tried to avoid adding single purpose APIs for
tunable parameters, instead using APIs with virTypedParameter
arrays to allow bulk updates.
I note that we don't appear to have any mechanism currently
to set the VCPU scheduler tunables either
Perhaps we should have a more general
virDomainSetVCPUTuneParameters(virDomainPtr domain,
int vcpu,
virTypedParameterPtr params,
unsigned int params,
unsigned int flags);
Refer the following link to see more details:
https://patchew.org/Libvirt/169397083100.4628.15196043252714532301-0@git....
We present the qemuDomainSetVcpuTuneParameters API separately
because the patchset is somewhat self-contained.
Please review,
Yong
Hyman Huang (3):
libvirt: Add virDomainSetVcpuTuneParameters API
qemu_driver: Implement qemuDomainSetVcpuTuneParameters
virsh: Use the new API to implement cmdSetvcpu
include/libvirt/libvirt-domain.h | 25 ++++++++++++++
src/driver-hypervisor.h | 8 +++++
src/libvirt-domain.c | 56 ++++++++++++++++++++++++++++++++
src/libvirt_public.syms | 5 +++
src/qemu/qemu_driver.c | 29 +++++++++++++++++
src/remote/remote_driver.c | 1 +
src/remote/remote_protocol.x | 20 +++++++++++-
tools/virsh-domain.c | 10 +++++-
8 files changed, 152 insertions(+), 2 deletions(-)
--
2.27.0
1 day, 21 hours
[PATCH v3 0/2] Enable SEV SNP support in ch driver
by Praveen K Paladugu
This version introduces virStringFormatHex method and uses this method while sending host_data to cloud-hypervisor.
Praveen K Paladugu (2):
util: Introduce virStringFormatHex
ch: Enable SEV SNP support
src/ch/ch_monitor.c | 65 ++++++++++++++++++++++++++++++++--------
src/libvirt_private.syms | 1 +
src/util/virstring.c | 19 ++++++++++++
src/util/virstring.h | 1 +
4 files changed, 74 insertions(+), 12 deletions(-)
--
2.47.0
2 days, 10 hours
[PATCH 0/4] hw/s390x: Alias @dump-skeys -> @dump-s390-skey and deprecate
by Philippe Mathieu-Daudé
We are trying to unify all qemu-system-FOO to a single binary.
In order to do that we need to remove QAPI target specific code.
@dump-skeys is only available on qemu-system-s390x. This series
rename it as @dump-s390-skey, making it available on other
binaries. We take care of backward compatibility via deprecation.
Philippe Mathieu-Daudé (4):
hw/s390x: Introduce the @dump-s390-skeys QMP command
hw/s390x: Introduce the 'dump_s390_skeys' HMP command
hw/s390x: Deprecate the HMP 'dump_skeys' command
hw/s390x: Deprecate the QMP @dump-skeys command
docs/about/deprecated.rst | 5 +++++
qapi/misc-target.json | 5 +++++
qapi/misc.json | 18 ++++++++++++++++++
include/monitor/hmp.h | 1 +
hw/s390x/s390-skeys-stub.c | 24 ++++++++++++++++++++++++
hw/s390x/s390-skeys.c | 19 +++++++++++++++++--
hmp-commands.hx | 17 +++++++++++++++--
hw/s390x/meson.build | 5 +++++
8 files changed, 90 insertions(+), 4 deletions(-)
create mode 100644 hw/s390x/s390-skeys-stub.c
--
2.41.0
2 days, 14 hours
[PATCH v2 0/6] qemu: acpi-generic-initiator support
by Andrea Righi
= Overview =
This patch set introduces support for acpi-generic-initiator devices,
supported by QEMU [1].
The acpi-generic-initiator object is required to support Multi-Instance GPU
(MIG) configurations on NVIDIA GPUs [2]. MIG enables partitioning of GPU
resources into multiple isolated instances, each requiring a dedicated NUMA
node definition.
= Implementation =
This patch set implements the libvirt counterpart to the QEMU feature,
enabling users to configure acpi-generic-initiator objects within libvirt
domain XML.
This includes:
- adding XML syntax to define acpi-generic-initiator objects,
- adding a new qemu capability flag,
- resolving the acpi-generic-initiator definitions into the proper QEMU
command-line arguments,
- ensuring compatibility with existing NUMA configuration.
= Example =
- Domain XML:
```
...
<cpu mode='host-passthrough' check='none'>
<numa>
<cell id='0' cpus='0-15' memory='8388608' unit='KiB'/>
<cell id='1' memory='0' unit='KiB'/>
<cell id='2' memory='0' unit='KiB'/>
<cell id='3' memory='0' unit='KiB'/>
<cell id='4' memory='0' unit='KiB'/>
<cell id='5' memory='0' unit='KiB'/>
<cell id='6' memory='0' unit='KiB'/>
<cell id='7' memory='0' unit='KiB'/>
<cell id='8' memory='0' unit='KiB'/>
</numa>
</cpu>
...
<devices>
...
<acpi-generic-initiator>
<alias name="gi1" />
<pci-dev>hostdev0</pci-dev>
<numa-node>1</numa-node>
</acpi-generic-initiator>
<acpi-generic-initiator>
<alias name="gi2" />
<pci-dev>hostdev0</pci-dev>
<numa-node>2</numa-node>
</acpi-generic-initiator>
<acpi-generic-initiator>
<alias name="gi3" />
<pci-dev>hostdev0</pci-dev>
<numa-node>3</numa-node>
</acpi-generic-initiator>
<acpi-generic-initiator>
<alias name="gi4" />
<pci-dev>hostdev0</pci-dev>
<numa-node>4</numa-node>
</acpi-generic-initiator>
<acpi-generic-initiator>
<alias name="gi5" />
<pci-dev>hostdev0</pci-dev>
<numa-node>5</numa-node>
</acpi-generic-initiator>
<acpi-generic-initiator>
<alias name="gi6" />
<pci-dev>hostdev0</pci-dev>
<numa-node>6</numa-node>
</acpi-generic-initiator>
<acpi-generic-initiator>
<alias name="gi7" />
<pci-dev>hostdev0</pci-dev>
<numa-node>7</numa-node>
</acpi-generic-initiator>
<acpi-generic-initiator>
<alias name="gi8" />
<pci-dev>hostdev0</pci-dev>
<numa-node>8</numa-node>
</acpi-generic-initiator>
</devices>
```
- Generated QEMU command line options:
```
... /usr/bin/qemu-system-aarch64 \
...
-object '{"qom-type":"memory-backend-ram","id":"ram-node0","size":8589934592}' \
-numa node,nodeid=0,cpus=0-15,memdev=ram-node0 \
-numa node,nodeid=1 \
-numa node,nodeid=2 \
-numa node,nodeid=3 \
-numa node,nodeid=4 \
-numa node,nodeid=5 \
-numa node,nodeid=6 \
-numa node,nodeid=7 \
-numa node,nodeid=8 \
...
-object '{"qom-type":"acpi-generic-initiator","id":"gi1","pci-dev":"hostdev0","node":1}' \
-object '{"qom-type":"acpi-generic-initiator","id":"gi2","pci-dev":"hostdev0","node":2}' \
-object '{"qom-type":"acpi-generic-initiator","id":"gi3","pci-dev":"hostdev0","node":3}' \
-object '{"qom-type":"acpi-generic-initiator","id":"gi4","pci-dev":"hostdev0","node":4}' \
-object '{"qom-type":"acpi-generic-initiator","id":"gi5","pci-dev":"hostdev0","node":5}' \
-object '{"qom-type":"acpi-generic-initiator","id":"gi6","pci-dev":"hostdev0","node":6}' \
-object '{"qom-type":"acpi-generic-initiator","id":"gi7","pci-dev":"hostdev0","node":7}' \
-object '{"qom-type":"acpi-generic-initiator","id":"gi8","pci-dev":"hostdev0","node":8}'
```
= References =
[1] https://lore.kernel.org/all/20231225045603.7654-2-ankita@nvidia.com/
[2] https://www.nvidia.com/en-in/technologies/multi-instance-gpu/
ChangeLog v1 -> v2:
- split parser and driver changes in separate patches
- introduce a new qemu capability flag
- introduce test in qemuxmlconftest
Andrea Righi (6):
schema: Introduce acpi-generic-initiator definition
conf: Introduce acpi-generic-initiator device
qemu: Allow to define NUMA nodes without memory or CPUs assigned
qemu: capabilies: Introduce QEMU_CAPS_ACPI_GENERIC_INITIATOR
qemu: support acpi-generic-initiator
qemu: Add test case for acpi-generic-initiator
src/ch/ch_domain.c | 1 +
src/conf/domain_conf.c | 153 +++++++++++++++++++++
src/conf/domain_conf.h | 14 ++
src/conf/domain_postparse.c | 1 +
src/conf/domain_validate.c | 40 ++++++
src/conf/numa_conf.c | 3 +
src/conf/schemas/domaincommon.rng | 19 +++
src/conf/virconftypes.h | 2 +
src/libxl/libxl_driver.c | 6 +
src/lxc/lxc_driver.c | 6 +
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 48 +++++--
src/qemu/qemu_domain.c | 2 +
src/qemu/qemu_domain_address.c | 4 +
src/qemu/qemu_driver.c | 3 +
src/qemu/qemu_hotplug.c | 5 +
src/qemu/qemu_postparse.c | 1 +
src/qemu/qemu_validate.c | 1 +
src/test/test_driver.c | 4 +
tests/qemucapabilitiesdata/caps_10.0.0_x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_9.1.0_riscv64.xml | 1 +
tests/qemucapabilitiesdata/caps_9.1.0_x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_9.2.0_x86_64.xml | 1 +
.../acpi-generic-initiator.x86_64-latest.args | 55 ++++++++
.../acpi-generic-initiator.x86_64-latest.xml | 102 ++++++++++++++
tests/qemuxmlconfdata/acpi-generic-initiator.xml | 102 ++++++++++++++
tests/qemuxmlconftest.c | 1 +
29 files changed, 573 insertions(+), 8 deletions(-)
create mode 100644 tests/qemuxmlconfdata/acpi-generic-initiator.x86_64-latest.args
create mode 100644 tests/qemuxmlconfdata/acpi-generic-initiator.x86_64-latest.xml
create mode 100644 tests/qemuxmlconfdata/acpi-generic-initiator.xml
5 days, 9 hours
[PATCH] util: netdevvlan: Change return type of virNetDevVlanCopy to void
by Alexander Kuznetsov
This function return value is invariant since 1022e0ee, so change
its type and remove all dependent checks.
Found by Linux Verification Center (linuxtesting.org) with Svace.
Reported-by: Alexander Rudyuk <a.rudyuk(a)fobos-nt.ru>
Signed-off-by: Alexander Kuznetsov <kuznetsovam(a)altlinux.org>
---
src/conf/domain_conf.c | 9 +++------
src/network/bridge_driver.c | 4 +++-
src/util/virnetdevvlan.c | 6 +++---
src/util/virnetdevvlan.h | 2 +-
4 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 3f88a77a8f..6f49ee507a 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -30533,8 +30533,7 @@ virDomainNetDefToNetworkPort(virDomainDef *dom,
if (virNetDevBandwidthCopy(&port->bandwidth, iface->bandwidth) < 0)
return NULL;
- if (virNetDevVlanCopy(&port->vlan, &iface->vlan) < 0)
- return NULL;
+ virNetDevVlanCopy(&port->vlan, &iface->vlan);
port->isolatedPort = iface->isolatedPort;
port->trustGuestRxFilters = iface->trustGuestRxFilters;
@@ -30611,8 +30610,7 @@ virDomainNetDefActualFromNetworkPort(virDomainNetDef *iface,
if (virNetDevBandwidthCopy(&actual->bandwidth, port->bandwidth) < 0)
goto error;
- if (virNetDevVlanCopy(&actual->vlan, &port->vlan) < 0)
- goto error;
+ virNetDevVlanCopy(&actual->vlan, &port->vlan);
actual->isolatedPort = port->isolatedPort;
actual->class_id = port->class_id;
@@ -30729,8 +30727,7 @@ virDomainNetDefActualToNetworkPort(virDomainDef *dom,
if (virNetDevBandwidthCopy(&port->bandwidth, actual->bandwidth) < 0)
return NULL;
- if (virNetDevVlanCopy(&port->vlan, &actual->vlan) < 0)
- return NULL;
+ virNetDevVlanCopy(&port->vlan, &actual->vlan);
port->isolatedPort = actual->isolatedPort;
port->class_id = actual->class_id;
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 8f47ef2574..668870a9ee 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -3973,8 +3973,10 @@ networkAllocatePort(virNetworkObj *obj,
else if (netdef->vlan.nTags > 0)
vlan = &netdef->vlan;
- if (vlan && virNetDevVlanCopy(&port->vlan, vlan) < 0)
+ if (vlan) {
+ virNetDevVlanCopy(&port->vlan, vlan);
return -1;
+ }
}
if (!port->trustGuestRxFilters) {
diff --git a/src/util/virnetdevvlan.c b/src/util/virnetdevvlan.c
index 67daa5d3b4..e8f572efd2 100644
--- a/src/util/virnetdevvlan.c
+++ b/src/util/virnetdevvlan.c
@@ -76,11 +76,11 @@ virNetDevVlanEqual(const virNetDevVlan *a, const virNetDevVlan *b)
* If src is NULL, dst will have nTags set to 0.
* dst is assumed to be empty on entry.
*/
-int
+void
virNetDevVlanCopy(virNetDevVlan *dst, const virNetDevVlan *src)
{
if (!src || src->nTags == 0)
- return 0;
+ return;
dst->tag = g_new0(unsigned int, src->nTags);
dst->trunk = src->trunk;
@@ -88,5 +88,5 @@ virNetDevVlanCopy(virNetDevVlan *dst, const virNetDevVlan *src)
dst->nativeMode = src->nativeMode;
dst->nativeTag = src->nativeTag;
memcpy(dst->tag, src->tag, src->nTags * sizeof(*src->tag));
- return 0;
+ return;
}
diff --git a/src/util/virnetdevvlan.h b/src/util/virnetdevvlan.h
index 228d270869..fd2f8023f5 100644
--- a/src/util/virnetdevvlan.h
+++ b/src/util/virnetdevvlan.h
@@ -42,6 +42,6 @@ struct _virNetDevVlan {
void virNetDevVlanClear(virNetDevVlan *vlan);
void virNetDevVlanFree(virNetDevVlan *vlan);
int virNetDevVlanEqual(const virNetDevVlan *a, const virNetDevVlan *b);
-int virNetDevVlanCopy(virNetDevVlan *dst, const virNetDevVlan *src);
+void virNetDevVlanCopy(virNetDevVlan *dst, const virNetDevVlan *src);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNetDevVlan, virNetDevVlanFree);
--
2.42.4
5 days, 10 hours