[PATCH 00/21] qemu: Validate machine type and clean up test suite
by Peter Krempa
I was experimenting with a qemu-5.0 feature and figured out that
qemu-5.0 will drop support for machine types prior to 'pc-1.0'. What was
unexpected though is that I've figured it out as some very strange and
seemingly unrelated changes happened in the test output of the 'latest'
tests while bumping the caps data.
It turned out that the CPU driver now actually takes data from the
machine type and since the machine type was no longer present the test
data result has changed.
This lead me down a rabbit hole of trying to make our test suite more
robust and such changes easier to debug.
The result is these 21 patches that fix numerous tests, clean up some
stale and downstream machine types and in the end add validation of the
machine type and harden the testsuite to use it properly.
Note that 30k lines of the diffstat is just the qemu-5.0 capabilities
data so that we can verify that nothing changes during the capbility
upgrade.
Some of the yak-shaving done here is incomplete though as I've figured
out we have a bunch of network-device related tests which are not
enabled in the xml->argv test suite, but also are not easy to enable.
Peter Krempa (21):
tests: qemuxml2argv: Use 64 bit qemu binary and 1.5 machine type in
'disk-cache' case
tests: qemuxml2xml: Modernize 'disk-cache' test
tests: qemuxml2argv: Modernize tpm-passthrough tests
tests: qemuxml: Fix and enable default-video-type* tests
tests: qemu: Unify fake machine types filled in for KVM and TCG caps
of x86_64
tests: qemuxml2argv: Use existing machine type for
'numatune-distances' case
tests: qemuxml2argv: Remove downstream machine type in
'controller-order' case
tests: qemuxml2argv: Use existing non-virt machine in
'aarch64-gic-not-virt'
tests: qemuxml2argv: Use proper replacement for 'pc-i440fx-wily'
machine
tests: qemuxml: Use existing machine type in
'iothreads-virtio-scsi-ccw' case
tests: qemu: Add machine types used by the test code to fake
capabilities
qemu: domain: Validate that machine type is supported by qemu
qemu: capabilities: Extract code from virQEMUCapsStripMachineAliases
qemu: capabilities: Replace aliased machine type by copy of the
canonical machine
qemu: capabilities: Add accessor to qemu caps machine types presence
tests: qemu: Don't add fake machine types when testing with real data
tests: qemuxml: Purge prehistoric machine type 'pc-0.13' from "latest"
tests
tests: Add caps for upcoming qemu-5.0
tests: qemuxml: Remove prehistoric machine types from legacy tests
tests: qemuxml2xml: Remove prehistoric machine types from legacy tests
tests: qemu: Remove prehistoric machine types from faked data tests
src/qemu/qemu_capabilities.c | 50 +-
src/qemu/qemu_capabilities.h | 4 +
src/qemu/qemu_capspriv.h | 3 +
src/qemu/qemu_domain.c | 8 +
.../domaincapsdata/qemu_5.0.0-q35.x86_64.xml | 181 +
.../domaincapsdata/qemu_5.0.0-tcg.x86_64.xml | 191 +
tests/domaincapsdata/qemu_5.0.0.x86_64.xml | 181 +
.../caps_5.0.0.x86_64.replies | 27179 ++++++++++++++++
.../caps_5.0.0.x86_64.xml | 2697 ++
.../qemuxml2argvdata/aarch64-gic-not-virt.xml | 2 +-
.../aarch64-virt-graphics.aarch64-latest.args | 1 +
.../aarch64-virt-headless.aarch64-latest.args | 1 +
.../channel-unix-guestfwd.x86_64-latest.args | 1 +
.../console-virtio-unix.x86_64-latest.args | 1 +
tests/qemuxml2argvdata/controller-order.args | 2 +-
tests/qemuxml2argvdata/controller-order.xml | 2 +-
.../controller-virtio-scsi.x86_64-latest.args | 1 +
.../default-qemu-host-arch.args | 2 +-
...ult-video-type-aarch64.aarch64-latest.args | 35 +
.../default-video-type-aarch64.xml | 1 -
...default-video-type-ppc64.ppc64-latest.args | 35 +
.../default-video-type-ppc64.xml | 3 +-
...ult-video-type-riscv64.riscv64-latest.args | 34 +
.../default-video-type-riscv64.xml | 1 -
...default-video-type-s390x.s390x-latest.args | 34 +
.../default-video-type-s390x.xml | 3 +-
.../default-video-type-x86_64-caps-test-0.xml | 3 +-
.../default-video-type-x86_64-caps-test-1.xml | 3 +-
.../disk-aio.x86_64-latest.args | 1 +
...-backing-chains-noindex.x86_64-latest.args | 1 +
.../disk-cache.x86_64-1.5.3.args | 4 +-
.../disk-cache.x86_64-2.12.0.args | 4 +-
.../disk-cache.x86_64-2.6.0.args | 4 +-
.../disk-cache.x86_64-2.7.0.args | 4 +-
.../disk-cache.x86_64-latest.args | 4 +-
tests/qemuxml2argvdata/disk-cache.xml | 4 +-
.../disk-cdrom-bus-other.x86_64-latest.args | 1 +
...m-empty-network-invalid.x86_64-latest.args | 1 +
tests/qemuxml2argvdata/disk-cdrom-tray.args | 2 +-
.../disk-cdrom-tray.x86_64-2.12.0.args | 2 +-
.../disk-cdrom-tray.x86_64-latest.args | 2 +-
tests/qemuxml2argvdata/disk-cdrom-tray.xml | 2 +-
.../disk-cdrom.x86_64-latest.args | 1 +
tests/qemuxml2argvdata/disk-copy_on_read.args | 2 +-
.../disk-copy_on_read.x86_64-2.12.0.args | 2 +-
.../disk-copy_on_read.x86_64-latest.args | 2 +-
tests/qemuxml2argvdata/disk-copy_on_read.xml | 2 +-
.../qemuxml2argvdata/disk-detect-zeroes.args | 2 +-
.../disk-detect-zeroes.x86_64-2.12.0.args | 2 +-
.../disk-detect-zeroes.x86_64-latest.args | 2 +-
tests/qemuxml2argvdata/disk-detect-zeroes.xml | 2 +-
tests/qemuxml2argvdata/disk-discard.args | 2 +-
tests/qemuxml2argvdata/disk-discard.xml | 2 +-
.../disk-error-policy.x86_64-latest.args | 1 +
.../disk-floppy.x86_64-latest.args | 1 +
tests/qemuxml2argvdata/disk-ioeventfd.args | 2 +-
tests/qemuxml2argvdata/disk-ioeventfd.xml | 2 +-
.../disk-network-gluster.x86_64-latest.args | 1 +
.../disk-network-iscsi.x86_64-latest.args | 1 +
.../disk-network-nbd.x86_64-latest.args | 1 +
.../disk-network-rbd.x86_64-latest.args | 1 +
.../disk-network-sheepdog.x86_64-latest.args | 1 +
...isk-network-source-auth.x86_64-latest.args | 1 +
.../disk-network-tlsx509.x86_64-latest.args | 2 +-
.../disk-nvme.x86_64-latest.args | 1 +
.../disk-readonly-disk.x86_64-latest.args | 1 +
.../disk-scsi-device-auto.x86_64-latest.args | 1 +
.../disk-scsi.x86_64-latest.args | 1 +
.../disk-shared.x86_64-latest.args | 1 +
...irtio-scsi-reservations.x86_64-latest.args | 1 +
.../eoi-disabled.x86_64-latest.args | 2 +-
.../eoi-enabled.x86_64-latest.args | 2 +-
tests/qemuxml2argvdata/event_idx.args | 2 +-
tests/qemuxml2argvdata/event_idx.xml | 2 +-
.../fd-memory-no-numa-topology.args | 2 +-
.../fd-memory-no-numa-topology.xml | 2 +-
.../fd-memory-numa-topology.args | 2 +-
.../fd-memory-numa-topology.xml | 2 +-
.../fd-memory-numa-topology2.args | 2 +-
.../fd-memory-numa-topology2.xml | 2 +-
.../fd-memory-numa-topology3.args | 2 +-
.../fd-memory-numa-topology3.xml | 2 +-
.../floppy-drive-fat.x86_64-latest.args | 1 +
.../fs9p-ccw.s390x-latest.args | 1 +
.../qemuxml2argvdata/fs9p.x86_64-latest.args | 1 +
.../genid-auto.x86_64-latest.args | 1 +
.../qemuxml2argvdata/genid.x86_64-latest.args | 1 +
...egl-headless-rendernode.x86_64-latest.args | 1 +
.../graphics-egl-headless.x86_64-latest.args | 1 +
...pice-gl-auto-rendernode.x86_64-latest.args | 1 +
...graphics-vnc-tls-secret.x86_64-latest.args | 1 +
.../graphics-vnc-tls.x86_64-latest.args | 1 +
...tdev-mdev-display-ramfb.x86_64-latest.args | 1 +
...play-spice-egl-headless.x86_64-latest.args | 1 +
...ev-display-spice-opengl.x86_64-latest.args | 1 +
...isplay-vnc-egl-headless.x86_64-latest.args | 1 +
...ostdev-mdev-display-vnc.x86_64-latest.args | 1 +
...tdev-subsys-mdev-vfio-ap.s390x-latest.args | 1 +
...ubsys-mdev-vfio-ccw-boot.s390x-latest.args | 1 +
.../hugepages-nvdimm.x86_64-latest.args | 1 +
.../hyperv-off.x86_64-latest.args | 1 +
.../hyperv-panic.x86_64-latest.args | 2 +-
.../hyperv-stimer-direct.x86_64-latest.args | 2 +-
.../hyperv.x86_64-latest.args | 2 +-
...ntel-iommu-caching-mode.x86_64-latest.args | 1 +
.../intel-iommu-caching-mode.xml | 3 +
...ntel-iommu-device-iotlb.x86_64-latest.args | 1 +
.../intel-iommu-device-iotlb.xml | 3 +
.../intel-iommu-eim.x86_64-latest.args | 1 +
tests/qemuxml2argvdata/intel-iommu-eim.xml | 3 +
.../intel-iommu.x86_64-2.6.0.args | 1 +
.../intel-iommu.x86_64-latest.args | 1 +
tests/qemuxml2argvdata/intel-iommu.xml | 3 +
tests/qemuxml2argvdata/interface-driver.xml | 2 +-
.../iommu-smmuv3.aarch64-latest.args | 1 +
...othreads-virtio-scsi-ccw.s390x-latest.args | 3 +-
.../iothreads-virtio-scsi-ccw.xml | 2 +-
...threads-virtio-scsi-pci.x86_64-latest.args | 1 +
.../kvmclock+eoi-disabled.x86_64-latest.args | 2 +-
...memory-default-hugepage.x86_64-latest.args | 3 +-
.../memfd-memory-default-hugepage.xml | 2 +-
.../memfd-memory-numa.x86_64-latest.args | 3 +-
tests/qemuxml2argvdata/memfd-memory-numa.xml | 2 +-
...y-hotplug-nvdimm-access.x86_64-latest.args | 1 +
...ry-hotplug-nvdimm-align.x86_64-latest.args | 1 +
...ry-hotplug-nvdimm-label.x86_64-latest.args | 1 +
...ory-hotplug-nvdimm-pmem.x86_64-latest.args | 1 +
...hotplug-nvdimm-readonly.x86_64-latest.args | 1 +
.../memory-hotplug-nvdimm.x86_64-latest.args | 1 +
.../mlock-off.x86_64-latest.args | 1 +
.../mlock-on.x86_64-latest.args | 1 +
tests/qemuxml2argvdata/net-bandwidth.xml | 2 +-
tests/qemuxml2argvdata/net-bandwidth2.xml | 2 +-
tests/qemuxml2argvdata/net-coalesce.xml | 2 +-
tests/qemuxml2argvdata/net-mtu.xml | 2 +-
.../net-vhostuser.x86_64-latest.args | 1 +
.../qemuxml2argvdata/numatune-distances.args | 4 +-
tests/qemuxml2argvdata/numatune-distances.xml | 2 +-
.../parallel-unix-chardev.x86_64-latest.args | 1 +
.../ppc64-pseries-graphics.ppc64-latest.args | 1 +
.../ppc64-pseries-headless.ppc64-latest.args | 1 +
.../pv-spinlock-disabled.x86_64-latest.args | 2 +-
.../pv-spinlock-enabled.x86_64-latest.args | 2 +-
.../qemu-ns.x86_64-latest.args | 1 +
.../s390x-ccw-graphics.s390x-latest.args | 1 +
.../s390x-ccw-headless.s390x-latest.args | 1 +
.../serial-unix-chardev.x86_64-latest.args | 1 +
...rtcard-passthrough-unix.x86_64-latest.args | 1 +
.../qemuxml2argvdata/tap-vhost-incorrect.xml | 2 +-
tests/qemuxml2argvdata/tap-vhost.xml | 2 +-
...=> tpm-passthrough-crb.x86_64-latest.args} | 19 +-
...rgs => tpm-passthrough.x86_64-latest.args} | 21 +-
tests/qemuxml2argvdata/tpm-passthrough.xml | 2 +-
.../usb-redir-unix.x86_64-latest.args | 1 +
...host-user-gpu-secondary.x86_64-latest.args | 1 +
.../vhost-user-vga.x86_64-latest.args | 1 +
.../vhost-vsock-ccw-auto.s390x-latest.args | 1 +
.../vhost-vsock-ccw.s390x-latest.args | 1 +
.../vhost-vsock.x86_64-latest.args | 2 +-
tests/qemuxml2argvdata/vhost-vsock.xml | 2 +-
tests/qemuxml2argvdata/vhost_queues.xml | 2 +-
...eo-bochs-display-device.x86_64-latest.args | 1 +
.../video-device-pciaddr-default.args | 2 +-
.../video-device-pciaddr-default.xml | 2 +-
...video-qxl-device-vram64.x86_64-latest.args | 1 +
...o-qxl-sec-device-vram64.x86_64-latest.args | 1 +
...eo-ramfb-display-device.x86_64-latest.args | 1 +
tests/qemuxml2argvdata/virtio-lun.args | 2 +-
tests/qemuxml2argvdata/virtio-lun.xml | 2 +-
...virtio-non-transitional.x86_64-latest.args | 1 +
.../virtio-rng-egd-unix.x86_64-latest.args | 1 +
.../virtio-transitional.x86_64-latest.args | 1 +
.../x86_64-pc-graphics.x86_64-latest.args | 1 +
.../x86_64-pc-headless.x86_64-latest.args | 1 +
.../x86_64-q35-graphics.x86_64-latest.args | 1 +
.../x86_64-q35-headless.x86_64-latest.args | 1 +
tests/qemuxml2argvtest.c | 11 +-
.../aarch64-virt-graphics.aarch64-latest.xml | 3 +
.../aarch64-virt-headless.aarch64-latest.xml | 3 +
.../default-qemu-host-arch.xml | 2 +-
...ault-video-type-aarch64.aarch64-latest.xml | 1 -
.../default-video-type-ppc64.ppc64-latest.xml | 14 +-
...ault-video-type-riscv64.riscv64-latest.xml | 1 -
.../default-video-type-s390x.s390x-latest.xml | 8 +-
.../default-video-type-x86_64-caps-test-0.xml | 5 +-
.../default-video-type-x86_64-caps-test-1.xml | 5 +-
...-cache.xml => disk-cache.x86_64-1.5.3.xml} | 6 +-
.../disk-cache.x86_64-2.12.0.xml | 60 +
.../disk-cache.x86_64-2.6.0.xml | 60 +
.../disk-cache.x86_64-2.7.0.xml | 60 +
.../disk-cache.x86_64-latest.xml | 63 +
...om-empty-network-invalid.x86_64-latest.xml | 3 +
.../qemuxml2xmloutdata/disk-copy_on_read.xml | 2 +-
tests/qemuxml2xmloutdata/disk-discard.xml | 2 +-
tests/qemuxml2xmloutdata/event_idx.xml | 2 +-
.../genid-active.x86_64-latest.xml | 3 +
.../genid-auto-active.x86_64-latest.xml | 3 +
.../genid-auto-inactive.x86_64-latest.xml | 3 +
.../genid-inactive.x86_64-latest.xml | 3 +
...subsys-mdev-vfio-ccw-boot.s390x-latest.xml | 3 +
.../intel-iommu.x86_64-2.6.0.xml | 3 +
tests/qemuxml2xmloutdata/interface-driver.xml | 2 +-
.../iommu-smmuv3.aarch64-latest.xml | 3 +
.../iothreads-virtio-scsi-ccw.xml | 2 +-
tests/qemuxml2xmloutdata/net-bandwidth.xml | 2 +-
tests/qemuxml2xmloutdata/net-bandwidth2.xml | 2 +-
tests/qemuxml2xmloutdata/net-coalesce.xml | 2 +-
tests/qemuxml2xmloutdata/net-mtu.xml | 2 +-
.../ppc64-pseries-graphics.ppc64-latest.xml | 3 +
.../ppc64-pseries-headless.ppc64-latest.xml | 3 +
.../s390x-ccw-graphics.s390x-latest.xml | 3 +
.../s390x-ccw-headless.s390x-latest.xml | 3 +
.../tap-vhost-incorrect.xml | 2 +-
tests/qemuxml2xmloutdata/tap-vhost.xml | 2 +-
.../tpm-passthrough.x86_64-latest.xml | 2 +-
tests/qemuxml2xmloutdata/vhost_queues.xml | 2 +-
.../video-device-pciaddr-default.xml | 2 +-
tests/qemuxml2xmloutdata/virtio-lun.xml | 2 +-
.../virtio-non-transitional.x86_64-latest.xml | 3 +
.../virtio-transitional.x86_64-latest.xml | 3 +
.../x86_64-pc-graphics.x86_64-latest.xml | 3 +
.../x86_64-pc-headless.x86_64-latest.xml | 3 +
.../x86_64-q35-graphics.x86_64-latest.xml | 3 +
.../x86_64-q35-headless.x86_64-latest.xml | 3 +
tests/qemuxml2xmltest.c | 6 +-
tests/testutilsqemu.c | 71 +-
tests/vircapstest.c | 4 +-
227 files changed, 31219 insertions(+), 182 deletions(-)
create mode 100644 tests/domaincapsdata/qemu_5.0.0-q35.x86_64.xml
create mode 100644 tests/domaincapsdata/qemu_5.0.0-tcg.x86_64.xml
create mode 100644 tests/domaincapsdata/qemu_5.0.0.x86_64.xml
create mode 100644 tests/qemucapabilitiesdata/caps_5.0.0.x86_64.replies
create mode 100644 tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml
create mode 100644 tests/qemuxml2argvdata/default-video-type-aarch64.aarch64-latest.args
create mode 100644 tests/qemuxml2argvdata/default-video-type-ppc64.ppc64-latest.args
create mode 100644 tests/qemuxml2argvdata/default-video-type-riscv64.riscv64-latest.args
create mode 100644 tests/qemuxml2argvdata/default-video-type-s390x.s390x-latest.args
rename tests/qemuxml2argvdata/{tpm-passthrough-crb.args => tpm-passthrough-crb.x86_64-latest.args} (61%)
rename tests/qemuxml2argvdata/{tpm-passthrough.args => tpm-passthrough.x86_64-latest.args} (56%)
rename tests/qemuxml2xmloutdata/{disk-cache.xml => disk-cache.x86_64-1.5.3.xml} (92%)
create mode 100644 tests/qemuxml2xmloutdata/disk-cache.x86_64-2.12.0.xml
create mode 100644 tests/qemuxml2xmloutdata/disk-cache.x86_64-2.6.0.xml
create mode 100644 tests/qemuxml2xmloutdata/disk-cache.x86_64-2.7.0.xml
create mode 100644 tests/qemuxml2xmloutdata/disk-cache.x86_64-latest.xml
--
2.24.1
4 years, 10 months
[libvirt PATCHv2 00/10] add virtiofs support (virtio-fs epopee)
by Ján Tomko
v1: https://www.redhat.com/archives/libvir-list/2019-November/msg00005.html
https://bugzilla.redhat.com/show_bug.cgi?id=1694166
Ján Tomko (10):
conf: use virXMLFormatElement in virDomainFSDefFormat
qemu: add QEMU_CAPS_VHOST_USER_FS
schema: wrap fsDriver in a choice group
conf: qemu: add virtiofs fsdriver type
conf: add virtiofs-related elements and attributes
qemu: add virtiofs_debug to qemu.conf
qemu: validate virtiofs filesystems
qemu: add code for handling virtiofsd
qemu: build vhost-user-fs device command line
docs: add virtiofs kbase
docs/formatdomain.html.in | 23 ++
docs/kbase.html.in | 3 +
docs/kbase/virtiofs.rst | 153 +++++++++++
docs/schemas/domaincommon.rng | 117 +++++++--
po/POTFILES.in | 1 +
src/conf/domain_conf.c | 161 +++++++++++-
src/conf/domain_conf.h | 17 ++
src/libvirt_private.syms | 1 +
src/qemu/Makefile.inc.am | 2 +
src/qemu/libvirtd_qemu.aug | 1 +
src/qemu/qemu.conf | 7 +
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 49 +++-
src/qemu/qemu_conf.c | 2 +
src/qemu/qemu_conf.h | 1 +
src/qemu/qemu_domain.c | 36 +++
src/qemu/qemu_domain.h | 2 +-
src/qemu/qemu_domain_address.c | 4 +
src/qemu/qemu_extdevice.c | 19 ++
src/qemu/qemu_virtiofs.c | 241 ++++++++++++++++++
src/qemu/qemu_virtiofs.h | 37 +++
src/qemu/test_libvirtd_qemu.aug.in | 1 +
.../caps_4.2.0.aarch64.xml | 1 +
.../qemucapabilitiesdata/caps_4.2.0.s390x.xml | 1 +
.../caps_4.2.0.x86_64.xml | 1 +
...vhost-user-fs-fd-memory.x86_64-latest.args | 38 +++
.../vhost-user-fs-fd-memory.xml | 42 +++
...vhost-user-fs-hugepages.x86_64-latest.args | 46 ++++
.../vhost-user-fs-hugepages.xml | 75 ++++++
tests/qemuxml2argvtest.c | 9 +
.../vhost-user-fs-fd-memory.x86_64-latest.xml | 1 +
.../vhost-user-fs-hugepages.x86_64-latest.xml | 1 +
tests/qemuxml2xmltest.c | 3 +
34 files changed, 1064 insertions(+), 35 deletions(-)
create mode 100644 docs/kbase/virtiofs.rst
create mode 100644 src/qemu/qemu_virtiofs.c
create mode 100644 src/qemu/qemu_virtiofs.h
create mode 100644 tests/qemuxml2argvdata/vhost-user-fs-fd-memory.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/vhost-user-fs-fd-memory.xml
create mode 100644 tests/qemuxml2argvdata/vhost-user-fs-hugepages.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/vhost-user-fs-hugepages.xml
create mode 120000 tests/qemuxml2xmloutdata/vhost-user-fs-fd-memory.x86_64-latest.xml
create mode 120000 tests/qemuxml2xmloutdata/vhost-user-fs-hugepages.x86_64-latest.xml
--
2.21.0
4 years, 10 months
[libvirt PATCH] qemu: explicitly disable virgl when requested
by Jonathon Jongsma
If a domain is configured to have an egl-headless display and a virtio
video device, virgl will be enabled automatically within the guest, even
if the video device is configured with accel3d='no'.
In this case we should explicitly pass 'virgl=off' to qemu.
See https://bugzilla.redhat.com/show_bug.cgi?id=1791236 for more
information.
Signed-off-by: Jonathon Jongsma <jjongsma(a)redhat.com>
---
src/qemu/qemu_command.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 46680fd829..3378413ee1 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -4429,7 +4429,10 @@ qemuBuildDeviceVideoStr(const virDomainDef *def,
if (video->backend != VIR_DOMAIN_VIDEO_BACKEND_TYPE_VHOSTUSER &&
video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO) {
- if (video->accel && video->accel->accel3d == VIR_TRISTATE_SWITCH_ON) {
+ if (video->accel &&
+ virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_GPU_VIRGL) &&
+ (video->accel->accel3d == VIR_TRISTATE_SWITCH_ON ||
+ video->accel->accel3d == VIR_TRISTATE_SWITCH_OFF)) {
virBufferAsprintf(&buf, ",virgl=%s",
virTristateSwitchTypeToString(video->accel->accel3d));
}
--
2.21.0
4 years, 10 months
[PATCH v2 0/2] qemu: prevent too-deeply nested backing XML
by Peter Krempa
Patch 1 is new in the series. Patch 2 deals (partially) with review
feedback on v1.
Peter Krempa (2):
qemu: snapshot: Always rewrite backingStore data when reusing existing
images
qemu: snapshot: Prevent too-nested domain XML when doing inactive
snapshot
src/qemu/qemu_driver.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--
2.24.1
4 years, 10 months
[libvirt] [PATCH v2 0/5] Support rng backend model builtin
by Han Han
https://bugzilla.redhat.com/show_bug.cgi?id=1785091
Implement 'rng-builtin' backend from QEMU. This feature is introduced
to QEMU since v4.2. It uses getrandom() to get random, no external
random source needed.
github repo: https://github.com/qiankehan/libvirt/tree/rng-builtin_v2
Changes from v1:
- Fix failures in 'make check' and 'make syntax-check'
- Adjust the structure of patches
v1:
https://www.redhat.com/archives/libvir-list/2020-January/msg00000.html
Han Han (5):
qemu_capabilities: Introduce QEMU_CAPS_OBJECT_RNG_BUILTIN
util: Do not assume comma after object id
conf: Add rng backend model builtin
qemu: Implement builtin rng backend
news: Update news for rng backend type builtin
docs/formatdomain.html.in | 10 ++++++
docs/formatdomaincaps.html.in | 1 +
docs/news.xml | 10 ++++++
docs/schemas/domaincommon.rng | 6 ++++
src/conf/domain_audit.c | 2 ++
src/conf/domain_conf.c | 9 +++++
src/conf/domain_conf.h | 1 +
src/qemu/qemu_capabilities.c | 4 +++
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 15 ++++++++
src/qemu/qemu_domain.c | 3 ++
src/util/virqemu.c | 12 ++++---
.../domaincapsdata/qemu_4.2.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_4.2.0-tcg.x86_64.xml | 1 +
.../qemu_4.2.0-virt.aarch64.xml | 1 +
tests/domaincapsdata/qemu_4.2.0.aarch64.xml | 1 +
tests/domaincapsdata/qemu_4.2.0.ppc64.xml | 1 +
tests/domaincapsdata/qemu_4.2.0.s390x.xml | 1 +
tests/domaincapsdata/qemu_4.2.0.x86_64.xml | 1 +
.../caps_4.2.0.aarch64.xml | 1 +
.../qemucapabilitiesdata/caps_4.2.0.ppc64.xml | 1 +
.../qemucapabilitiesdata/caps_4.2.0.s390x.xml | 1 +
.../caps_4.2.0.x86_64.xml | 1 +
.../virtio-rng-builtin.x86_64-latest.args | 35 +++++++++++++++++++
tests/qemuxml2argvdata/virtio-rng-builtin.xml | 26 ++++++++++++++
tests/qemuxml2argvtest.c | 1 +
.../virtio-rng-builtin.x86_64-latest.xml | 31 ++++++++++++++++
tests/qemuxml2xmltest.c | 1 +
28 files changed, 174 insertions(+), 5 deletions(-)
create mode 100644 tests/qemuxml2argvdata/virtio-rng-builtin.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/virtio-rng-builtin.xml
create mode 100644 tests/qemuxml2xmloutdata/virtio-rng-builtin.x86_64-latest.xml
--
2.24.0.rc1
4 years, 10 months
Re: [Bug 1860759] Re: [REGRESSION] option `-snapshot` ignored with blockdev
by Eric Blake
On 1/24/20 4:41 AM, Ildar wrote:
> Max, thanks a lot for the explanation.
> Do you mean that snapshot-ing isn't possible totally for blockdev? Then I
> guess some libvirt users are in trouble :((
> Actually I didn't quite caught the reason why a blockdev supports backing
> but not {backing to a file on /tmp then promptly deleted} ? What's the
> technical difference?
>
On 1/24/20 4:05 AM, Max Reitz wrote:
>
>
> I don’t know much about libvirt, but I would have thought that any
> manual modification of the qemu command line isn’t supported and might
> always break.
>
> Anyway, from a QEMU POV, -snapshot only works with -drive (this includes
> -hda, etc.). It doesn’t work with -blockdev. I can see that this isn’t
> documented for -snapshot, but basically whenever -blockdev is used, the
> user assumes full responsibility for the block graph (or at least that
> particular subgraph). We cannot enable snapshot functionality then.
Libvirt has never produced a qemu command line containing '-snapshot'.
Part of this is that libvirt wants to control SELinux settings, and
letting qemu create a temporary overlay in /tmp in order to implement
-snapshot does not play nicely with libvirt pre-creating all files that
qemu is allowed to access.
The fact that you were able to manually add -snapshot to your qemu
command line with older libvirt using -drive (I'm assuming you were also
not using libvirt's SELinux support, because if you were, qemu would
have been unable to create/access the temporary wrapper in /tmp), is a
nice hack. But since modern qemu has declared -snapshot to be
unsupported with -blockdev, and modern libvirt has switched to
-blockdev, I claim that this is not a qemu bug, but a libvirt feature
request.
That said, libvirt has had a vision for a design for implementing the
equivalent of -drive -snapshot: the <transient/> sub-element added to
the domain/disk/source/driver element has been documented for a long time:
https://libvirt.org/formatdomain.html
"transient
If present, this indicates that changes to the device contents
should be reverted automatically when the guest exits. With some
hypervisors, marking a disk transient prevents the domain from
participating in migration or snapshots. Since 0.9.5 "
However, no one has yet implemented it for libvirt's qemu driver. Part
of our reluctance has been that we knew that implementing it would
require libvirt to precreate the wrapper file on every guest start, and
it is only very recently that we've even had enough functionality in
libvirt's qemu driver coupled with new qemu commands to create qcow2
images using QMP rather than having to shell out to qemu-img. And part
of it is that there was no point in implementing something to work with
-drive, when we knew we had to rework everything for -blockdev anyways.
But now that the work in libvirt to switch to -blockdev is done, it
should be a lot easier to implement PROPER support for the <transient/>
tag, at least for -blockdev usage.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
4 years, 10 months
[PATCH 0/3] qemu_capabilities: Reword domain caps cache
by Michal Privoznik
It's fairly easy to reproduce the bug (see its description in 3/3). Just
put a sleep here:
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index b62dd1df52..eeae967420 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -1399,6 +1399,7 @@ virQEMUDriverGetDomainCapabilities(virQEMUDriverPtr driver,
key = g_strdup_printf("%d:%d:%s:%s", data.arch, data.virttype,
NULLSTR(data.machine), NULLSTR(data.path));
+ sleep(5);
if (virHashAddEntry(domCapsCache, key, domCaps) < 0)
return NULL;
}
And then try to get domcaps from two consoles at once:
virsh domcapabilities
One will succeed, the other will fail with an error.
Michal Prívozník (3):
cpu.c: Check properly for virCapabilitiesGetNodeInfo() retval
qemu_conf: Avoid dereferencing NULL in
virQEMUDriverGetHost{NUMACaps,CPU}
qemu_capabilities: Reword domain caps cache
src/cpu/cpu.c | 2 +-
src/qemu/qemu_capabilities.c | 118 +++++++++++++++++++++++++++++++++--
src/qemu/qemu_capabilities.h | 14 ++++-
src/qemu/qemu_conf.c | 86 +++++++++----------------
4 files changed, 155 insertions(+), 65 deletions(-)
--
2.24.1
4 years, 10 months
[PATCH 0/4] qemu: fix block jobs when copy_on_read is enabled
by Peter Krempa
QEMU requires us to pass the topmost node(-name) in the backing chain as
the 'device' argument for the blockdev-mirror/block-commit commands.
Otherwise QEMU complains:
"Need a root block node"
Since libvirt always puts the copy-on-read driver on top of the backing
chain, blockjobs on disks which use "copy_on_read" fail.
The series below fixes that by passing the proper node. This fixes it
just fine for the mirror, but for block-commit we still get another
error due to a bug in qemu:
"'libvirt-4-format' is not in this backing file chain"
Additionally one weird thing happens with block-stream (blockpull). If I
pass the layer below the copy-on-read as 'device', everything works.
This is kind of weird as the documentation for that is the same. If I
pass the nodename of copy-on-read.
Max, Kevin, could you please comment on the block-stream part and
possibly also on the plans to fix the issue with block-commit?
Cc: Max Reitz <mreitz(a)redhat.com>
CC: Kevin Wolf <kwolf(a)redhat.com>
https://bugzilla.redhat.com/show_bug.cgi?id=1792195
Peter Krempa (4):
qemu: blockcopy: Actually unplug unused images when mirror job fails
to start
qemu: domain: Extract code to determine topmost nodename to
qemuDomainDiskGetTopNodename
qemu: Fix value of 'device' argument for blockdev-mirror
qemu: Fix value of 'device' argument for block-commit
src/qemu/qemu_domain.c | 38 ++++++++++++++++++++++++++------------
src/qemu/qemu_domain.h | 4 ++++
src/qemu/qemu_driver.c | 6 +++---
src/qemu/qemu_migration.c | 2 +-
4 files changed, 34 insertions(+), 16 deletions(-)
--
2.24.1
4 years, 10 months
[PATCH] qemu: block: Don't skip creation of 'luks' formatted images
by Peter Krempa
libvirt treats 'luks' images as raw+encryption. The logic in
qemuBlockStorageSourceCreateFormat skipped the creation if the requested
image was raw but didn't take into account the encryption.
This manifested itself e.g. when attempting to do a virsh blockcopy with
the following XML:
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='/tmp/enccpy'>
<encryption format='luks'>
<secret type='passphrase' uuid='0a81f5b2-8403-7b23-c8d6-21ccc2f80d6f'/>
</encryption>
</source>
</disk>
Where qemu would report the following error:
unable to execute QEMU command 'blockdev-add': Volume is not in LUKS format
rather than actually formatting the image first.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_block.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
index eab21bc107..22f03da485 100644
--- a/src/qemu/qemu_block.c
+++ b/src/qemu/qemu_block.c
@@ -2479,7 +2479,8 @@ qemuBlockStorageSourceCreateFormat(virDomainObjPtr vm,
g_autoptr(virJSONValue) createformatprops = NULL;
int ret;
- if (src->format == VIR_STORAGE_FILE_RAW)
+ if (src->format == VIR_STORAGE_FILE_RAW &&
+ !src->encryption)
return 0;
if (qemuBlockStorageSourceCreateGetFormatProps(src, backingStore,
--
2.24.1
4 years, 10 months