[PATCH 00/20] qemu: Fix virtio video devcice frontend selection logic for migrations
TL;DR: We've historically made selection of the specific virtio frontend device based on qemu capabilities but didn't record the choice. Migrations break if your qemu deployment differs. For more in-depth analysis see 16/20. This series conists of: -- refactor of removing detected qemu capabilities via config or the QMEU namespace -- fix to capability detection if host has no qemu -- addition of testing covering various possibilities for the virtio video devices which show specifics -- addition of XML infra for the new property holding the data -- refactors of the virtio selection code -- selecting the model in post parse callbacks -- fixing of validation code -- fixing of commandline generator Peter Krempa (20): qemu: capabilities: Apply 'capability_filters' configration option on all capabilities qemu: capabilities: Export 'virQEMUCapsNewCopy' outside of 'qemu_capspriv' qemu: Allow reuse of 'qemuProcessStartUpdateCustomCaps' qemu: validate: Validate VM config with qemuCaps influenced by <qemu:capabilities> qemu: postparse: Process VM config with qemuCaps influenced by <qemu:capabilities> virQEMUCapsCacheLookupDefault: Fix error message when no emulators are installed qemuxmlconfdata: un-symlink 'video-virtio-vga-gpu-gl' output qemuxmlconftest: Add 'video-virtio-vga' invocation with QEMU_CAPS_DEVICE_VIRTIO_VGA disabled qemuxmlconftest: Add test cases for configs asking for 'virtio-gpu-gl' or 'virtio-vga-gl' without the capability qemuxmlconftest: Add invocation of 'video-virtio-vga-gpu-gl' with missing caps and VIR_DOMAIN_DEF_PARSE_ABI_UPDATE qemustatusxml2xml: Add test case capturing virtio video device virDomainVideoDefFormat: Use 'virXMLFormatElement' instead of custom formatter conf: Add fields for recording actually-selected virtio video device qemuxmlconftest: Add test case for specifying 'virtio-gpu' where 'virtio-vga' would be picked qemuDeviceVideoGetModel: Directly return picked model qemu: postparse: Fill in selected virtio video frondend device in the XML qemuValidateDomainDeviceDefVideo: Fix checks of virtio video devices qemuDeviceVideoGetModel: Remove logic for selecting 'virtio' devices qemuDeviceVideoGetModel: Simplify by relying on checks from 'qemuValidateDomainDeviceDefVideo' qemu: Remove 'qemuDomainSupportsVideoVga' docs/formatdomain.rst | 8 + src/conf/domain_conf.c | 114 +++-- src/conf/domain_conf.h | 15 + src/conf/schemas/domaincommon.rng | 18 +- src/libvirt_private.syms | 1 + src/qemu/qemu_capabilities.c | 26 +- src/qemu/qemu_capabilities.h | 5 +- src/qemu/qemu_capspriv.h | 5 +- src/qemu/qemu_command.c | 163 +++--- src/qemu/qemu_domain.c | 96 +++- src/qemu/qemu_domain.h | 9 +- src/qemu/qemu_driver.c | 23 +- src/qemu/qemu_postparse.c | 108 +++- src/qemu/qemu_process.c | 55 +-- src/qemu/qemu_validate.c | 110 +++-- tests/qemucapsprobe.c | 3 +- .../virtio-vga-upgrade-in.xml | 466 ++++++++++++++++++ .../virtio-vga-upgrade-missing-in.xml | 464 +++++++++++++++++ .../virtio-vga-upgrade-missing-out.xml | 457 +++++++++++++++++ .../virtio-vga-upgrade-out.xml | 459 +++++++++++++++++ tests/qemuxmlactivetest.c | 6 + .../aarch64-video-default.aarch64-latest.xml | 2 +- ...64-video-virtio-gpu-pci.aarch64-latest.xml | 2 +- ...fault-models.aarch64-latest.abi-update.xml | 2 +- ...h64-virt-default-models.aarch64-latest.xml | 2 +- .../aarch64-virt-graphics.aarch64-latest.xml | 2 +- ...ault-video-type-aarch64.aarch64-latest.xml | 2 +- ...eo-type-loongarch64.loongarch64-latest.xml | 2 +- ...ault-video-type-riscv64.riscv64-latest.xml | 2 +- .../default-video-type-s390x.s390x-latest.xml | 2 +- ...t-models.loongarch64-latest.abi-update.xml | 2 +- ...virt-default-models.loongarch64-latest.xml | 2 +- ...rch64-virt-graphics.loongarch64-latest.xml | 2 +- .../q35-pcie-autoadd.x86_64-latest.xml | 2 +- .../q35-pcie.x86_64-latest.xml | 2 +- ...fault-models.riscv64-latest.abi-update.xml | 2 +- ...v64-virt-default-models.riscv64-latest.xml | 2 +- .../riscv64-virt-graphics.riscv64-latest.xml | 2 +- ...default-models.s390x-latest.abi-update.xml | 2 +- .../s390x-ccw-default-models.s390x-latest.xml | 2 +- .../s390x-ccw-graphics.s390x-latest.xml | 2 +- ...vhost-user-gpu-secondary.x86_64-latest.xml | 4 +- .../vhost-user-vga.x86_64-latest.xml | 2 +- .../video-virtio-blob-off.x86_64-latest.xml | 4 +- .../video-virtio-blob-on.x86_64-latest.xml | 4 +- .../video-virtio-edid-none.x86_64-latest.xml | 2 +- .../video-virtio-edid-off.x86_64-latest.xml | 2 +- .../video-virtio-edid-on.x86_64-latest.xml | 2 +- ...video-virtio-gpu-ccw-auto.s390x-latest.xml | 2 +- .../video-virtio-gpu-ccw.s390x-latest.xml | 4 +- .../video-virtio-gpu-device.x86_64-latest.xml | 2 +- .../video-virtio-gpu-sdl-gl.x86_64-latest.xml | 2 +- ...deo-virtio-gpu-secondary.x86_64-latest.xml | 4 +- ...ideo-virtio-gpu-spice-gl.x86_64-latest.xml | 2 +- .../video-virtio-gpu-virgl.x86_64-latest.xml | 2 +- ...io-vga-device-downgrade.x86_64-latest.args | 37 ++ ...tio-vga-device-downgrade.x86_64-latest.xml | 44 ++ .../video-virtio-vga-device-downgrade.xml | 33 ++ ..._VIRTIO_GPU_GL_PCI-disabled-ABI_UPDATE.err | 1 + ....QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled.args | 35 ++ ...t.QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled.xml | 46 ++ ...APS_VIRTIO_VGA_GL-disabled-ABI_UPDATE.args | 35 ++ ...CAPS_VIRTIO_VGA_GL-disabled-ABI_UPDATE.xml | 46 ++ ...test.QEMU_CAPS_VIRTIO_VGA_GL-disabled.args | 35 ++ ...atest.QEMU_CAPS_VIRTIO_VGA_GL-disabled.xml | 46 ++ .../video-virtio-vga-gpu-gl.x86_64-latest.xml | 47 +- ....QEMU_CAPS_DEVICE_VIRTIO_VGA-disabled.args | 37 ++ ...t.QEMU_CAPS_DEVICE_VIRTIO_VGA-disabled.xml | 44 ++ .../video-virtio-vga.x86_64-latest.xml | 2 +- ...virtio-options-video-ats.x86_64-latest.xml | 4 +- ...rtio-options-video-iommu.x86_64-latest.xml | 4 +- ...tio-options-video-packed.x86_64-latest.xml | 4 +- tests/qemuxmlconfdata/virtio-options.xml | 2 +- tests/qemuxmlconftest.c | 29 ++ tests/testutilsqemu.c | 3 +- 75 files changed, 2908 insertions(+), 315 deletions(-) create mode 100644 tests/qemustatusxml2xmldata/virtio-vga-upgrade-in.xml create mode 100644 tests/qemustatusxml2xmldata/virtio-vga-upgrade-missing-in.xml create mode 100644 tests/qemustatusxml2xmldata/virtio-vga-upgrade-missing-out.xml create mode 100644 tests/qemustatusxml2xmldata/virtio-vga-upgrade-out.xml create mode 100644 tests/qemuxmlconfdata/video-virtio-vga-device-downgrade.x86_64-latest.args create mode 100644 tests/qemuxmlconfdata/video-virtio-vga-device-downgrade.x86_64-latest.xml create mode 100644 tests/qemuxmlconfdata/video-virtio-vga-device-downgrade.xml create mode 100644 tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled-ABI_UPDATE.err create mode 100644 tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled.args create mode 100644 tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled.xml create mode 100644 tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_VGA_GL-disabled-ABI_UPDATE.args create mode 100644 tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_VGA_GL-disabled-ABI_UPDATE.xml create mode 100644 tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_VGA_GL-disabled.args create mode 100644 tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_VGA_GL-disabled.xml mode change 120000 => 100644 tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.xml create mode 100644 tests/qemuxmlconfdata/video-virtio-vga.x86_64-latest.QEMU_CAPS_DEVICE_VIRTIO_VGA-disabled.args create mode 100644 tests/qemuxmlconfdata/video-virtio-vga.x86_64-latest.QEMU_CAPS_DEVICE_VIRTIO_VGA-disabled.xml -- 2.54.0
From: Peter Krempa <pkrempa@redhat.com> The 'capability_filters' allows admins to globally disable some qemu capabilities via the config file. Until now it was applied only directly when starting the VM, but that is too late as the capability is still present when e.g. the post-parse code is picking defaults. Rework the code so that 'capability_filters' is applied directly after probing qemu so all existing capabilities will lack the filtered out ones. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/qemu/qemu_capabilities.c | 21 ++++++++++++++++++--- src/qemu/qemu_capabilities.h | 3 ++- src/qemu/qemu_capspriv.h | 3 ++- src/qemu/qemu_driver.c | 23 ++++++++++++++++++++++- src/qemu/qemu_process.c | 19 +++---------------- tests/qemucapsprobe.c | 3 ++- tests/testutilsqemu.c | 3 ++- 7 files changed, 51 insertions(+), 24 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 1c89c0a1de..961fbfc336 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -4551,6 +4551,11 @@ struct _virQEMUCapsCachePriv { /* cache whether /dev/kvm is usable as runUid:runGuid */ virTristateBool kvmUsable; time_t kvmCtime; + + /* qemu.conf allows masking out supported capabilities via + * 'capabilities_filter' configuration. 'maskedCaps' if non-NULL + * maps out which bits are to be removed */ + virBitmap *maskedCaps; }; typedef struct _virQEMUCapsCachePriv virQEMUCapsCachePriv; @@ -4564,6 +4569,7 @@ virQEMUCapsCachePrivFree(void *privData) g_free(priv->kernelVersion); virCPUDataFree(priv->cpuData); g_free(priv->hostCPUSignature); + virBitmapFree(priv->maskedCaps); g_free(priv); } @@ -6123,7 +6129,8 @@ virQEMUCapsNewForBinaryInternal(virArch hostArch, const char *hostCPUSignature, unsigned int microcodeVersion, const char *kernelVersion, - virCPUData* cpuData) + virCPUData* cpuData, + virBitmap *maskedCaps) { g_autoptr(virQEMUCaps) qemuCaps = virQEMUCapsNewBinary(binary); struct stat sb; @@ -6162,6 +6169,10 @@ virQEMUCapsNewForBinaryInternal(virArch hostArch, qemuCaps->libvirtCtime = virGetSelfLastChanged(); qemuCaps->libvirtVersion = LIBVIR_VERSION_NUMBER; + /* If we have capabilities masked out via qemu.conf apply them here */ + if (maskedCaps) + virBitmapSubtract(qemuCaps->flags, maskedCaps); + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) virQEMUCapsInitHostCPUModel(qemuCaps, hostArch, VIR_DOMAIN_VIRT_KVM); if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_HVF)) @@ -6202,7 +6213,8 @@ virQEMUCapsNewData(const char *binary, priv->hostCPUSignature, virHostCPUGetMicrocodeVersion(priv->hostArch), priv->kernelVersion, - priv->cpuData); + priv->cpuData, + priv->maskedCaps); } @@ -6241,7 +6253,8 @@ virFileCache * virQEMUCapsCacheNew(const char *libDir, const char *cacheDir, uid_t runUid, - gid_t runGid) + gid_t runGid, + virBitmap *maskedCaps) { g_autofree char *capsCacheDir = NULL; virFileCache *cache = NULL; @@ -6271,9 +6284,11 @@ virQEMUCapsCacheNew(const char *libDir, priv->kernelVersion = g_strdup_printf("%s %s", uts.release, uts.version); priv->cpuData = virCPUDataGetHost(); + priv->maskedCaps = maskedCaps; return cache; error: + virBitmapFree(maskedCaps); virObjectUnref(cache); return NULL; } diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index b027d37bf3..71ae8514d5 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -868,7 +868,8 @@ char * virQEMUCapsGetDefaultEmulator(virArch hostarch, virFileCache *virQEMUCapsCacheNew(const char *libDir, const char *cacheDir, uid_t uid, - gid_t gid); + gid_t gid, + virBitmap *maskedCaps); virQEMUCaps *virQEMUCapsCacheLookup(virFileCache *cache, const char *binary); virQEMUCaps *virQEMUCapsCacheLookupCopy(virFileCache *cache, diff --git a/src/qemu/qemu_capspriv.h b/src/qemu/qemu_capspriv.h index 55286d7d29..9dca15d09b 100644 --- a/src/qemu/qemu_capspriv.h +++ b/src/qemu/qemu_capspriv.h @@ -36,7 +36,8 @@ virQEMUCapsNewForBinaryInternal(virArch hostArch, const char *hostCPUSignature, unsigned int microcodeVersion, const char *kernelVersion, - virCPUData* cpuData); + virCPUData* cpuData, + virBitmap *maskedCaps); int virQEMUCapsLoadCache(virArch hostArch, virQEMUCaps *qemuCaps, diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 544955ecf9..b4cc09c81a 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -539,6 +539,7 @@ qemuStateInitialize(bool privileged, const char *defsecmodel = NULL; g_autoptr(virIdentity) identity = virIdentityGetCurrent(); virDomainDriverAutoStartConfig autostartCfg; + g_autoptr(virBitmap) maskedCaps = NULL; qemu_driver = g_new0(virQEMUDriver, 1); @@ -848,10 +849,30 @@ qemuStateInitialize(bool privileged, run_gid = cfg->group; } + if (cfg->capabilityfilters) { + int tmp; + char **next; + + maskedCaps = virBitmapNew(0); + + for (next = cfg->capabilityfilters; *next; next++) { + if ((tmp = virQEMUCapsTypeFromString(*next)) < 0) { + virReportError(VIR_ERR_CONF_SYNTAX, + _("invalid capability_filters capability '%1$s'"), + *next); + return -1; + } + + virBitmapSetBitExpand(maskedCaps, tmp); + } + } + + qemu_driver->qemuCapsCache = virQEMUCapsCacheNew(cfg->libDir, cfg->cacheDir, run_uid, - run_gid); + run_gid, + g_steal_pointer(&maskedCaps)); if (!qemu_driver->qemuCapsCache) goto error; diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 530cd442a5..019f1a0c21 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -5915,25 +5915,12 @@ static int qemuProcessStartUpdateCustomCaps(virDomainObj *vm) { qemuDomainObjPrivate *priv = vm->privateData; - g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(priv->driver); qemuDomainXmlNsDef *nsdef = vm->def->namespaceData; - char **next; - int tmp; - - if (cfg->capabilityfilters) { - for (next = cfg->capabilityfilters; *next; next++) { - if ((tmp = virQEMUCapsTypeFromString(*next)) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("invalid capability_filters capability '%1$s'"), - *next); - return -1; - } - - virQEMUCapsClear(priv->qemuCaps, tmp); - } - } if (nsdef) { + char **next; + int tmp; + for (next = nsdef->capsadd; next && *next; next++) { if ((tmp = virQEMUCapsTypeFromString(*next)) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, diff --git a/tests/qemucapsprobe.c b/tests/qemucapsprobe.c index cd117170ab..8ce5c10dec 100644 --- a/tests/qemucapsprobe.c +++ b/tests/qemucapsprobe.c @@ -79,7 +79,8 @@ main(int argc, char **argv) return EXIT_FAILURE; if (!(caps = virQEMUCapsNewForBinaryInternal(VIR_ARCH_NONE, argv[1], "/tmp", - -1, -1, NULL, 0, NULL, NULL))) + -1, -1, NULL, 0, NULL, NULL, + NULL))) return EXIT_FAILURE; host = virArchFromHost(); diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index 11097dbb3e..e5e3342b53 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -373,7 +373,8 @@ int qemuTestDriverInit(virQEMUDriver *driver) /* Using /dev/null for libDir and cacheDir automatically produces errors * upon attempt to use any of them */ - driver->qemuCapsCache = virQEMUCapsCacheNew("/dev/null", "/dev/null", 0, 0); + driver->qemuCapsCache = virQEMUCapsCacheNew("/dev/null", "/dev/null", + 0, 0, NULL); if (!driver->qemuCapsCache) goto error; -- 2.54.0
From: Peter Krempa <pkrempa@redhat.com> Upcoming patch will add a function which will need to optionally copy passed capabilities for modification. Export 'virQEMUCapsNewCopy' outside of tests. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/qemu/qemu_capabilities.c | 3 ++- src/qemu/qemu_capabilities.h | 2 ++ src/qemu/qemu_capspriv.h | 2 -- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 961fbfc336..3810d3f5f8 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2095,7 +2095,8 @@ virQEMUCapsAccelCopy(virQEMUCapsAccel *dst, } -virQEMUCaps *virQEMUCapsNewCopy(virQEMUCaps *qemuCaps) +virQEMUCaps * +virQEMUCapsNewCopy(virQEMUCaps *qemuCaps) { g_autoptr(virQEMUCaps) ret = virQEMUCapsNewBinary(qemuCaps->binary); size_t i; diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 71ae8514d5..3014f3dc5e 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -883,6 +883,8 @@ virQEMUCaps *virQEMUCapsCacheLookupDefault(virFileCache *cache, virDomainVirtType *retVirttype, const char **retMachine); +virQEMUCaps *virQEMUCapsNewCopy(virQEMUCaps *qemuCaps); + virCaps *virQEMUCapsInit(virFileCache *cache); int virQEMUCapsGetDefaultVersion(virCaps *caps, diff --git a/src/qemu/qemu_capspriv.h b/src/qemu/qemu_capspriv.h index 9dca15d09b..3dfff2e3d8 100644 --- a/src/qemu/qemu_capspriv.h +++ b/src/qemu/qemu_capspriv.h @@ -25,8 +25,6 @@ #pragma once -virQEMUCaps *virQEMUCapsNewCopy(virQEMUCaps *qemuCaps); - virQEMUCaps * virQEMUCapsNewForBinaryInternal(virArch hostArch, const char *binary, -- 2.54.0
From: Peter Krempa <pkrempa@redhat.com> Move and rename the function to 'qemuDomainUpdateCustomCapabilities' and modify the arguments so that it will be possible to reuse it also in the post-parse and validation code which ought to base decisions on the same logic as VM startup would. Since copying of the qemu capabilities object is very expensive (I've observed an almost 4x slowdown of qemuxmlconftest) 'qemuDomainUpdateCustomCapabilities' copies the capabilities only when necessary. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/qemu/qemu_domain.c | 79 +++++++++++++++++++++++++++++++++++++++++ src/qemu/qemu_domain.h | 6 ++++ src/qemu/qemu_process.c | 42 +--------------------- 3 files changed, 86 insertions(+), 41 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 2f1d220966..e87ea8bdc0 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -11754,3 +11754,82 @@ qemuDomainMachineSupportsFloppy(const char *machine, return true; } + + +/** + * qemuDomainUpdateCustomCapabilities: + * @def: domain definition + * @qemuCaps: qemu capabilities + * @qemuCapsCopy: if non-NULL filled filled with a valid virQEMUCaps pointer (see below) + * + * Updates @qemuCaps based on the qemu namespace XML config for modifying + * capabilities: + * + * <domain type='qemu' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'> + * <qemu:capabilities> + * <qemu:add capability='blockdev'/> + * <qemu:del capability='drive'/> + * </qemu:capabilities> + * </domain> + * + * If @qemuCapsCopy is NULL, @qemuCaps is directly modified. + * + * If @qemuCapsCopy is non-NULL, it's always filled with a virQEMUCaps instance + * that the caller needs to unref. The following applies: + * - no caps modification needed: @qemuCaps is ref'd and filled into @qemuCapsCopy + * - caps modifications are needed: @qemuCaps is copied into @qemuCapsCopy and + * modifications happen on the copy + * + * Returns 0 on success (including when no modification was needed), -1 on + * error and reports libvirt errors. + */ +int +qemuDomainUpdateCustomCapabilities(const virDomainDef *def, + virQEMUCaps *qemuCaps, + virQEMUCaps **qemuCapsCopy) +{ + qemuDomainXmlNsDef *nsdef = def->namespaceData; + char **next; + int tmp; + + if (!nsdef || + (!nsdef->capsadd && !nsdef->capsdel)) { + + if (qemuCapsCopy) + *qemuCapsCopy = virObjectRef(qemuCaps); + + return 0; + } + + if (qemuCapsCopy) { + *qemuCapsCopy = virQEMUCapsNewCopy(qemuCaps); + + qemuCaps = *qemuCapsCopy; + } + + for (next = nsdef->capsadd; next && *next; next++) { + if ((tmp = virQEMUCapsTypeFromString(*next)) < 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("invalid qemu namespace capability '%1$s'"), + *next); + return -1; + } + + virQEMUCapsSet(qemuCaps, tmp); + } + + for (next = nsdef->capsdel; next && *next; next++) { + if ((tmp = virQEMUCapsTypeFromString(*next)) < 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("invalid qemu namespace capability '%1$s'"), + *next); + return -1; + } + + virQEMUCapsClear(qemuCaps, tmp); + } + + virQEMUCapsInitProcessCapsInterlock(qemuCaps); + + return 0; +} diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 24e62dd2e7..f1654d8a19 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -1192,3 +1192,9 @@ qemuDomainMachineSupportsFloppy(const char *machine, virObject * qemuDomainHostdevPrivateNew(void); + +int +qemuDomainUpdateCustomCapabilities(const virDomainDef *def, + virQEMUCaps *qemuCaps, + virQEMUCaps **qemuCapsCopy) + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 019f1a0c21..cbe5cb33d3 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -5911,43 +5911,6 @@ qemuProcessStartValidate(virQEMUDriver *driver, } -static int -qemuProcessStartUpdateCustomCaps(virDomainObj *vm) -{ - qemuDomainObjPrivate *priv = vm->privateData; - qemuDomainXmlNsDef *nsdef = vm->def->namespaceData; - - if (nsdef) { - char **next; - int tmp; - - for (next = nsdef->capsadd; next && *next; next++) { - if ((tmp = virQEMUCapsTypeFromString(*next)) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("invalid qemu namespace capability '%1$s'"), - *next); - return -1; - } - - virQEMUCapsSet(priv->qemuCaps, tmp); - } - - for (next = nsdef->capsdel; next && *next; next++) { - if ((tmp = virQEMUCapsTypeFromString(*next)) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("invalid qemu namespace capability '%1$s'"), - *next); - return -1; - } - - virQEMUCapsClear(priv->qemuCaps, tmp); - } - } - - return 0; -} - - /** * qemuProcessPrepareQEMUCaps: * @vm: domain object @@ -5971,12 +5934,9 @@ qemuProcessPrepareQEMUCaps(virDomainObj *vm, return -1; /* Update qemu capabilities according to lists passed in via namespace */ - if (qemuProcessStartUpdateCustomCaps(vm) < 0) + if (qemuDomainUpdateCustomCapabilities(vm->def, priv->qemuCaps, NULL) < 0) return -1; - /* re-process capability lockouts since we might have removed capabilities */ - virQEMUCapsInitProcessCapsInterlock(priv->qemuCaps); - return 0; } -- 2.54.0
From: Peter Krempa <pkrempa@redhat.com> The user configuration of added/removed qemu capabilities via the qemu namespace element was applied only right before generating a commandline, but the validation code didn't see these. Modify the validation entry points so that they apply this optionally. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/qemu/qemu_validate.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 82ef761fb8..7c0ea402c3 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -1295,18 +1295,21 @@ qemuValidateDomainDef(const virDomainDef *def, void *parseOpaque) { virQEMUDriver *driver = opaque; + virQEMUCaps *qemuCapsIn = parseOpaque; g_autoptr(virQEMUCaps) qemuCapsLocal = NULL; - virQEMUCaps *qemuCaps = parseOpaque; + g_autoptr(virQEMUCaps) qemuCaps = NULL; size_t i; - if (!qemuCaps) { + if (!qemuCapsIn) { if (!(qemuCapsLocal = virQEMUCapsCacheLookup(driver->qemuCapsCache, def->emulator))) return -1; - - qemuCaps = qemuCapsLocal; + qemuCapsIn = qemuCapsLocal; } + if (qemuDomainUpdateCustomCapabilities(def, qemuCapsIn, &qemuCaps) < 0) + return -1; + if (def->os.type != VIR_DOMAIN_OSTYPE_HVM) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("Emulator '%1$s' does not support os type '%2$s'"), @@ -6047,17 +6050,20 @@ qemuValidateDomainDeviceDef(const virDomainDeviceDef *dev, void *parseOpaque) { virQEMUDriver *driver = opaque; + virQEMUCaps *qemuCapsIn = parseOpaque; g_autoptr(virQEMUCaps) qemuCapsLocal = NULL; - virQEMUCaps *qemuCaps = parseOpaque; + g_autoptr(virQEMUCaps) qemuCaps = NULL; - if (!qemuCaps) { + if (!qemuCapsIn) { if (!(qemuCapsLocal = virQEMUCapsCacheLookup(driver->qemuCapsCache, def->emulator))) return -1; - - qemuCaps = qemuCapsLocal; + qemuCapsIn = qemuCapsLocal; } + if (qemuDomainUpdateCustomCapabilities(def, qemuCapsIn, &qemuCaps) < 0) + return -1; + if (qemuValidateDomainDeviceInfo(dev, def, qemuCaps) < 0) return -1; -- 2.54.0
From: Peter Krempa <pkrempa@redhat.com> The user configuration of added/removed qemu capabilities via the qemu namespace element was applied only right before generating a commandline, but the post parse code code didn't see these. Apply the capability modification prior to running post parse code so that defaults are properly picked based on the configuration. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/qemu/qemu_postparse.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_postparse.c b/src/qemu/qemu_postparse.c index 79e02e34ac..e4ff902ae1 100644 --- a/src/qemu/qemu_postparse.c +++ b/src/qemu/qemu_postparse.c @@ -1919,9 +1919,16 @@ qemuDomainPostParseDataAlloc(const virDomainDef *def, void **parseOpaque) { virQEMUDriver *driver = opaque; + g_autoptr(virQEMUCaps) qemuCapsLocal = NULL; - if (!(*parseOpaque = virQEMUCapsCacheLookup(driver->qemuCapsCache, - def->emulator))) + *parseOpaque = NULL; + + if (!(qemuCapsLocal = virQEMUCapsCacheLookup(driver->qemuCapsCache, + def->emulator))) + return 1; + + if (qemuDomainUpdateCustomCapabilities(def, qemuCapsLocal, + (virQEMUCaps **) parseOpaque) < 0) return 1; return 0; -- 2.54.0
From: Peter Krempa <pkrempa@redhat.com> When querying capabilities for the default emulator with no other arguments (e.g. 'virsh domcapabilities) fix error whithout emulator installed an error is reported but the error would mention '(null)' architecture: # virsh domcapabilities error: failed to get emulator capabilities error: unsupported configuration: unable to find any emulator to serve '(null)' architecture This happens as the error formatting takes 'archStr' which is NULL for the default architecture instead of using 'arch' which is populated by the host's architecture and converting it back. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/qemu/qemu_capabilities.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 3810d3f5f8..a28f87ad2b 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -6385,7 +6385,7 @@ virQEMUCapsCacheLookupDefault(virFileCache *cache, if (!binary) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("unable to find any emulator to serve '%1$s' architecture"), - archStr); + virArchToString(arch)); return NULL; } -- 2.54.0
From: Peter Krempa <pkrempa@redhat.com> Upcoming patches will add additional testing for various virtio-*-gl devices, including filling of the default model. The output file needs to not influnece the input for this test to work properly. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- .../video-virtio-vga-gpu-gl.x86_64-latest.xml | 47 ++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) mode change 120000 => 100644 tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.xml diff --git a/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.xml b/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.xml deleted file mode 120000 index 34e32ab8ba..0000000000 --- a/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.xml +++ /dev/null @@ -1 +0,0 @@ -video-virtio-vga-gpu-gl.xml \ No newline at end of file diff --git a/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.xml b/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.xml new file mode 100644 index 0000000000..991141c643 --- /dev/null +++ b/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.xml @@ -0,0 +1,46 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>1048576</memory> + <currentMemory unit='KiB'>1048576</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='x86_64' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>qemu64</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <controller type='ide' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> + </controller> + <controller type='usb' index='0' model='piix3-uhci'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> + </controller> + <controller type='pci' index='0' model='pci-root'/> + <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <audio id='1' type='none'/> + <video> + <model type='virtio' heads='1' primary='yes'> + <acceleration accel3d='yes'/> + </model> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> + </video> + <video> + <model type='virtio' heads='1'> + <acceleration accel3d='yes'/> + </model> + <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> + </video> + <memballoon model='virtio'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> + </memballoon> + </devices> +</domain> -- 2.54.0
From: Peter Krempa <pkrempa@redhat.com> The test case shows that if the 'QEMU_CAPS_DEVICE_VIRTIO_VGA' capability is not present (e.g. if the corresponding qemu module isn't installed) libvirt will pick: -device '{"driver":"virtio-gpu-pci", ... instead of: -device '{"driver":"virtio-vga", ... but without any discernable difference in the XML. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- ....QEMU_CAPS_DEVICE_VIRTIO_VGA-disabled.args | 37 ++++++++++++++++ ...t.QEMU_CAPS_DEVICE_VIRTIO_VGA-disabled.xml | 44 +++++++++++++++++++ tests/qemuxmlconftest.c | 5 +++ 3 files changed, 86 insertions(+) create mode 100644 tests/qemuxmlconfdata/video-virtio-vga.x86_64-latest.QEMU_CAPS_DEVICE_VIRTIO_VGA-disabled.args create mode 100644 tests/qemuxmlconfdata/video-virtio-vga.x86_64-latest.QEMU_CAPS_DEVICE_VIRTIO_VGA-disabled.xml diff --git a/tests/qemuxmlconfdata/video-virtio-vga.x86_64-latest.QEMU_CAPS_DEVICE_VIRTIO_VGA-disabled.args b/tests/qemuxmlconfdata/video-virtio-vga.x86_64-latest.QEMU_CAPS_DEVICE_VIRTIO_VGA-disabled.args new file mode 100644 index 0000000000..34d0ab7ce1 --- /dev/null +++ b/tests/qemuxmlconfdata/video-virtio-vga.x86_64-latest.QEMU_CAPS_DEVICE_VIRTIO_VGA-disabled.args @@ -0,0 +1,37 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1 \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ +/usr/bin/qemu-system-x86_64 \ +-name guest=QEMUGuest1,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ +-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \ +-accel tcg \ +-cpu qemu64 \ +-m size=1048576k \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":1073741824}' \ +-overcommit mem-lock=off \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,fd=@mon-fd@,server=on,wait=off \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-boot strict=on \ +-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \ +-blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/QEMUGuest1","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap","cache":{"direct":true,"no-flush":false}}' \ +-blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"direct":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}' \ +-device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1,"write-cache":"on"}' \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-device '{"driver":"virtio-gpu-pci","id":"video0","max_outputs":1,"bus":"pci.0","addr":"0x2"}' \ +-device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x3"}' \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxmlconfdata/video-virtio-vga.x86_64-latest.QEMU_CAPS_DEVICE_VIRTIO_VGA-disabled.xml b/tests/qemuxmlconfdata/video-virtio-vga.x86_64-latest.QEMU_CAPS_DEVICE_VIRTIO_VGA-disabled.xml new file mode 100644 index 0000000000..0c31cfb927 --- /dev/null +++ b/tests/qemuxmlconfdata/video-virtio-vga.x86_64-latest.QEMU_CAPS_DEVICE_VIRTIO_VGA-disabled.xml @@ -0,0 +1,44 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>1048576</memory> + <currentMemory unit='KiB'>1048576</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='x86_64' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>qemu64</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <disk type='file' device='disk'> + <driver name='qemu' type='qcow2' cache='none'/> + <source file='/var/lib/libvirt/images/QEMUGuest1'/> + <target dev='hda' bus='ide'/> + <address type='drive' controller='0' bus='0' target='0' unit='0'/> + </disk> + <controller type='ide' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> + </controller> + <controller type='usb' index='0' model='piix3-uhci'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> + </controller> + <controller type='pci' index='0' model='pci-root'/> + <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <audio id='1' type='none'/> + <video> + <model type='virtio' heads='1' primary='yes'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> + </video> + <memballoon model='virtio'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> + </memballoon> + </devices> +</domain> diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index 7c592862bc..ffe8ccde66 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -2634,6 +2634,11 @@ mymain(void) DO_TEST_CAPS_LATEST("video-virtio-gpu-sdl-gl"); DO_TEST_CAPS_LATEST("video-virtio-gpu-secondary"); DO_TEST_CAPS_LATEST("video-virtio-vga"); + DO_TEST_FULL("video-virtio-vga", ".x86_64-latest.QEMU_CAPS_DEVICE_VIRTIO_VGA-disabled", + ARG_CAPS_ARCH, "x86_64", + ARG_CAPS_VER, "latest", + ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_VIRTIO_VGA, QEMU_CAPS_LAST, + ARG_END); DO_TEST_CAPS_LATEST("video-virtio-blob-on"); DO_TEST_CAPS_LATEST("video-virtio-blob-off"); DO_TEST_CAPS_LATEST("video-virtio-vga-gpu-gl"); -- 2.54.0
From: Peter Krempa <pkrempa@redhat.com> The capability check in 'qemuValidateDomainDeviceDefVideo' which validates whether a <video> definition with acceleration enabled is possible is only aggregate, thus validates that any '-gl' video backend is available. Since qemu compiles each backend into a separate module it's possible to have an installation where 'virtio-gpu-pci-gl' exist but 'virtio-vga-gl' doesn't and it will not be rejected at validation. The commandline though will generate a device *without* the '-gl' which is ABI incompatible with the counterpart which does have '-gl', but the VM starts. If such a VM is then migrated to a deployment which does have the '-gl' variant available, migration will fail because qemu will generate the '-gl' device as we don't record this fact in the XML. This test case captures this situation which will be fixed later. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- ....QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled.args | 35 ++++++++++++++ ...t.QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled.xml | 46 +++++++++++++++++++ ...test.QEMU_CAPS_VIRTIO_VGA_GL-disabled.args | 35 ++++++++++++++ ...atest.QEMU_CAPS_VIRTIO_VGA_GL-disabled.xml | 46 +++++++++++++++++++ tests/qemuxmlconftest.c | 10 ++++ 5 files changed, 172 insertions(+) create mode 100644 tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled.args create mode 100644 tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled.xml create mode 100644 tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_VGA_GL-disabled.args create mode 100644 tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_VGA_GL-disabled.xml diff --git a/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled.args b/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled.args new file mode 100644 index 0000000000..cd19fd5d17 --- /dev/null +++ b/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled.args @@ -0,0 +1,35 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1 \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ +/usr/bin/qemu-system-x86_64 \ +-name guest=QEMUGuest1,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ +-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \ +-accel tcg \ +-cpu qemu64 \ +-m size=1048576k \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":1073741824}' \ +-overcommit mem-lock=off \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,fd=@mon-fd@,server=on,wait=off \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-boot strict=on \ +-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-device '{"driver":"virtio-vga-gl","id":"video0","max_outputs":1,"bus":"pci.0","addr":"0x2"}' \ +-device '{"driver":"virtio-gpu-pci","id":"video1","max_outputs":1,"bus":"pci.0","addr":"0x4"}' \ +-device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x3"}' \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled.xml b/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled.xml new file mode 100644 index 0000000000..991141c643 --- /dev/null +++ b/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled.xml @@ -0,0 +1,46 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>1048576</memory> + <currentMemory unit='KiB'>1048576</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='x86_64' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>qemu64</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <controller type='ide' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> + </controller> + <controller type='usb' index='0' model='piix3-uhci'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> + </controller> + <controller type='pci' index='0' model='pci-root'/> + <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <audio id='1' type='none'/> + <video> + <model type='virtio' heads='1' primary='yes'> + <acceleration accel3d='yes'/> + </model> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> + </video> + <video> + <model type='virtio' heads='1'> + <acceleration accel3d='yes'/> + </model> + <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> + </video> + <memballoon model='virtio'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> + </memballoon> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_VGA_GL-disabled.args b/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_VGA_GL-disabled.args new file mode 100644 index 0000000000..c84e9ee9a2 --- /dev/null +++ b/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_VGA_GL-disabled.args @@ -0,0 +1,35 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1 \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ +/usr/bin/qemu-system-x86_64 \ +-name guest=QEMUGuest1,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ +-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \ +-accel tcg \ +-cpu qemu64 \ +-m size=1048576k \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":1073741824}' \ +-overcommit mem-lock=off \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,fd=@mon-fd@,server=on,wait=off \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-boot strict=on \ +-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-device '{"driver":"virtio-vga","id":"video0","max_outputs":1,"bus":"pci.0","addr":"0x2"}' \ +-device '{"driver":"virtio-gpu-gl-pci","id":"video1","max_outputs":1,"bus":"pci.0","addr":"0x4"}' \ +-device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x3"}' \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_VGA_GL-disabled.xml b/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_VGA_GL-disabled.xml new file mode 100644 index 0000000000..991141c643 --- /dev/null +++ b/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_VGA_GL-disabled.xml @@ -0,0 +1,46 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>1048576</memory> + <currentMemory unit='KiB'>1048576</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='x86_64' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>qemu64</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <controller type='ide' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> + </controller> + <controller type='usb' index='0' model='piix3-uhci'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> + </controller> + <controller type='pci' index='0' model='pci-root'/> + <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <audio id='1' type='none'/> + <video> + <model type='virtio' heads='1' primary='yes'> + <acceleration accel3d='yes'/> + </model> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> + </video> + <video> + <model type='virtio' heads='1'> + <acceleration accel3d='yes'/> + </model> + <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> + </video> + <memballoon model='virtio'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> + </memballoon> + </devices> +</domain> diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index ffe8ccde66..68a2b1ab19 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -2642,6 +2642,16 @@ mymain(void) DO_TEST_CAPS_LATEST("video-virtio-blob-on"); DO_TEST_CAPS_LATEST("video-virtio-blob-off"); DO_TEST_CAPS_LATEST("video-virtio-vga-gpu-gl"); + DO_TEST_FULL("video-virtio-vga-gpu-gl", ".x86_64-latest.QEMU_CAPS_VIRTIO_VGA_GL-disabled", + ARG_CAPS_ARCH, "x86_64", + ARG_CAPS_VER, "latest", + ARG_QEMU_CAPS_DEL, QEMU_CAPS_VIRTIO_VGA_GL, QEMU_CAPS_LAST, + ARG_END); + DO_TEST_FULL("video-virtio-vga-gpu-gl", ".x86_64-latest.QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled", + ARG_CAPS_ARCH, "x86_64", + ARG_CAPS_VER, "latest", + ARG_QEMU_CAPS_DEL, QEMU_CAPS_VIRTIO_GPU_GL_PCI, QEMU_CAPS_LAST, + ARG_END); DO_TEST_CAPS_LATEST("video-virtio-edid-none"); DO_TEST_CAPS_LATEST("video-virtio-edid-off"); DO_TEST_CAPS_LATEST("video-virtio-edid-on"); -- 2.54.0
From: Peter Krempa <pkrempa@redhat.com> Similarly to previous patch add testing of 'virtio-gpu-gl' or 'virtio-vga-gl' with missing the respective capabilities, but this time allowing VIR_DOMAIN_DEF_PARSE_ABI_UPDATE. This will later on show that in case when the fallback can't be honoured the code will not pick a device that doesn't support acceleration (the non-gl variant). Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- ...VIRTIO_GPU_GL_PCI-disabled-ABI_UPDATE.args | 35 ++++++++++++++ ..._VIRTIO_GPU_GL_PCI-disabled-ABI_UPDATE.xml | 46 +++++++++++++++++++ ...APS_VIRTIO_VGA_GL-disabled-ABI_UPDATE.args | 35 ++++++++++++++ ...CAPS_VIRTIO_VGA_GL-disabled-ABI_UPDATE.xml | 46 +++++++++++++++++++ tests/qemuxmlconftest.c | 12 +++++ 5 files changed, 174 insertions(+) create mode 100644 tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled-ABI_UPDATE.args create mode 100644 tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled-ABI_UPDATE.xml create mode 100644 tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_VGA_GL-disabled-ABI_UPDATE.args create mode 100644 tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_VGA_GL-disabled-ABI_UPDATE.xml diff --git a/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled-ABI_UPDATE.args b/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled-ABI_UPDATE.args new file mode 100644 index 0000000000..cd19fd5d17 --- /dev/null +++ b/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled-ABI_UPDATE.args @@ -0,0 +1,35 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1 \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ +/usr/bin/qemu-system-x86_64 \ +-name guest=QEMUGuest1,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ +-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \ +-accel tcg \ +-cpu qemu64 \ +-m size=1048576k \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":1073741824}' \ +-overcommit mem-lock=off \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,fd=@mon-fd@,server=on,wait=off \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-boot strict=on \ +-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-device '{"driver":"virtio-vga-gl","id":"video0","max_outputs":1,"bus":"pci.0","addr":"0x2"}' \ +-device '{"driver":"virtio-gpu-pci","id":"video1","max_outputs":1,"bus":"pci.0","addr":"0x4"}' \ +-device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x3"}' \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled-ABI_UPDATE.xml b/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled-ABI_UPDATE.xml new file mode 100644 index 0000000000..991141c643 --- /dev/null +++ b/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled-ABI_UPDATE.xml @@ -0,0 +1,46 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>1048576</memory> + <currentMemory unit='KiB'>1048576</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='x86_64' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>qemu64</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <controller type='ide' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> + </controller> + <controller type='usb' index='0' model='piix3-uhci'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> + </controller> + <controller type='pci' index='0' model='pci-root'/> + <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <audio id='1' type='none'/> + <video> + <model type='virtio' heads='1' primary='yes'> + <acceleration accel3d='yes'/> + </model> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> + </video> + <video> + <model type='virtio' heads='1'> + <acceleration accel3d='yes'/> + </model> + <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> + </video> + <memballoon model='virtio'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> + </memballoon> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_VGA_GL-disabled-ABI_UPDATE.args b/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_VGA_GL-disabled-ABI_UPDATE.args new file mode 100644 index 0000000000..c84e9ee9a2 --- /dev/null +++ b/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_VGA_GL-disabled-ABI_UPDATE.args @@ -0,0 +1,35 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1 \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ +/usr/bin/qemu-system-x86_64 \ +-name guest=QEMUGuest1,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ +-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \ +-accel tcg \ +-cpu qemu64 \ +-m size=1048576k \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":1073741824}' \ +-overcommit mem-lock=off \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,fd=@mon-fd@,server=on,wait=off \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-boot strict=on \ +-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-device '{"driver":"virtio-vga","id":"video0","max_outputs":1,"bus":"pci.0","addr":"0x2"}' \ +-device '{"driver":"virtio-gpu-gl-pci","id":"video1","max_outputs":1,"bus":"pci.0","addr":"0x4"}' \ +-device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x3"}' \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_VGA_GL-disabled-ABI_UPDATE.xml b/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_VGA_GL-disabled-ABI_UPDATE.xml new file mode 100644 index 0000000000..991141c643 --- /dev/null +++ b/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_VGA_GL-disabled-ABI_UPDATE.xml @@ -0,0 +1,46 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>1048576</memory> + <currentMemory unit='KiB'>1048576</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='x86_64' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>qemu64</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <controller type='ide' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> + </controller> + <controller type='usb' index='0' model='piix3-uhci'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> + </controller> + <controller type='pci' index='0' model='pci-root'/> + <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <audio id='1' type='none'/> + <video> + <model type='virtio' heads='1' primary='yes'> + <acceleration accel3d='yes'/> + </model> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> + </video> + <video> + <model type='virtio' heads='1'> + <acceleration accel3d='yes'/> + </model> + <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> + </video> + <memballoon model='virtio'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> + </memballoon> + </devices> +</domain> diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index 68a2b1ab19..2423eadbfb 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -2647,11 +2647,23 @@ mymain(void) ARG_CAPS_VER, "latest", ARG_QEMU_CAPS_DEL, QEMU_CAPS_VIRTIO_VGA_GL, QEMU_CAPS_LAST, ARG_END); + DO_TEST_FULL("video-virtio-vga-gpu-gl", ".x86_64-latest.QEMU_CAPS_VIRTIO_VGA_GL-disabled-ABI_UPDATE", + ARG_CAPS_ARCH, "x86_64", + ARG_CAPS_VER, "latest", + ARG_QEMU_CAPS_DEL, QEMU_CAPS_VIRTIO_VGA_GL, QEMU_CAPS_LAST, + ARG_PARSEFLAGS, VIR_DOMAIN_DEF_PARSE_ABI_UPDATE, + ARG_END); DO_TEST_FULL("video-virtio-vga-gpu-gl", ".x86_64-latest.QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled", ARG_CAPS_ARCH, "x86_64", ARG_CAPS_VER, "latest", ARG_QEMU_CAPS_DEL, QEMU_CAPS_VIRTIO_GPU_GL_PCI, QEMU_CAPS_LAST, ARG_END); + DO_TEST_FULL("video-virtio-vga-gpu-gl", ".x86_64-latest.QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled-ABI_UPDATE", + ARG_CAPS_ARCH, "x86_64", + ARG_CAPS_VER, "latest", + ARG_QEMU_CAPS_DEL, QEMU_CAPS_VIRTIO_GPU_GL_PCI, QEMU_CAPS_LAST, + ARG_PARSEFLAGS, VIR_DOMAIN_DEF_PARSE_ABI_UPDATE, + ARG_END); DO_TEST_CAPS_LATEST("video-virtio-edid-none"); DO_TEST_CAPS_LATEST("video-virtio-edid-off"); DO_TEST_CAPS_LATEST("video-virtio-edid-on"); -- 2.54.0
From: Peter Krempa <pkrempa@redhat.com> Add example of two running configs with distinct recorded capabilities (presence of QEMU_CAPS_DEVICE_VIRTIO_VGA at startup) which will demonstrate the recording of the picked actual device type on the commandline. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- .../virtio-vga-upgrade-in.xml | 466 ++++++++++++++++++ .../virtio-vga-upgrade-missing-in.xml | 464 +++++++++++++++++ .../virtio-vga-upgrade-missing-out.xml | 457 +++++++++++++++++ .../virtio-vga-upgrade-out.xml | 459 +++++++++++++++++ tests/qemuxmlactivetest.c | 6 + 5 files changed, 1852 insertions(+) create mode 100644 tests/qemustatusxml2xmldata/virtio-vga-upgrade-in.xml create mode 100644 tests/qemustatusxml2xmldata/virtio-vga-upgrade-missing-in.xml create mode 100644 tests/qemustatusxml2xmldata/virtio-vga-upgrade-missing-out.xml create mode 100644 tests/qemustatusxml2xmldata/virtio-vga-upgrade-out.xml diff --git a/tests/qemustatusxml2xmldata/virtio-vga-upgrade-in.xml b/tests/qemustatusxml2xmldata/virtio-vga-upgrade-in.xml new file mode 100644 index 0000000000..8e526c4cc3 --- /dev/null +++ b/tests/qemustatusxml2xmldata/virtio-vga-upgrade-in.xml @@ -0,0 +1,466 @@ +<!-- +WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE +OVERWRITTEN AND LOST. Changes to this xml configuration should be made using: + virsh edit virtio-vga-test +or other application using the libvirt API. +--> + +<domstatus state='running' reason='booted' pid='1348839'> + <monitor path='/var/lib/libvirt/qemu/domain-2-virtio-vga-test/monitor.sock' type='unix'/> + <namespaces> + <mount/> + </namespaces> + <vcpus> + <vcpu id='0' pid='1348848'/> + <vcpu id='1' pid='1348850'/> + </vcpus> + <qemuCaps> + <flag name='kvm'/> + <flag name='sdl'/> + <flag name='spice'/> + <flag name='hda-duplex'/> + <flag name='ccid-emulated'/> + <flag name='ccid-passthru'/> + <flag name='piix3-usb-uhci'/> + <flag name='piix4-usb-uhci'/> + <flag name='usb-ehci'/> + <flag name='ich9-usb-ehci1'/> + <flag name='pci-ohci'/> + <flag name='usb-redir'/> + <flag name='usb-hub'/> + <flag name='ich9-ahci'/> + <flag name='scsi-disk.channel'/> + <flag name='scsi-block'/> + <flag name='hda-micro'/> + <flag name='nec-usb-xhci'/> + <flag name='lsi'/> + <flag name='virtio-scsi-pci'/> + <flag name='usb-redir.filter'/> + <flag name='seccomp-sandbox'/> + <flag name='vnc'/> + <flag name='qxl'/> + <flag name='VGA'/> + <flag name='cirrus-vga'/> + <flag name='vmware-svga'/> + <flag name='usb-serial'/> + <flag name='virtio-rng'/> + <flag name='rng-random'/> + <flag name='rng-egd'/> + <flag name='megasas'/> + <flag name='tpm-passthrough'/> + <flag name='tpm-tis'/> + <flag name='pci-bridge'/> + <flag name='vfio-pci'/> + <flag name='dmi-to-pci-bridge'/> + <flag name='usb-storage'/> + <flag name='virtio-mmio'/> + <flag name='ich9-intel-hda'/> + <flag name='kvm-pit-lost-tick-policy'/> + <flag name='pvpanic'/> + <flag name='usb-kbd'/> + <flag name='usb-audio'/> + <flag name='rtc-reset-reinjection'/> + <flag name='VGA.vgamem_mb'/> + <flag name='vmware-svga.vgamem_mb'/> + <flag name='qxl.vgamem_mb'/> + <flag name='pc-dimm'/> + <flag name='machine-vmport-opt'/> + <flag name='pci-serial'/> + <flag name='ioh3420'/> + <flag name='x3130-upstream'/> + <flag name='xio3130-downstream'/> + <flag name='rtl8139'/> + <flag name='e1000'/> + <flag name='virtio-net'/> + <flag name='virtio-gpu'/> + <flag name='virtio-keyboard'/> + <flag name='virtio-mouse'/> + <flag name='virtio-tablet'/> + <flag name='virtio-input-host'/> + <flag name='virtio-balloon-pci.deflate-on-oom'/> + <flag name='mptsas1068'/> + <flag name='spice-gl'/> + <flag name='qxl.vram64_size_mb'/> + <flag name='pxb'/> + <flag name='pxb-pcie'/> + <flag name='intel-iommu'/> + <flag name='virtio-vga'/> + <flag name='ivshmem-plain'/> + <flag name='ivshmem-doorbell'/> + <flag name='vhost-scsi'/> + <flag name='query-cpu-model-expansion'/> + <flag name='spice-rendernode'/> + <flag name='nvdimm'/> + <flag name='pcie-root-port'/> + <flag name='query-cpu-definitions'/> + <flag name='qemu-xhci'/> + <flag name='intel-iommu.intremap'/> + <flag name='intel-iommu.caching-mode'/> + <flag name='intel-iommu.eim'/> + <flag name='intel-iommu.device-iotlb'/> + <flag name='vmcoreinfo'/> + <flag name='isa-serial'/> + <flag name='pcie-pci-bridge'/> + <flag name='nbd-tls'/> + <flag name='tpm-crb'/> + <flag name='pr-manager-helper'/> + <flag name='screendump_device'/> + <flag name='hda-output'/> + <flag name='vmgenid'/> + <flag name='vhost-vsock'/> + <flag name='tpm-emulator'/> + <flag name='mch'/> + <flag name='mch.extended-tseg-mbytes'/> + <flag name='egl-headless'/> + <flag name='memory-backend-memfd'/> + <flag name='memory-backend-memfd.hugetlb'/> + <flag name='egl-headless.rendernode'/> + <flag name='nvdimm.unarmed'/> + <flag name='virtio-pci-non-transitional'/> + <flag name='x86-max-cpu'/> + <flag name='cpu-unavailable-features'/> + <flag name='canonical-cpu-features'/> + <flag name='bochs-display'/> + <flag name='migration-file-drop-cache'/> + <flag name='dbus-vmstate'/> + <flag name='vhost-user-gpu'/> + <flag name='vhost-user-vga'/> + <flag name='query-cpu-model-baseline'/> + <flag name='query-cpu-model-comparison'/> + <flag name='ramfb'/> + <flag name='drive-nvme'/> + <flag name='smp-dies'/> + <flag name='i8042'/> + <flag name='rng-builtin'/> + <flag name='vhost-user-fs'/> + <flag name='fsdev.multidevs'/> + <flag name='pcie-root-port.hotplug'/> + <flag name='aio.io_uring'/> + <flag name='tcg'/> + <flag name='pvscsi'/> + <flag name='cpu.migratable'/> + <flag name='intel-iommu.aw-bits'/> + <flag name='numa.hmat'/> + <flag name='usb-host.hostdevice'/> + <flag name='virtio-balloon.free-page-reporting'/> + <flag name='netdev.vhost-vdpa'/> + <flag name='dc390'/> + <flag name='am53c974'/> + <flag name='virtio-pmem-pci'/> + <flag name='vhost-user-fs.bootindex'/> + <flag name='vhost-user-blk'/> + <flag name='cpu-max'/> + <flag name='memory-backend-file.x-use-canonical-path-for-ramblock-id'/> + <flag name='vnc-power-control'/> + <flag name='rotation-rate'/> + <flag name='acpi-index'/> + <flag name='input-linux'/> + <flag name='virtio-gpu-gl-pci'/> + <flag name='virtio-vga-gl'/> + <flag name='confidential-guest-support'/> + <flag name='set-action'/> + <flag name='virtio-blk.queue-size'/> + <flag name='virtio-mem-pci'/> + <flag name='memory-backend-file.reserve'/> + <flag name='piix4.acpi-root-pci-hotplug'/> + <flag name='netdev.json'/> + <flag name='query-dirty-rate'/> + <flag name='rbd-encryption'/> + <flag name='sev-guest-kernel-hashes'/> + <flag name='sev-inject-launch-secret'/> + <flag name='device.json+hotplug'/> + <flag name='virtio-mem-pci.prealloc'/> + <flag name='calc-dirty-rate'/> + <flag name='dirtyrate-param.mode'/> + <flag name='blockdev.nbd.tls-hostname'/> + <flag name='memory-backend-file.prealloc-threads'/> + <flag name='virtio-iommu-pci'/> + <flag name='virtio-iommu.boot-bypass'/> + <flag name='virtio-net.rss'/> + <flag name='chardev.qemu-vdagent'/> + <flag name='display-dbus'/> + <flag name='iothread.thread-pool-max'/> + <flag name='usb-host.guest-resets-all'/> + <flag name='migration.blocked-reasons'/> + <flag name='query-stats'/> + <flag name='query-stats-schemas'/> + <flag name='thread-context'/> + <flag name='screenshot-format-png'/> + <flag name='machine-hpet'/> + <flag name='netdev.stream'/> + <flag name='virtio-crypto'/> + <flag name='cryptodev-backend-lkcf'/> + <flag name='pvpanic-pci'/> + <flag name='virtio-gpu.blob'/> + <flag name='rbd-encryption-layering'/> + <flag name='rbd-encryption-luks-any'/> + <flag name='qcow2-discard-no-unref'/> + <flag name='run-with.async-teardown'/> + <flag name='virtio-blk-vhost-vdpa'/> + <flag name='virtio-blk.iothread-mapping'/> + <flag name='smp-clusters'/> + <flag name='virtio-mem-pci.dynamic-memslots'/> + <flag name='blockjob.backing-mask-protocol'/> + <flag name='display-reload'/> + <flag name='usb-mtp'/> + <flag name='virtio-sound'/> + <flag name='netdev.user'/> + <flag name='acpi-erst'/> + <flag name='intel-iommu.dma-translation'/> + <flag name='machine-i8042-opt'/> + <flag name='chardev-reconnect-miliseconds'/> + <flag name='netdev-stream-reconnect-miliseconds'/> + <flag name='query-cpu-model-expansion.deprecated-props'/> + <flag name='migrate-incoming.exit-on-error'/> + <flag name='blockdev-set-active'/> + <flag name='shim'/> + <flag name='virtio-scsi.iothread-mapping'/> + <flag name='bus-floppy'/> + <flag name='nvme'/> + <flag name='nvme-ns'/> + <flag name='amd-iommu'/> + <flag name='amd-iommu.pci-id'/> + <flag name='usb-bot'/> + <flag name='qom-list-get'/> + <flag name='acpi-generic-initiator'/> + <flag name='disk-timed-stats'/> + <flag name='query-accelerators'/> + <flag name='virtio-iommu.aw-bits'/> + <flag name='scsi-block.migrate-pr'/> + <flag name='iommufd'/> + <flag name='uefi-vars'/> + <flag name='query-block-flat'/> + <flag name='amd-iommu.xtsup'/> + <flag name='blockdev-mirror.target-is-zero'/> + </qemuCaps> + <devices> + <device alias='input0'/> + <device alias='pci.7'/> + <device alias='pci.13'/> + <device alias='pci.4'/> + <device alias='pci.1'/> + <device alias='pci.10'/> + <device alias='video0'/> + <device alias='serial0'/> + <device alias='balloon0'/> + <device alias='pci.9'/> + <device alias='pci.12'/> + <device alias='pci.6'/> + <device alias='usb'/> + <device alias='pci.3'/> + <device alias='pci.8'/> + <device alias='pci.14'/> + <device alias='pci.5'/> + <device alias='pci.11'/> + <device alias='pci.2'/> + <device alias='channel0'/> + <device alias='virtio-serial0'/> + <device alias='rng0'/> + </devices> + <libDir path='/var/lib/libvirt/qemu/domain-2-virtio-vga-test'/> + <channelTargetDir path='/run/libvirt/qemu/channel/2-virtio-vga-test'/> + <memoryBackingDir path='/var/lib/libvirt/qemu/ram/2-virtio-vga-test'/> + <cpu mode='host-passthrough' check='none' migratable='on'/> + <chardevStdioLogd/> + <rememberOwner/> + <nodename index='0'/> + <fdset index='0'/> + <blockjobs active='no'/> + <agentTimeout>-2</agentTimeout> + <domain type='kvm' id='2'> + <name>virtio-vga-test</name> + <uuid>9ccb5ed0-fda4-4760-a38c-83e5f9eba7cf</uuid> + <metadata> + <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0"> + <libosinfo:os id="http://fedoraproject.org/fedora/43"/> + </libosinfo:libosinfo> + </metadata> + <memory unit='KiB'>4194304</memory> + <currentMemory unit='KiB'>4194304</currentMemory> + <vcpu placement='static'>2</vcpu> + <resource> + <partition>/machine</partition> + </resource> + <os> + <type arch='x86_64' machine='pc-q35-11.0'>hvm</type> + <boot dev='hd'/> + </os> + <features> + <acpi/> + <apic/> + <vmport state='off'/> + </features> + <cpu mode='host-passthrough' check='none' migratable='on'/> + <clock offset='utc'> + <timer name='rtc' tickpolicy='catchup'/> + <timer name='pit' tickpolicy='delay'/> + <timer name='hpet' present='no'/> + </clock> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <pm> + <suspend-to-mem enabled='no'/> + <suspend-to-disk enabled='no'/> + </pm> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <controller type='usb' index='0' model='qemu-xhci' ports='15'> + <alias name='usb'/> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> + </controller> + <controller type='pci' index='0' model='pcie-root'> + <alias name='pcie.0'/> + </controller> + <controller type='pci' index='1' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='1' port='0x10'/> + <alias name='pci.1'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0' multifunction='on'/> + </controller> + <controller type='pci' index='2' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='2' port='0x11'/> + <alias name='pci.2'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x1'/> + </controller> + <controller type='pci' index='3' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='3' port='0x12'/> + <alias name='pci.3'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x2'/> + </controller> + <controller type='pci' index='4' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='4' port='0x13'/> + <alias name='pci.4'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x3'/> + </controller> + <controller type='pci' index='5' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='5' port='0x14'/> + <alias name='pci.5'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x4'/> + </controller> + <controller type='pci' index='6' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='6' port='0x15'/> + <alias name='pci.6'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x5'/> + </controller> + <controller type='pci' index='7' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='7' port='0x16'/> + <alias name='pci.7'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x6'/> + </controller> + <controller type='pci' index='8' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='8' port='0x17'/> + <alias name='pci.8'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x7'/> + </controller> + <controller type='pci' index='9' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='9' port='0x18'/> + <alias name='pci.9'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0' multifunction='on'/> + </controller> + <controller type='pci' index='10' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='10' port='0x19'/> + <alias name='pci.10'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x1'/> + </controller> + <controller type='pci' index='11' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='11' port='0x1a'/> + <alias name='pci.11'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x2'/> + </controller> + <controller type='pci' index='12' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='12' port='0x1b'/> + <alias name='pci.12'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x3'/> + </controller> + <controller type='pci' index='13' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='13' port='0x1c'/> + <alias name='pci.13'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x4'/> + </controller> + <controller type='pci' index='14' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='14' port='0x1d'/> + <alias name='pci.14'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x5'/> + </controller> + <controller type='sata' index='0'> + <alias name='ide'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> + </controller> + <controller type='virtio-serial' index='0'> + <alias name='virtio-serial0'/> + <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/> + </controller> + <serial type='pty'> + <source path='/dev/pts/3'/> + <target type='isa-serial' port='0'> + <model name='isa-serial'/> + </target> + <alias name='serial0'/> + </serial> + <console type='pty' tty='/dev/pts/3'> + <source path='/dev/pts/3'/> + <target type='serial' port='0'/> + <alias name='serial0'/> + </console> + <channel type='unix'> + <source mode='bind' path='/run/libvirt/qemu/channel/2-virtio-vga-test/org.qemu.guest_agent.0'/> + <target type='virtio' name='org.qemu.guest_agent.0' state='disconnected'/> + <alias name='channel0'/> + <address type='virtio-serial' controller='0' bus='0' port='1'/> + </channel> + <input type='tablet' bus='usb'> + <alias name='input0'/> + <address type='usb' bus='0' port='1'/> + </input> + <input type='mouse' bus='ps2'> + <alias name='input1'/> + </input> + <input type='keyboard' bus='ps2'> + <alias name='input2'/> + </input> + <graphics type='vnc' port='5901' autoport='yes' websocketGenerated='no' listen='127.0.0.1'> + <listen type='address' address='127.0.0.1' fromConfig='1' autoGenerated='no'/> + </graphics> + <audio id='1' type='none'/> + <video> + <model type='virtio' heads='1' primary='yes'/> + <alias name='video0'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + </video> + <watchdog model='itco' action='reset'> + <alias name='watchdog0'/> + </watchdog> + <memballoon model='virtio'> + <alias name='balloon0'/> + <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/> + </memballoon> + <rng model='virtio'> + <backend model='random'>/dev/urandom</backend> + <alias name='rng0'/> + <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/> + </rng> + </devices> + <seclabel type='dynamic' model='selinux' relabel='yes'> + <label>unconfined_u:unconfined_r:svirt_t:s0:c369,c928</label> + <imagelabel>unconfined_u:object_r:svirt_image_t:s0:c369,c928</imagelabel> + </seclabel> + <seclabel type='dynamic' model='dac' relabel='yes'> + <label>+107:+107</label> + <imagelabel>+107:+107</imagelabel> + </seclabel> + </domain> +</domstatus> diff --git a/tests/qemustatusxml2xmldata/virtio-vga-upgrade-missing-in.xml b/tests/qemustatusxml2xmldata/virtio-vga-upgrade-missing-in.xml new file mode 100644 index 0000000000..c9a7842258 --- /dev/null +++ b/tests/qemustatusxml2xmldata/virtio-vga-upgrade-missing-in.xml @@ -0,0 +1,464 @@ +<!-- +WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE +OVERWRITTEN AND LOST. Changes to this xml configuration should be made using: + virsh edit virtio-vga-test +or other application using the libvirt API. +--> + +<domstatus state='running' reason='booted' pid='1348839'> + <monitor path='/var/lib/libvirt/qemu/domain-2-virtio-vga-test/monitor.sock' type='unix'/> + <namespaces> + <mount/> + </namespaces> + <vcpus> + <vcpu id='0' pid='1348848'/> + <vcpu id='1' pid='1348850'/> + </vcpus> + <qemuCaps> + <flag name='kvm'/> + <flag name='sdl'/> + <flag name='spice'/> + <flag name='hda-duplex'/> + <flag name='ccid-emulated'/> + <flag name='ccid-passthru'/> + <flag name='piix3-usb-uhci'/> + <flag name='piix4-usb-uhci'/> + <flag name='usb-ehci'/> + <flag name='ich9-usb-ehci1'/> + <flag name='pci-ohci'/> + <flag name='usb-redir'/> + <flag name='usb-hub'/> + <flag name='ich9-ahci'/> + <flag name='scsi-disk.channel'/> + <flag name='scsi-block'/> + <flag name='hda-micro'/> + <flag name='nec-usb-xhci'/> + <flag name='lsi'/> + <flag name='virtio-scsi-pci'/> + <flag name='usb-redir.filter'/> + <flag name='seccomp-sandbox'/> + <flag name='vnc'/> + <flag name='qxl'/> + <flag name='VGA'/> + <flag name='cirrus-vga'/> + <flag name='vmware-svga'/> + <flag name='usb-serial'/> + <flag name='virtio-rng'/> + <flag name='rng-random'/> + <flag name='rng-egd'/> + <flag name='megasas'/> + <flag name='tpm-passthrough'/> + <flag name='tpm-tis'/> + <flag name='pci-bridge'/> + <flag name='vfio-pci'/> + <flag name='dmi-to-pci-bridge'/> + <flag name='usb-storage'/> + <flag name='virtio-mmio'/> + <flag name='ich9-intel-hda'/> + <flag name='kvm-pit-lost-tick-policy'/> + <flag name='pvpanic'/> + <flag name='usb-kbd'/> + <flag name='usb-audio'/> + <flag name='rtc-reset-reinjection'/> + <flag name='VGA.vgamem_mb'/> + <flag name='vmware-svga.vgamem_mb'/> + <flag name='qxl.vgamem_mb'/> + <flag name='pc-dimm'/> + <flag name='machine-vmport-opt'/> + <flag name='pci-serial'/> + <flag name='ioh3420'/> + <flag name='x3130-upstream'/> + <flag name='xio3130-downstream'/> + <flag name='rtl8139'/> + <flag name='e1000'/> + <flag name='virtio-net'/> + <flag name='virtio-gpu'/> + <flag name='virtio-keyboard'/> + <flag name='virtio-mouse'/> + <flag name='virtio-tablet'/> + <flag name='virtio-input-host'/> + <flag name='virtio-balloon-pci.deflate-on-oom'/> + <flag name='mptsas1068'/> + <flag name='spice-gl'/> + <flag name='qxl.vram64_size_mb'/> + <flag name='pxb'/> + <flag name='pxb-pcie'/> + <flag name='intel-iommu'/> + <flag name='ivshmem-plain'/> + <flag name='ivshmem-doorbell'/> + <flag name='vhost-scsi'/> + <flag name='query-cpu-model-expansion'/> + <flag name='spice-rendernode'/> + <flag name='nvdimm'/> + <flag name='pcie-root-port'/> + <flag name='query-cpu-definitions'/> + <flag name='qemu-xhci'/> + <flag name='intel-iommu.intremap'/> + <flag name='intel-iommu.caching-mode'/> + <flag name='intel-iommu.eim'/> + <flag name='intel-iommu.device-iotlb'/> + <flag name='vmcoreinfo'/> + <flag name='isa-serial'/> + <flag name='pcie-pci-bridge'/> + <flag name='nbd-tls'/> + <flag name='tpm-crb'/> + <flag name='pr-manager-helper'/> + <flag name='screendump_device'/> + <flag name='hda-output'/> + <flag name='vmgenid'/> + <flag name='vhost-vsock'/> + <flag name='tpm-emulator'/> + <flag name='mch'/> + <flag name='mch.extended-tseg-mbytes'/> + <flag name='egl-headless'/> + <flag name='memory-backend-memfd'/> + <flag name='memory-backend-memfd.hugetlb'/> + <flag name='egl-headless.rendernode'/> + <flag name='nvdimm.unarmed'/> + <flag name='virtio-pci-non-transitional'/> + <flag name='x86-max-cpu'/> + <flag name='cpu-unavailable-features'/> + <flag name='canonical-cpu-features'/> + <flag name='bochs-display'/> + <flag name='migration-file-drop-cache'/> + <flag name='dbus-vmstate'/> + <flag name='vhost-user-gpu'/> + <flag name='vhost-user-vga'/> + <flag name='query-cpu-model-baseline'/> + <flag name='query-cpu-model-comparison'/> + <flag name='ramfb'/> + <flag name='drive-nvme'/> + <flag name='smp-dies'/> + <flag name='i8042'/> + <flag name='rng-builtin'/> + <flag name='vhost-user-fs'/> + <flag name='fsdev.multidevs'/> + <flag name='pcie-root-port.hotplug'/> + <flag name='aio.io_uring'/> + <flag name='tcg'/> + <flag name='pvscsi'/> + <flag name='cpu.migratable'/> + <flag name='intel-iommu.aw-bits'/> + <flag name='numa.hmat'/> + <flag name='usb-host.hostdevice'/> + <flag name='virtio-balloon.free-page-reporting'/> + <flag name='netdev.vhost-vdpa'/> + <flag name='dc390'/> + <flag name='am53c974'/> + <flag name='virtio-pmem-pci'/> + <flag name='vhost-user-fs.bootindex'/> + <flag name='vhost-user-blk'/> + <flag name='cpu-max'/> + <flag name='memory-backend-file.x-use-canonical-path-for-ramblock-id'/> + <flag name='vnc-power-control'/> + <flag name='rotation-rate'/> + <flag name='acpi-index'/> + <flag name='input-linux'/> + <flag name='virtio-gpu-gl-pci'/> + <flag name='confidential-guest-support'/> + <flag name='set-action'/> + <flag name='virtio-blk.queue-size'/> + <flag name='virtio-mem-pci'/> + <flag name='memory-backend-file.reserve'/> + <flag name='piix4.acpi-root-pci-hotplug'/> + <flag name='netdev.json'/> + <flag name='query-dirty-rate'/> + <flag name='rbd-encryption'/> + <flag name='sev-guest-kernel-hashes'/> + <flag name='sev-inject-launch-secret'/> + <flag name='device.json+hotplug'/> + <flag name='virtio-mem-pci.prealloc'/> + <flag name='calc-dirty-rate'/> + <flag name='dirtyrate-param.mode'/> + <flag name='blockdev.nbd.tls-hostname'/> + <flag name='memory-backend-file.prealloc-threads'/> + <flag name='virtio-iommu-pci'/> + <flag name='virtio-iommu.boot-bypass'/> + <flag name='virtio-net.rss'/> + <flag name='chardev.qemu-vdagent'/> + <flag name='display-dbus'/> + <flag name='iothread.thread-pool-max'/> + <flag name='usb-host.guest-resets-all'/> + <flag name='migration.blocked-reasons'/> + <flag name='query-stats'/> + <flag name='query-stats-schemas'/> + <flag name='thread-context'/> + <flag name='screenshot-format-png'/> + <flag name='machine-hpet'/> + <flag name='netdev.stream'/> + <flag name='virtio-crypto'/> + <flag name='cryptodev-backend-lkcf'/> + <flag name='pvpanic-pci'/> + <flag name='virtio-gpu.blob'/> + <flag name='rbd-encryption-layering'/> + <flag name='rbd-encryption-luks-any'/> + <flag name='qcow2-discard-no-unref'/> + <flag name='run-with.async-teardown'/> + <flag name='virtio-blk-vhost-vdpa'/> + <flag name='virtio-blk.iothread-mapping'/> + <flag name='smp-clusters'/> + <flag name='virtio-mem-pci.dynamic-memslots'/> + <flag name='blockjob.backing-mask-protocol'/> + <flag name='display-reload'/> + <flag name='usb-mtp'/> + <flag name='virtio-sound'/> + <flag name='netdev.user'/> + <flag name='acpi-erst'/> + <flag name='intel-iommu.dma-translation'/> + <flag name='machine-i8042-opt'/> + <flag name='chardev-reconnect-miliseconds'/> + <flag name='netdev-stream-reconnect-miliseconds'/> + <flag name='query-cpu-model-expansion.deprecated-props'/> + <flag name='migrate-incoming.exit-on-error'/> + <flag name='blockdev-set-active'/> + <flag name='shim'/> + <flag name='virtio-scsi.iothread-mapping'/> + <flag name='bus-floppy'/> + <flag name='nvme'/> + <flag name='nvme-ns'/> + <flag name='amd-iommu'/> + <flag name='amd-iommu.pci-id'/> + <flag name='usb-bot'/> + <flag name='qom-list-get'/> + <flag name='acpi-generic-initiator'/> + <flag name='disk-timed-stats'/> + <flag name='query-accelerators'/> + <flag name='virtio-iommu.aw-bits'/> + <flag name='scsi-block.migrate-pr'/> + <flag name='iommufd'/> + <flag name='uefi-vars'/> + <flag name='query-block-flat'/> + <flag name='amd-iommu.xtsup'/> + <flag name='blockdev-mirror.target-is-zero'/> + </qemuCaps> + <devices> + <device alias='input0'/> + <device alias='pci.7'/> + <device alias='pci.13'/> + <device alias='pci.4'/> + <device alias='pci.1'/> + <device alias='pci.10'/> + <device alias='video0'/> + <device alias='serial0'/> + <device alias='balloon0'/> + <device alias='pci.9'/> + <device alias='pci.12'/> + <device alias='pci.6'/> + <device alias='usb'/> + <device alias='pci.3'/> + <device alias='pci.8'/> + <device alias='pci.14'/> + <device alias='pci.5'/> + <device alias='pci.11'/> + <device alias='pci.2'/> + <device alias='channel0'/> + <device alias='virtio-serial0'/> + <device alias='rng0'/> + </devices> + <libDir path='/var/lib/libvirt/qemu/domain-2-virtio-vga-test'/> + <channelTargetDir path='/run/libvirt/qemu/channel/2-virtio-vga-test'/> + <memoryBackingDir path='/var/lib/libvirt/qemu/ram/2-virtio-vga-test'/> + <cpu mode='host-passthrough' check='none' migratable='on'/> + <chardevStdioLogd/> + <rememberOwner/> + <nodename index='0'/> + <fdset index='0'/> + <blockjobs active='no'/> + <agentTimeout>-2</agentTimeout> + <domain type='kvm' id='2'> + <name>virtio-vga-test</name> + <uuid>9ccb5ed0-fda4-4760-a38c-83e5f9eba7cf</uuid> + <metadata> + <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0"> + <libosinfo:os id="http://fedoraproject.org/fedora/43"/> + </libosinfo:libosinfo> + </metadata> + <memory unit='KiB'>4194304</memory> + <currentMemory unit='KiB'>4194304</currentMemory> + <vcpu placement='static'>2</vcpu> + <resource> + <partition>/machine</partition> + </resource> + <os> + <type arch='x86_64' machine='pc-q35-11.0'>hvm</type> + <boot dev='hd'/> + </os> + <features> + <acpi/> + <apic/> + <vmport state='off'/> + </features> + <cpu mode='host-passthrough' check='none' migratable='on'/> + <clock offset='utc'> + <timer name='rtc' tickpolicy='catchup'/> + <timer name='pit' tickpolicy='delay'/> + <timer name='hpet' present='no'/> + </clock> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <pm> + <suspend-to-mem enabled='no'/> + <suspend-to-disk enabled='no'/> + </pm> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <controller type='usb' index='0' model='qemu-xhci' ports='15'> + <alias name='usb'/> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> + </controller> + <controller type='pci' index='0' model='pcie-root'> + <alias name='pcie.0'/> + </controller> + <controller type='pci' index='1' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='1' port='0x10'/> + <alias name='pci.1'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0' multifunction='on'/> + </controller> + <controller type='pci' index='2' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='2' port='0x11'/> + <alias name='pci.2'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x1'/> + </controller> + <controller type='pci' index='3' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='3' port='0x12'/> + <alias name='pci.3'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x2'/> + </controller> + <controller type='pci' index='4' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='4' port='0x13'/> + <alias name='pci.4'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x3'/> + </controller> + <controller type='pci' index='5' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='5' port='0x14'/> + <alias name='pci.5'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x4'/> + </controller> + <controller type='pci' index='6' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='6' port='0x15'/> + <alias name='pci.6'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x5'/> + </controller> + <controller type='pci' index='7' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='7' port='0x16'/> + <alias name='pci.7'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x6'/> + </controller> + <controller type='pci' index='8' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='8' port='0x17'/> + <alias name='pci.8'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x7'/> + </controller> + <controller type='pci' index='9' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='9' port='0x18'/> + <alias name='pci.9'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0' multifunction='on'/> + </controller> + <controller type='pci' index='10' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='10' port='0x19'/> + <alias name='pci.10'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x1'/> + </controller> + <controller type='pci' index='11' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='11' port='0x1a'/> + <alias name='pci.11'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x2'/> + </controller> + <controller type='pci' index='12' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='12' port='0x1b'/> + <alias name='pci.12'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x3'/> + </controller> + <controller type='pci' index='13' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='13' port='0x1c'/> + <alias name='pci.13'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x4'/> + </controller> + <controller type='pci' index='14' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='14' port='0x1d'/> + <alias name='pci.14'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x5'/> + </controller> + <controller type='sata' index='0'> + <alias name='ide'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> + </controller> + <controller type='virtio-serial' index='0'> + <alias name='virtio-serial0'/> + <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/> + </controller> + <serial type='pty'> + <source path='/dev/pts/3'/> + <target type='isa-serial' port='0'> + <model name='isa-serial'/> + </target> + <alias name='serial0'/> + </serial> + <console type='pty' tty='/dev/pts/3'> + <source path='/dev/pts/3'/> + <target type='serial' port='0'/> + <alias name='serial0'/> + </console> + <channel type='unix'> + <source mode='bind' path='/run/libvirt/qemu/channel/2-virtio-vga-test/org.qemu.guest_agent.0'/> + <target type='virtio' name='org.qemu.guest_agent.0' state='disconnected'/> + <alias name='channel0'/> + <address type='virtio-serial' controller='0' bus='0' port='1'/> + </channel> + <input type='tablet' bus='usb'> + <alias name='input0'/> + <address type='usb' bus='0' port='1'/> + </input> + <input type='mouse' bus='ps2'> + <alias name='input1'/> + </input> + <input type='keyboard' bus='ps2'> + <alias name='input2'/> + </input> + <graphics type='vnc' port='5901' autoport='yes' websocketGenerated='no' listen='127.0.0.1'> + <listen type='address' address='127.0.0.1' fromConfig='1' autoGenerated='no'/> + </graphics> + <audio id='1' type='none'/> + <video> + <model type='virtio' heads='1' primary='yes'/> + <alias name='video0'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + </video> + <watchdog model='itco' action='reset'> + <alias name='watchdog0'/> + </watchdog> + <memballoon model='virtio'> + <alias name='balloon0'/> + <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/> + </memballoon> + <rng model='virtio'> + <backend model='random'>/dev/urandom</backend> + <alias name='rng0'/> + <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/> + </rng> + </devices> + <seclabel type='dynamic' model='selinux' relabel='yes'> + <label>unconfined_u:unconfined_r:svirt_t:s0:c369,c928</label> + <imagelabel>unconfined_u:object_r:svirt_image_t:s0:c369,c928</imagelabel> + </seclabel> + <seclabel type='dynamic' model='dac' relabel='yes'> + <label>+107:+107</label> + <imagelabel>+107:+107</imagelabel> + </seclabel> + </domain> +</domstatus> diff --git a/tests/qemustatusxml2xmldata/virtio-vga-upgrade-missing-out.xml b/tests/qemustatusxml2xmldata/virtio-vga-upgrade-missing-out.xml new file mode 100644 index 0000000000..a2b11ede2a --- /dev/null +++ b/tests/qemustatusxml2xmldata/virtio-vga-upgrade-missing-out.xml @@ -0,0 +1,457 @@ +<domstatus state='running' reason='booted' pid='1348839'> + <monitor path='/var/lib/libvirt/qemu/domain-2-virtio-vga-test/monitor.sock' type='unix'/> + <namespaces> + <mount/> + </namespaces> + <vcpus> + <vcpu id='0' pid='1348848'/> + <vcpu id='1' pid='1348850'/> + </vcpus> + <qemuCaps> + <flag name='kvm'/> + <flag name='sdl'/> + <flag name='spice'/> + <flag name='hda-duplex'/> + <flag name='ccid-emulated'/> + <flag name='ccid-passthru'/> + <flag name='piix3-usb-uhci'/> + <flag name='piix4-usb-uhci'/> + <flag name='usb-ehci'/> + <flag name='ich9-usb-ehci1'/> + <flag name='pci-ohci'/> + <flag name='usb-redir'/> + <flag name='usb-hub'/> + <flag name='ich9-ahci'/> + <flag name='scsi-disk.channel'/> + <flag name='scsi-block'/> + <flag name='hda-micro'/> + <flag name='nec-usb-xhci'/> + <flag name='lsi'/> + <flag name='virtio-scsi-pci'/> + <flag name='usb-redir.filter'/> + <flag name='seccomp-sandbox'/> + <flag name='vnc'/> + <flag name='qxl'/> + <flag name='VGA'/> + <flag name='cirrus-vga'/> + <flag name='vmware-svga'/> + <flag name='usb-serial'/> + <flag name='virtio-rng'/> + <flag name='rng-random'/> + <flag name='rng-egd'/> + <flag name='megasas'/> + <flag name='tpm-passthrough'/> + <flag name='tpm-tis'/> + <flag name='pci-bridge'/> + <flag name='vfio-pci'/> + <flag name='dmi-to-pci-bridge'/> + <flag name='usb-storage'/> + <flag name='virtio-mmio'/> + <flag name='ich9-intel-hda'/> + <flag name='kvm-pit-lost-tick-policy'/> + <flag name='pvpanic'/> + <flag name='usb-kbd'/> + <flag name='usb-audio'/> + <flag name='rtc-reset-reinjection'/> + <flag name='VGA.vgamem_mb'/> + <flag name='vmware-svga.vgamem_mb'/> + <flag name='qxl.vgamem_mb'/> + <flag name='pc-dimm'/> + <flag name='machine-vmport-opt'/> + <flag name='pci-serial'/> + <flag name='ioh3420'/> + <flag name='x3130-upstream'/> + <flag name='xio3130-downstream'/> + <flag name='rtl8139'/> + <flag name='e1000'/> + <flag name='virtio-net'/> + <flag name='virtio-gpu'/> + <flag name='virtio-keyboard'/> + <flag name='virtio-mouse'/> + <flag name='virtio-tablet'/> + <flag name='virtio-input-host'/> + <flag name='virtio-balloon-pci.deflate-on-oom'/> + <flag name='mptsas1068'/> + <flag name='spice-gl'/> + <flag name='qxl.vram64_size_mb'/> + <flag name='pxb'/> + <flag name='pxb-pcie'/> + <flag name='intel-iommu'/> + <flag name='ivshmem-plain'/> + <flag name='ivshmem-doorbell'/> + <flag name='vhost-scsi'/> + <flag name='query-cpu-model-expansion'/> + <flag name='spice-rendernode'/> + <flag name='nvdimm'/> + <flag name='pcie-root-port'/> + <flag name='query-cpu-definitions'/> + <flag name='qemu-xhci'/> + <flag name='intel-iommu.intremap'/> + <flag name='intel-iommu.caching-mode'/> + <flag name='intel-iommu.eim'/> + <flag name='intel-iommu.device-iotlb'/> + <flag name='vmcoreinfo'/> + <flag name='isa-serial'/> + <flag name='pcie-pci-bridge'/> + <flag name='nbd-tls'/> + <flag name='tpm-crb'/> + <flag name='pr-manager-helper'/> + <flag name='screendump_device'/> + <flag name='hda-output'/> + <flag name='vmgenid'/> + <flag name='vhost-vsock'/> + <flag name='tpm-emulator'/> + <flag name='mch'/> + <flag name='mch.extended-tseg-mbytes'/> + <flag name='egl-headless'/> + <flag name='memory-backend-memfd'/> + <flag name='memory-backend-memfd.hugetlb'/> + <flag name='egl-headless.rendernode'/> + <flag name='nvdimm.unarmed'/> + <flag name='virtio-pci-non-transitional'/> + <flag name='x86-max-cpu'/> + <flag name='cpu-unavailable-features'/> + <flag name='canonical-cpu-features'/> + <flag name='bochs-display'/> + <flag name='migration-file-drop-cache'/> + <flag name='dbus-vmstate'/> + <flag name='vhost-user-gpu'/> + <flag name='vhost-user-vga'/> + <flag name='query-cpu-model-baseline'/> + <flag name='query-cpu-model-comparison'/> + <flag name='ramfb'/> + <flag name='drive-nvme'/> + <flag name='smp-dies'/> + <flag name='i8042'/> + <flag name='rng-builtin'/> + <flag name='vhost-user-fs'/> + <flag name='fsdev.multidevs'/> + <flag name='pcie-root-port.hotplug'/> + <flag name='aio.io_uring'/> + <flag name='tcg'/> + <flag name='pvscsi'/> + <flag name='cpu.migratable'/> + <flag name='intel-iommu.aw-bits'/> + <flag name='numa.hmat'/> + <flag name='usb-host.hostdevice'/> + <flag name='virtio-balloon.free-page-reporting'/> + <flag name='netdev.vhost-vdpa'/> + <flag name='dc390'/> + <flag name='am53c974'/> + <flag name='virtio-pmem-pci'/> + <flag name='vhost-user-fs.bootindex'/> + <flag name='vhost-user-blk'/> + <flag name='cpu-max'/> + <flag name='memory-backend-file.x-use-canonical-path-for-ramblock-id'/> + <flag name='vnc-power-control'/> + <flag name='rotation-rate'/> + <flag name='acpi-index'/> + <flag name='input-linux'/> + <flag name='virtio-gpu-gl-pci'/> + <flag name='confidential-guest-support'/> + <flag name='set-action'/> + <flag name='virtio-blk.queue-size'/> + <flag name='virtio-mem-pci'/> + <flag name='memory-backend-file.reserve'/> + <flag name='piix4.acpi-root-pci-hotplug'/> + <flag name='netdev.json'/> + <flag name='query-dirty-rate'/> + <flag name='rbd-encryption'/> + <flag name='sev-guest-kernel-hashes'/> + <flag name='sev-inject-launch-secret'/> + <flag name='device.json+hotplug'/> + <flag name='virtio-mem-pci.prealloc'/> + <flag name='calc-dirty-rate'/> + <flag name='dirtyrate-param.mode'/> + <flag name='blockdev.nbd.tls-hostname'/> + <flag name='memory-backend-file.prealloc-threads'/> + <flag name='virtio-iommu-pci'/> + <flag name='virtio-iommu.boot-bypass'/> + <flag name='virtio-net.rss'/> + <flag name='chardev.qemu-vdagent'/> + <flag name='display-dbus'/> + <flag name='iothread.thread-pool-max'/> + <flag name='usb-host.guest-resets-all'/> + <flag name='migration.blocked-reasons'/> + <flag name='query-stats'/> + <flag name='query-stats-schemas'/> + <flag name='thread-context'/> + <flag name='screenshot-format-png'/> + <flag name='machine-hpet'/> + <flag name='netdev.stream'/> + <flag name='virtio-crypto'/> + <flag name='cryptodev-backend-lkcf'/> + <flag name='pvpanic-pci'/> + <flag name='virtio-gpu.blob'/> + <flag name='rbd-encryption-layering'/> + <flag name='rbd-encryption-luks-any'/> + <flag name='qcow2-discard-no-unref'/> + <flag name='run-with.async-teardown'/> + <flag name='virtio-blk-vhost-vdpa'/> + <flag name='virtio-blk.iothread-mapping'/> + <flag name='smp-clusters'/> + <flag name='virtio-mem-pci.dynamic-memslots'/> + <flag name='blockjob.backing-mask-protocol'/> + <flag name='display-reload'/> + <flag name='usb-mtp'/> + <flag name='virtio-sound'/> + <flag name='netdev.user'/> + <flag name='acpi-erst'/> + <flag name='intel-iommu.dma-translation'/> + <flag name='machine-i8042-opt'/> + <flag name='chardev-reconnect-miliseconds'/> + <flag name='netdev-stream-reconnect-miliseconds'/> + <flag name='query-cpu-model-expansion.deprecated-props'/> + <flag name='migrate-incoming.exit-on-error'/> + <flag name='blockdev-set-active'/> + <flag name='shim'/> + <flag name='virtio-scsi.iothread-mapping'/> + <flag name='bus-floppy'/> + <flag name='nvme'/> + <flag name='nvme-ns'/> + <flag name='amd-iommu'/> + <flag name='amd-iommu.pci-id'/> + <flag name='usb-bot'/> + <flag name='qom-list-get'/> + <flag name='acpi-generic-initiator'/> + <flag name='disk-timed-stats'/> + <flag name='query-accelerators'/> + <flag name='virtio-iommu.aw-bits'/> + <flag name='scsi-block.migrate-pr'/> + <flag name='iommufd'/> + <flag name='uefi-vars'/> + <flag name='query-block-flat'/> + <flag name='amd-iommu.xtsup'/> + <flag name='blockdev-mirror.target-is-zero'/> + </qemuCaps> + <devices> + <device alias='input0'/> + <device alias='pci.7'/> + <device alias='pci.13'/> + <device alias='pci.4'/> + <device alias='pci.1'/> + <device alias='pci.10'/> + <device alias='video0'/> + <device alias='serial0'/> + <device alias='balloon0'/> + <device alias='pci.9'/> + <device alias='pci.12'/> + <device alias='pci.6'/> + <device alias='usb'/> + <device alias='pci.3'/> + <device alias='pci.8'/> + <device alias='pci.14'/> + <device alias='pci.5'/> + <device alias='pci.11'/> + <device alias='pci.2'/> + <device alias='channel0'/> + <device alias='virtio-serial0'/> + <device alias='rng0'/> + </devices> + <libDir path='/var/lib/libvirt/qemu/domain-2-virtio-vga-test'/> + <channelTargetDir path='/run/libvirt/qemu/channel/2-virtio-vga-test'/> + <memoryBackingDir path='/var/lib/libvirt/qemu/ram/2-virtio-vga-test'/> + <cpu mode='host-passthrough' check='none' migratable='on'/> + <chardevStdioLogd/> + <rememberOwner/> + <nodename index='0'/> + <fdset index='0'/> + <blockjobs active='no'/> + <agentTimeout>-2</agentTimeout> + <domain type='kvm' id='2'> + <name>virtio-vga-test</name> + <uuid>9ccb5ed0-fda4-4760-a38c-83e5f9eba7cf</uuid> + <metadata> + <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0"> + <libosinfo:os id="http://fedoraproject.org/fedora/43"/> + </libosinfo:libosinfo> + </metadata> + <memory unit='KiB'>4194304</memory> + <currentMemory unit='KiB'>4194304</currentMemory> + <vcpu placement='static'>2</vcpu> + <resource> + <partition>/machine</partition> + </resource> + <os> + <type arch='x86_64' machine='pc-q35-11.0'>hvm</type> + <boot dev='hd'/> + </os> + <features> + <acpi/> + <apic/> + <vmport state='off'/> + </features> + <cpu mode='host-passthrough' check='none' migratable='on'/> + <clock offset='utc'> + <timer name='rtc' tickpolicy='catchup'/> + <timer name='pit' tickpolicy='delay'/> + <timer name='hpet' present='no'/> + </clock> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <pm> + <suspend-to-mem enabled='no'/> + <suspend-to-disk enabled='no'/> + </pm> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <controller type='usb' index='0' model='qemu-xhci' ports='15'> + <alias name='usb'/> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> + </controller> + <controller type='pci' index='0' model='pcie-root'> + <alias name='pcie.0'/> + </controller> + <controller type='pci' index='1' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='1' port='0x10'/> + <alias name='pci.1'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0' multifunction='on'/> + </controller> + <controller type='pci' index='2' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='2' port='0x11'/> + <alias name='pci.2'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x1'/> + </controller> + <controller type='pci' index='3' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='3' port='0x12'/> + <alias name='pci.3'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x2'/> + </controller> + <controller type='pci' index='4' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='4' port='0x13'/> + <alias name='pci.4'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x3'/> + </controller> + <controller type='pci' index='5' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='5' port='0x14'/> + <alias name='pci.5'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x4'/> + </controller> + <controller type='pci' index='6' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='6' port='0x15'/> + <alias name='pci.6'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x5'/> + </controller> + <controller type='pci' index='7' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='7' port='0x16'/> + <alias name='pci.7'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x6'/> + </controller> + <controller type='pci' index='8' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='8' port='0x17'/> + <alias name='pci.8'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x7'/> + </controller> + <controller type='pci' index='9' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='9' port='0x18'/> + <alias name='pci.9'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0' multifunction='on'/> + </controller> + <controller type='pci' index='10' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='10' port='0x19'/> + <alias name='pci.10'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x1'/> + </controller> + <controller type='pci' index='11' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='11' port='0x1a'/> + <alias name='pci.11'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x2'/> + </controller> + <controller type='pci' index='12' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='12' port='0x1b'/> + <alias name='pci.12'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x3'/> + </controller> + <controller type='pci' index='13' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='13' port='0x1c'/> + <alias name='pci.13'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x4'/> + </controller> + <controller type='pci' index='14' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='14' port='0x1d'/> + <alias name='pci.14'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x5'/> + </controller> + <controller type='sata' index='0'> + <alias name='ide'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> + </controller> + <controller type='virtio-serial' index='0'> + <alias name='virtio-serial0'/> + <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/> + </controller> + <serial type='pty'> + <source path='/dev/pts/3'/> + <target type='isa-serial' port='0'> + <model name='isa-serial'/> + </target> + <alias name='serial0'/> + </serial> + <console type='pty' tty='/dev/pts/3'> + <source path='/dev/pts/3'/> + <target type='serial' port='0'/> + <alias name='serial0'/> + </console> + <channel type='unix'> + <source mode='bind' path='/run/libvirt/qemu/channel/2-virtio-vga-test/org.qemu.guest_agent.0'/> + <target type='virtio' name='org.qemu.guest_agent.0' state='disconnected'/> + <alias name='channel0'/> + <address type='virtio-serial' controller='0' bus='0' port='1'/> + </channel> + <input type='tablet' bus='usb'> + <alias name='input0'/> + <address type='usb' bus='0' port='1'/> + </input> + <input type='mouse' bus='ps2'> + <alias name='input1'/> + </input> + <input type='keyboard' bus='ps2'> + <alias name='input2'/> + </input> + <graphics type='vnc' port='5901' autoport='yes' websocketGenerated='no' listen='127.0.0.1'> + <listen type='address' address='127.0.0.1' fromConfig='1' autoGenerated='no'/> + </graphics> + <audio id='1' type='none'/> + <video> + <model type='virtio' heads='1' primary='yes'/> + <alias name='video0'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + </video> + <watchdog model='itco' action='reset'> + <alias name='watchdog0'/> + </watchdog> + <memballoon model='virtio'> + <alias name='balloon0'/> + <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/> + </memballoon> + <rng model='virtio'> + <backend model='random'>/dev/urandom</backend> + <alias name='rng0'/> + <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/> + </rng> + </devices> + <seclabel type='dynamic' model='selinux' relabel='yes'> + <label>unconfined_u:unconfined_r:svirt_t:s0:c369,c928</label> + <imagelabel>unconfined_u:object_r:svirt_image_t:s0:c369,c928</imagelabel> + </seclabel> + <seclabel type='dynamic' model='dac' relabel='yes'> + <label>+107:+107</label> + <imagelabel>+107:+107</imagelabel> + </seclabel> + </domain> +</domstatus> diff --git a/tests/qemustatusxml2xmldata/virtio-vga-upgrade-out.xml b/tests/qemustatusxml2xmldata/virtio-vga-upgrade-out.xml new file mode 100644 index 0000000000..7f59c46a5c --- /dev/null +++ b/tests/qemustatusxml2xmldata/virtio-vga-upgrade-out.xml @@ -0,0 +1,459 @@ +<domstatus state='running' reason='booted' pid='1348839'> + <monitor path='/var/lib/libvirt/qemu/domain-2-virtio-vga-test/monitor.sock' type='unix'/> + <namespaces> + <mount/> + </namespaces> + <vcpus> + <vcpu id='0' pid='1348848'/> + <vcpu id='1' pid='1348850'/> + </vcpus> + <qemuCaps> + <flag name='kvm'/> + <flag name='sdl'/> + <flag name='spice'/> + <flag name='hda-duplex'/> + <flag name='ccid-emulated'/> + <flag name='ccid-passthru'/> + <flag name='piix3-usb-uhci'/> + <flag name='piix4-usb-uhci'/> + <flag name='usb-ehci'/> + <flag name='ich9-usb-ehci1'/> + <flag name='pci-ohci'/> + <flag name='usb-redir'/> + <flag name='usb-hub'/> + <flag name='ich9-ahci'/> + <flag name='scsi-disk.channel'/> + <flag name='scsi-block'/> + <flag name='hda-micro'/> + <flag name='nec-usb-xhci'/> + <flag name='lsi'/> + <flag name='virtio-scsi-pci'/> + <flag name='usb-redir.filter'/> + <flag name='seccomp-sandbox'/> + <flag name='vnc'/> + <flag name='qxl'/> + <flag name='VGA'/> + <flag name='cirrus-vga'/> + <flag name='vmware-svga'/> + <flag name='usb-serial'/> + <flag name='virtio-rng'/> + <flag name='rng-random'/> + <flag name='rng-egd'/> + <flag name='megasas'/> + <flag name='tpm-passthrough'/> + <flag name='tpm-tis'/> + <flag name='pci-bridge'/> + <flag name='vfio-pci'/> + <flag name='dmi-to-pci-bridge'/> + <flag name='usb-storage'/> + <flag name='virtio-mmio'/> + <flag name='ich9-intel-hda'/> + <flag name='kvm-pit-lost-tick-policy'/> + <flag name='pvpanic'/> + <flag name='usb-kbd'/> + <flag name='usb-audio'/> + <flag name='rtc-reset-reinjection'/> + <flag name='VGA.vgamem_mb'/> + <flag name='vmware-svga.vgamem_mb'/> + <flag name='qxl.vgamem_mb'/> + <flag name='pc-dimm'/> + <flag name='machine-vmport-opt'/> + <flag name='pci-serial'/> + <flag name='ioh3420'/> + <flag name='x3130-upstream'/> + <flag name='xio3130-downstream'/> + <flag name='rtl8139'/> + <flag name='e1000'/> + <flag name='virtio-net'/> + <flag name='virtio-gpu'/> + <flag name='virtio-keyboard'/> + <flag name='virtio-mouse'/> + <flag name='virtio-tablet'/> + <flag name='virtio-input-host'/> + <flag name='virtio-balloon-pci.deflate-on-oom'/> + <flag name='mptsas1068'/> + <flag name='spice-gl'/> + <flag name='qxl.vram64_size_mb'/> + <flag name='pxb'/> + <flag name='pxb-pcie'/> + <flag name='intel-iommu'/> + <flag name='virtio-vga'/> + <flag name='ivshmem-plain'/> + <flag name='ivshmem-doorbell'/> + <flag name='vhost-scsi'/> + <flag name='query-cpu-model-expansion'/> + <flag name='spice-rendernode'/> + <flag name='nvdimm'/> + <flag name='pcie-root-port'/> + <flag name='query-cpu-definitions'/> + <flag name='qemu-xhci'/> + <flag name='intel-iommu.intremap'/> + <flag name='intel-iommu.caching-mode'/> + <flag name='intel-iommu.eim'/> + <flag name='intel-iommu.device-iotlb'/> + <flag name='vmcoreinfo'/> + <flag name='isa-serial'/> + <flag name='pcie-pci-bridge'/> + <flag name='nbd-tls'/> + <flag name='tpm-crb'/> + <flag name='pr-manager-helper'/> + <flag name='screendump_device'/> + <flag name='hda-output'/> + <flag name='vmgenid'/> + <flag name='vhost-vsock'/> + <flag name='tpm-emulator'/> + <flag name='mch'/> + <flag name='mch.extended-tseg-mbytes'/> + <flag name='egl-headless'/> + <flag name='memory-backend-memfd'/> + <flag name='memory-backend-memfd.hugetlb'/> + <flag name='egl-headless.rendernode'/> + <flag name='nvdimm.unarmed'/> + <flag name='virtio-pci-non-transitional'/> + <flag name='x86-max-cpu'/> + <flag name='cpu-unavailable-features'/> + <flag name='canonical-cpu-features'/> + <flag name='bochs-display'/> + <flag name='migration-file-drop-cache'/> + <flag name='dbus-vmstate'/> + <flag name='vhost-user-gpu'/> + <flag name='vhost-user-vga'/> + <flag name='query-cpu-model-baseline'/> + <flag name='query-cpu-model-comparison'/> + <flag name='ramfb'/> + <flag name='drive-nvme'/> + <flag name='smp-dies'/> + <flag name='i8042'/> + <flag name='rng-builtin'/> + <flag name='vhost-user-fs'/> + <flag name='fsdev.multidevs'/> + <flag name='pcie-root-port.hotplug'/> + <flag name='aio.io_uring'/> + <flag name='tcg'/> + <flag name='pvscsi'/> + <flag name='cpu.migratable'/> + <flag name='intel-iommu.aw-bits'/> + <flag name='numa.hmat'/> + <flag name='usb-host.hostdevice'/> + <flag name='virtio-balloon.free-page-reporting'/> + <flag name='netdev.vhost-vdpa'/> + <flag name='dc390'/> + <flag name='am53c974'/> + <flag name='virtio-pmem-pci'/> + <flag name='vhost-user-fs.bootindex'/> + <flag name='vhost-user-blk'/> + <flag name='cpu-max'/> + <flag name='memory-backend-file.x-use-canonical-path-for-ramblock-id'/> + <flag name='vnc-power-control'/> + <flag name='rotation-rate'/> + <flag name='acpi-index'/> + <flag name='input-linux'/> + <flag name='virtio-gpu-gl-pci'/> + <flag name='virtio-vga-gl'/> + <flag name='confidential-guest-support'/> + <flag name='set-action'/> + <flag name='virtio-blk.queue-size'/> + <flag name='virtio-mem-pci'/> + <flag name='memory-backend-file.reserve'/> + <flag name='piix4.acpi-root-pci-hotplug'/> + <flag name='netdev.json'/> + <flag name='query-dirty-rate'/> + <flag name='rbd-encryption'/> + <flag name='sev-guest-kernel-hashes'/> + <flag name='sev-inject-launch-secret'/> + <flag name='device.json+hotplug'/> + <flag name='virtio-mem-pci.prealloc'/> + <flag name='calc-dirty-rate'/> + <flag name='dirtyrate-param.mode'/> + <flag name='blockdev.nbd.tls-hostname'/> + <flag name='memory-backend-file.prealloc-threads'/> + <flag name='virtio-iommu-pci'/> + <flag name='virtio-iommu.boot-bypass'/> + <flag name='virtio-net.rss'/> + <flag name='chardev.qemu-vdagent'/> + <flag name='display-dbus'/> + <flag name='iothread.thread-pool-max'/> + <flag name='usb-host.guest-resets-all'/> + <flag name='migration.blocked-reasons'/> + <flag name='query-stats'/> + <flag name='query-stats-schemas'/> + <flag name='thread-context'/> + <flag name='screenshot-format-png'/> + <flag name='machine-hpet'/> + <flag name='netdev.stream'/> + <flag name='virtio-crypto'/> + <flag name='cryptodev-backend-lkcf'/> + <flag name='pvpanic-pci'/> + <flag name='virtio-gpu.blob'/> + <flag name='rbd-encryption-layering'/> + <flag name='rbd-encryption-luks-any'/> + <flag name='qcow2-discard-no-unref'/> + <flag name='run-with.async-teardown'/> + <flag name='virtio-blk-vhost-vdpa'/> + <flag name='virtio-blk.iothread-mapping'/> + <flag name='smp-clusters'/> + <flag name='virtio-mem-pci.dynamic-memslots'/> + <flag name='blockjob.backing-mask-protocol'/> + <flag name='display-reload'/> + <flag name='usb-mtp'/> + <flag name='virtio-sound'/> + <flag name='netdev.user'/> + <flag name='acpi-erst'/> + <flag name='intel-iommu.dma-translation'/> + <flag name='machine-i8042-opt'/> + <flag name='chardev-reconnect-miliseconds'/> + <flag name='netdev-stream-reconnect-miliseconds'/> + <flag name='query-cpu-model-expansion.deprecated-props'/> + <flag name='migrate-incoming.exit-on-error'/> + <flag name='blockdev-set-active'/> + <flag name='shim'/> + <flag name='virtio-scsi.iothread-mapping'/> + <flag name='bus-floppy'/> + <flag name='nvme'/> + <flag name='nvme-ns'/> + <flag name='amd-iommu'/> + <flag name='amd-iommu.pci-id'/> + <flag name='usb-bot'/> + <flag name='qom-list-get'/> + <flag name='acpi-generic-initiator'/> + <flag name='disk-timed-stats'/> + <flag name='query-accelerators'/> + <flag name='virtio-iommu.aw-bits'/> + <flag name='scsi-block.migrate-pr'/> + <flag name='iommufd'/> + <flag name='uefi-vars'/> + <flag name='query-block-flat'/> + <flag name='amd-iommu.xtsup'/> + <flag name='blockdev-mirror.target-is-zero'/> + </qemuCaps> + <devices> + <device alias='input0'/> + <device alias='pci.7'/> + <device alias='pci.13'/> + <device alias='pci.4'/> + <device alias='pci.1'/> + <device alias='pci.10'/> + <device alias='video0'/> + <device alias='serial0'/> + <device alias='balloon0'/> + <device alias='pci.9'/> + <device alias='pci.12'/> + <device alias='pci.6'/> + <device alias='usb'/> + <device alias='pci.3'/> + <device alias='pci.8'/> + <device alias='pci.14'/> + <device alias='pci.5'/> + <device alias='pci.11'/> + <device alias='pci.2'/> + <device alias='channel0'/> + <device alias='virtio-serial0'/> + <device alias='rng0'/> + </devices> + <libDir path='/var/lib/libvirt/qemu/domain-2-virtio-vga-test'/> + <channelTargetDir path='/run/libvirt/qemu/channel/2-virtio-vga-test'/> + <memoryBackingDir path='/var/lib/libvirt/qemu/ram/2-virtio-vga-test'/> + <cpu mode='host-passthrough' check='none' migratable='on'/> + <chardevStdioLogd/> + <rememberOwner/> + <nodename index='0'/> + <fdset index='0'/> + <blockjobs active='no'/> + <agentTimeout>-2</agentTimeout> + <domain type='kvm' id='2'> + <name>virtio-vga-test</name> + <uuid>9ccb5ed0-fda4-4760-a38c-83e5f9eba7cf</uuid> + <metadata> + <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0"> + <libosinfo:os id="http://fedoraproject.org/fedora/43"/> + </libosinfo:libosinfo> + </metadata> + <memory unit='KiB'>4194304</memory> + <currentMemory unit='KiB'>4194304</currentMemory> + <vcpu placement='static'>2</vcpu> + <resource> + <partition>/machine</partition> + </resource> + <os> + <type arch='x86_64' machine='pc-q35-11.0'>hvm</type> + <boot dev='hd'/> + </os> + <features> + <acpi/> + <apic/> + <vmport state='off'/> + </features> + <cpu mode='host-passthrough' check='none' migratable='on'/> + <clock offset='utc'> + <timer name='rtc' tickpolicy='catchup'/> + <timer name='pit' tickpolicy='delay'/> + <timer name='hpet' present='no'/> + </clock> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <pm> + <suspend-to-mem enabled='no'/> + <suspend-to-disk enabled='no'/> + </pm> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <controller type='usb' index='0' model='qemu-xhci' ports='15'> + <alias name='usb'/> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> + </controller> + <controller type='pci' index='0' model='pcie-root'> + <alias name='pcie.0'/> + </controller> + <controller type='pci' index='1' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='1' port='0x10'/> + <alias name='pci.1'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0' multifunction='on'/> + </controller> + <controller type='pci' index='2' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='2' port='0x11'/> + <alias name='pci.2'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x1'/> + </controller> + <controller type='pci' index='3' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='3' port='0x12'/> + <alias name='pci.3'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x2'/> + </controller> + <controller type='pci' index='4' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='4' port='0x13'/> + <alias name='pci.4'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x3'/> + </controller> + <controller type='pci' index='5' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='5' port='0x14'/> + <alias name='pci.5'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x4'/> + </controller> + <controller type='pci' index='6' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='6' port='0x15'/> + <alias name='pci.6'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x5'/> + </controller> + <controller type='pci' index='7' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='7' port='0x16'/> + <alias name='pci.7'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x6'/> + </controller> + <controller type='pci' index='8' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='8' port='0x17'/> + <alias name='pci.8'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x7'/> + </controller> + <controller type='pci' index='9' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='9' port='0x18'/> + <alias name='pci.9'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0' multifunction='on'/> + </controller> + <controller type='pci' index='10' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='10' port='0x19'/> + <alias name='pci.10'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x1'/> + </controller> + <controller type='pci' index='11' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='11' port='0x1a'/> + <alias name='pci.11'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x2'/> + </controller> + <controller type='pci' index='12' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='12' port='0x1b'/> + <alias name='pci.12'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x3'/> + </controller> + <controller type='pci' index='13' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='13' port='0x1c'/> + <alias name='pci.13'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x4'/> + </controller> + <controller type='pci' index='14' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='14' port='0x1d'/> + <alias name='pci.14'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x5'/> + </controller> + <controller type='sata' index='0'> + <alias name='ide'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> + </controller> + <controller type='virtio-serial' index='0'> + <alias name='virtio-serial0'/> + <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/> + </controller> + <serial type='pty'> + <source path='/dev/pts/3'/> + <target type='isa-serial' port='0'> + <model name='isa-serial'/> + </target> + <alias name='serial0'/> + </serial> + <console type='pty' tty='/dev/pts/3'> + <source path='/dev/pts/3'/> + <target type='serial' port='0'/> + <alias name='serial0'/> + </console> + <channel type='unix'> + <source mode='bind' path='/run/libvirt/qemu/channel/2-virtio-vga-test/org.qemu.guest_agent.0'/> + <target type='virtio' name='org.qemu.guest_agent.0' state='disconnected'/> + <alias name='channel0'/> + <address type='virtio-serial' controller='0' bus='0' port='1'/> + </channel> + <input type='tablet' bus='usb'> + <alias name='input0'/> + <address type='usb' bus='0' port='1'/> + </input> + <input type='mouse' bus='ps2'> + <alias name='input1'/> + </input> + <input type='keyboard' bus='ps2'> + <alias name='input2'/> + </input> + <graphics type='vnc' port='5901' autoport='yes' websocketGenerated='no' listen='127.0.0.1'> + <listen type='address' address='127.0.0.1' fromConfig='1' autoGenerated='no'/> + </graphics> + <audio id='1' type='none'/> + <video> + <model type='virtio' heads='1' primary='yes'/> + <alias name='video0'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + </video> + <watchdog model='itco' action='reset'> + <alias name='watchdog0'/> + </watchdog> + <memballoon model='virtio'> + <alias name='balloon0'/> + <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/> + </memballoon> + <rng model='virtio'> + <backend model='random'>/dev/urandom</backend> + <alias name='rng0'/> + <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/> + </rng> + </devices> + <seclabel type='dynamic' model='selinux' relabel='yes'> + <label>unconfined_u:unconfined_r:svirt_t:s0:c369,c928</label> + <imagelabel>unconfined_u:object_r:svirt_image_t:s0:c369,c928</imagelabel> + </seclabel> + <seclabel type='dynamic' model='dac' relabel='yes'> + <label>+107:+107</label> + <imagelabel>+107:+107</imagelabel> + </seclabel> + </domain> +</domstatus> diff --git a/tests/qemuxmlactivetest.c b/tests/qemuxmlactivetest.c index 44e66a4a29..c3609e9459 100644 --- a/tests/qemuxmlactivetest.c +++ b/tests/qemuxmlactivetest.c @@ -278,6 +278,12 @@ mymain(void) DO_TEST_STATUS("qcow2-data-file"); + /* These test cases capture situation where the 'device' attribute of a + * virtio video device is missing and thus needs to be inferred from the + * available capabilities when an upgraded libvirt is started */ + DO_TEST_STATUS("virtio-vga-upgrade"); + DO_TEST_STATUS("virtio-vga-upgrade-missing"); + cleanup: qemuTestDriverFree(&driver); -- 2.54.0
From: Peter Krempa <pkrempa@redhat.com> Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/conf/domain_conf.c | 79 ++++++++++++++++++++---------------------- 1 file changed, 37 insertions(+), 42 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 2d3e646bcb..893027482d 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -27319,6 +27319,9 @@ static void virDomainVideoAccelDefFormat(virBuffer *buf, virDomainVideoAccelDef *def) { + if (!def) + return; + virBufferAddLit(buf, "<acceleration"); if (def->accel3d) { virBufferAsprintf(buf, " accel3d='%s'", @@ -27336,6 +27339,9 @@ static void virDomainVideoResolutionDefFormat(virBuffer *buf, virDomainVideoResolutionDef *def) { + if (!def) + return; + virBufferAddLit(buf, "<resolution"); if (def->x && def->y) { virBufferAsprintf(buf, " x='%u' y='%u'", @@ -27350,7 +27356,10 @@ virDomainVideoDefFormat(virBuffer *buf, unsigned int flags) { const char *model = virDomainVideoTypeToString(def->type); - g_auto(virBuffer) driverBuf = VIR_BUFFER_INITIALIZER; + g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf); + g_auto(virBuffer) driverAttrBuf = VIR_BUFFER_INITIALIZER; + g_auto(virBuffer) modelAttrBuf = VIR_BUFFER_INITIALIZER; + g_auto(virBuffer) modelChildBuf = VIR_BUFFER_INIT_CHILD(&childBuf); if (!model) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -27358,61 +27367,47 @@ virDomainVideoDefFormat(virBuffer *buf, return -1; } - virBufferAddLit(buf, "<video>\n"); - virBufferAdjustIndent(buf, 2); - virDomainVirtioOptionsFormat(&driverBuf, def->virtio); - if (virBufferUse(&driverBuf) || (def->driver && def->driver->vgaconf) || - def->backend != VIR_DOMAIN_VIDEO_BACKEND_TYPE_DEFAULT) { - virBufferAddLit(buf, "<driver"); - if (virBufferUse(&driverBuf)) - virBufferAddBuffer(buf, &driverBuf); - if (def->driver && def->driver->vgaconf) - virBufferAsprintf(buf, " vgaconf='%s'", - virDomainVideoVGAConfTypeToString(def->driver->vgaconf)); - if (def->backend != VIR_DOMAIN_VIDEO_BACKEND_TYPE_DEFAULT) - virBufferAsprintf(buf, " name='%s'", - virDomainVideoBackendTypeToString(def->backend)); - virBufferAddLit(buf, "/>\n"); - } - virBufferAsprintf(buf, "<model type='%s'", - model); + virDomainVirtioOptionsFormat(&driverAttrBuf, def->virtio); + if (def->driver && def->driver->vgaconf) + virBufferAsprintf(&driverAttrBuf, " vgaconf='%s'", + virDomainVideoVGAConfTypeToString(def->driver->vgaconf)); + if (def->backend != VIR_DOMAIN_VIDEO_BACKEND_TYPE_DEFAULT) + virBufferAsprintf(&driverAttrBuf, " name='%s'", + virDomainVideoBackendTypeToString(def->backend)); + + virXMLFormatElement(&childBuf, "driver", &driverAttrBuf, NULL); + + virBufferAsprintf(&modelAttrBuf, " type='%s'", model); if (def->ram) - virBufferAsprintf(buf, " ram='%u'", def->ram); + virBufferAsprintf(&modelAttrBuf, " ram='%u'", def->ram); if (def->vram) - virBufferAsprintf(buf, " vram='%u'", def->vram); + virBufferAsprintf(&modelAttrBuf, " vram='%u'", def->vram); if (def->vram64) - virBufferAsprintf(buf, " vram64='%u'", def->vram64); + virBufferAsprintf(&modelAttrBuf, " vram64='%u'", def->vram64); if (def->vgamem) - virBufferAsprintf(buf, " vgamem='%u'", def->vgamem); + virBufferAsprintf(&modelAttrBuf, " vgamem='%u'", def->vgamem); if (def->heads) - virBufferAsprintf(buf, " heads='%u'", def->heads); + virBufferAsprintf(&modelAttrBuf, " heads='%u'", def->heads); if (def->primary) - virBufferAddLit(buf, " primary='yes'"); + virBufferAddLit(&modelAttrBuf, " primary='yes'"); if (def->blob != VIR_TRISTATE_SWITCH_ABSENT) - virBufferAsprintf(buf, " blob='%s'", virTristateSwitchTypeToString(def->blob)); + virBufferAsprintf(&modelAttrBuf, " blob='%s'", virTristateSwitchTypeToString(def->blob)); if (def->edid != VIR_TRISTATE_SWITCH_ABSENT) - virBufferAsprintf(buf, " edid='%s'", virTristateSwitchTypeToString(def->edid)); - if (def->accel || def->res) { - virBufferAddLit(buf, ">\n"); - virBufferAdjustIndent(buf, 2); - if (def->accel) - virDomainVideoAccelDefFormat(buf, def->accel); - if (def->res) - virDomainVideoResolutionDefFormat(buf, def->res); - virBufferAdjustIndent(buf, -2); - virBufferAddLit(buf, "</model>\n"); - } else { - virBufferAddLit(buf, "/>\n"); - } + virBufferAsprintf(&modelAttrBuf, " edid='%s'", virTristateSwitchTypeToString(def->edid)); - virDomainDeviceInfoFormat(buf, &def->info, flags); + virDomainVideoAccelDefFormat(&modelChildBuf, def->accel); + virDomainVideoResolutionDefFormat(&modelChildBuf, def->res); - virBufferAdjustIndent(buf, -2); - virBufferAddLit(buf, "</video>\n"); + virXMLFormatElement(&childBuf, "model", &modelAttrBuf, &modelChildBuf); + + virDomainDeviceInfoFormat(&childBuf, &def->info, flags); + + virXMLFormatElement(buf, "video", NULL, &childBuf); return 0; } + static int virDomainInputDefFormat(virBuffer *buf, virDomainInputDef *def, -- 2.54.0
From: Peter Krempa <pkrempa@redhat.com> QEMU's commandline generator picks for virtio video between various actual device models not only based on the XML definition but also capabilities present. Since none of the devices is actually ABI compatible we need to record the actually selected device in the XML. Introduce 'device' attribute: <video> <model type='virtio' heads='1' primary='yes' device='virtio-gpu'/> which will record the actually selected model so that we can preserve ABI across restarts on deployment changes but more importantly across migrations where the deployment differs. The code specifically avoids an ABI stability check for the new field because there are already possibly broken configurations that the users may want to fix by picking the proper model which could be forbidden. Users are instructed to not set the field in the XML. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 8 +++++++ src/conf/domain_conf.c | 35 +++++++++++++++++++++++++++++++ src/conf/domain_conf.h | 15 +++++++++++++ src/conf/schemas/domaincommon.rng | 18 +++++++++++++++- src/libvirt_private.syms | 1 + 5 files changed, 76 insertions(+), 1 deletion(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index db1ca5637a..a861f9f177 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -7365,6 +7365,14 @@ A video device. guest. The ``edid`` attribute is only valid for model types ``vga``, ``bochs``, and ``virtio``. + :since:`Since 12.5.0` the ``virtio`` video model has an additional attribute + ``device``, which records the specific virtio device model which was picked + for the configuration, to preserve guest ABI and migration compatibility. + Users do not need to set this attribute as aprropriate value is picked and + filled in automatically. Accepted values are ``virtio-vga``, ``virtio-gpu``, + ``virtio-vga-gl``, and ``virtio-gpu-gl``, but not all combinations of config + and this field make sense. + ``acceleration`` Configure if video acceleration should be enabled. diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 893027482d..17c4a57cd8 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -910,6 +910,17 @@ VIR_ENUM_IMPL(virDomainVideoVGAConf, "off", ); +VIR_ENUM_IMPL(virDomainVideoVirtioDevice, + VIR_DOMAIN_VIDEO_VIRTIO_DEVICE_LAST, + "", + "virtio-vga", + "virtio-gpu", + "virtio-vga-gl", + "virtio-gpu-gl", + "vhost-user-vga", + "vhost-user-gpu", +); + VIR_ENUM_IMPL(virDomainInput, VIR_DOMAIN_INPUT_TYPE_LAST, "mouse", @@ -13816,6 +13827,14 @@ virDomainVideoModelDefParseXML(virDomainVideoDef *def, VIR_DOMAIN_VIDEO_TYPE_DEFAULT) < 0) return -1; + if (def->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO) { + if (virXMLPropEnumDefault(node, "device", + virDomainVideoVirtioDeviceTypeFromString, + VIR_XML_PROP_NONZERO, &def->virtiodevice, + VIR_DOMAIN_VIDEO_VIRTIO_DEVICE_DEFAULT) < 0) + return -1; + } + if (virXMLPropUInt(node, "ram", 10, VIR_XML_PROP_NONE, &def->ram) < 0) return -1; @@ -21694,6 +21713,18 @@ virDomainVideoDefCheckABIStability(virDomainVideoDef *src, return false; } + /* While 'src->virtiodevice' vs 'dst->virtiodevice' match is considered + * guest ABI (both the device looks different to the guest OS and qemu + * refuses to migrate into wrong device) we deliberately omit the check + * here due to historical reasons. + * + * The actual values were not recorded in the XML after picking a device + * based on capabilities and thus, if the host configuration changes + * different defaults can be picked. Users might want to fix their + * saveimage or migration by specifying the proper model which will differ + * from the one that will be auto-picked via post-parse callback when the + * XML is loaded for the first time */ + if (!virDomainVirtioOptionsCheckABIStability(src->virtio, dst->virtio)) return false; @@ -27395,6 +27426,10 @@ virDomainVideoDefFormat(virBuffer *buf, if (def->edid != VIR_TRISTATE_SWITCH_ABSENT) virBufferAsprintf(&modelAttrBuf, " edid='%s'", virTristateSwitchTypeToString(def->edid)); + if (def->virtiodevice != VIR_DOMAIN_VIDEO_VIRTIO_DEVICE_DEFAULT) + virBufferAsprintf(&modelAttrBuf, " device='%s'", + virDomainVideoVirtioDeviceTypeToString(def->virtiodevice)); + virDomainVideoAccelDefFormat(&modelChildBuf, def->accel); virDomainVideoResolutionDefFormat(&modelChildBuf, def->res); diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index d17f6352bd..bd360cd4a3 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1885,6 +1885,20 @@ typedef enum { VIR_ENUM_DECL(virDomainVideoVGAConf); +typedef enum { + VIR_DOMAIN_VIDEO_VIRTIO_DEVICE_DEFAULT = 0, + VIR_DOMAIN_VIDEO_VIRTIO_DEVICE_VGA, + VIR_DOMAIN_VIDEO_VIRTIO_DEVICE_GPU, + VIR_DOMAIN_VIDEO_VIRTIO_DEVICE_VGA_GL, + VIR_DOMAIN_VIDEO_VIRTIO_DEVICE_GPU_GL, + VIR_DOMAIN_VIDEO_VIRTIO_DEVICE_VHOST_USER_VGA, + VIR_DOMAIN_VIDEO_VIRTIO_DEVICE_VHOST_USER_GPU, + + VIR_DOMAIN_VIDEO_VIRTIO_DEVICE_LAST +} virDomainVideoVirtioDevice; + +VIR_ENUM_DECL(virDomainVideoVirtioDevice); + struct _virDomainVideoAccelDef { virTristateBool accel2d; virTristateBool accel3d; @@ -1915,6 +1929,7 @@ struct _virDomainVideoDef { virDomainVideoResolutionDef *res; virTristateSwitch blob; virDomainVideoDriverDef *driver; + virDomainVideoVirtioDevice virtiodevice; /* virtio device frontend */ virDomainDeviceInfo info; virDomainVirtioOptions *virtio; virDomainVideoBackendType backend; diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincommon.rng index eb365a83b5..121e4e06a6 100644 --- a/src/conf/schemas/domaincommon.rng +++ b/src/conf/schemas/domaincommon.rng @@ -4874,7 +4874,6 @@ <value>vmvga</value> <value>xen</value> <value>vbox</value> - <value>virtio</value> <value>gop</value> <value>none</value> <value>bochs</value> @@ -4901,6 +4900,23 @@ </attribute> </optional> </group> + <group> + <attribute name="type"> + <value>virtio</value> + </attribute> + <optional> + <attribute name="device"> + <choice> + <value>virtio-vga</value> + <value>virtio-vga-gl</value> + <value>virtio-gpu</value> + <value>virtio-gpu-gl</value> + <value>vhost-user-vga</value> + <value>vhost-user-gpu</value> + </choice> + </attribute> + </optional> + </group> </choice> <optional> <attribute name="vram"> diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 30c4564456..c76e5cb08a 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -731,6 +731,7 @@ virDomainVideoTypeFromString; virDomainVideoTypeToString; virDomainVideoVGAConfTypeFromString; virDomainVideoVGAConfTypeToString; +virDomainVideoVirtioDeviceTypeToString; virDomainVirtTypeFromString; virDomainVirtTypeToString; virDomainVsockDefEquals; -- 2.54.0
From: Peter Krempa <pkrempa@redhat.com> Add a test case demonstrating the switch to 'virtio-gpu' on a host which would normally pick 'virtio-vga'. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- ...io-vga-device-downgrade.x86_64-latest.args | 37 ++++++++++++++++ ...tio-vga-device-downgrade.x86_64-latest.xml | 44 +++++++++++++++++++ .../video-virtio-vga-device-downgrade.xml | 33 ++++++++++++++ tests/qemuxmlconftest.c | 1 + 4 files changed, 115 insertions(+) create mode 100644 tests/qemuxmlconfdata/video-virtio-vga-device-downgrade.x86_64-latest.args create mode 100644 tests/qemuxmlconfdata/video-virtio-vga-device-downgrade.x86_64-latest.xml create mode 100644 tests/qemuxmlconfdata/video-virtio-vga-device-downgrade.xml diff --git a/tests/qemuxmlconfdata/video-virtio-vga-device-downgrade.x86_64-latest.args b/tests/qemuxmlconfdata/video-virtio-vga-device-downgrade.x86_64-latest.args new file mode 100644 index 0000000000..74b64b3c91 --- /dev/null +++ b/tests/qemuxmlconfdata/video-virtio-vga-device-downgrade.x86_64-latest.args @@ -0,0 +1,37 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1 \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ +/usr/bin/qemu-system-x86_64 \ +-name guest=QEMUGuest1,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ +-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \ +-accel tcg \ +-cpu qemu64 \ +-m size=1048576k \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":1073741824}' \ +-overcommit mem-lock=off \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,fd=@mon-fd@,server=on,wait=off \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-boot strict=on \ +-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \ +-blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/QEMUGuest1","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap","cache":{"direct":true,"no-flush":false}}' \ +-blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"direct":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}' \ +-device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1,"write-cache":"on"}' \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-device '{"driver":"virtio-vga","id":"video0","max_outputs":1,"bus":"pci.0","addr":"0x2"}' \ +-device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x3"}' \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxmlconfdata/video-virtio-vga-device-downgrade.x86_64-latest.xml b/tests/qemuxmlconfdata/video-virtio-vga-device-downgrade.x86_64-latest.xml new file mode 100644 index 0000000000..c04687983d --- /dev/null +++ b/tests/qemuxmlconfdata/video-virtio-vga-device-downgrade.x86_64-latest.xml @@ -0,0 +1,44 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>1048576</memory> + <currentMemory unit='KiB'>1048576</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='x86_64' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>qemu64</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <disk type='file' device='disk'> + <driver name='qemu' type='qcow2' cache='none'/> + <source file='/var/lib/libvirt/images/QEMUGuest1'/> + <target dev='hda' bus='ide'/> + <address type='drive' controller='0' bus='0' target='0' unit='0'/> + </disk> + <controller type='ide' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> + </controller> + <controller type='usb' index='0' model='piix3-uhci'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> + </controller> + <controller type='pci' index='0' model='pci-root'/> + <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <audio id='1' type='none'/> + <video> + <model type='virtio' heads='1' primary='yes' device='virtio-gpu'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> + </video> + <memballoon model='virtio'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> + </memballoon> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/video-virtio-vga-device-downgrade.xml b/tests/qemuxmlconfdata/video-virtio-vga-device-downgrade.xml new file mode 100644 index 0000000000..aef4b64ad4 --- /dev/null +++ b/tests/qemuxmlconfdata/video-virtio-vga-device-downgrade.xml @@ -0,0 +1,33 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>1048576</memory> + <currentMemory unit='KiB'>1048576</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='x86_64' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <disk type='file' device='disk'> + <driver name='qemu' type='qcow2' cache='none'/> + <source file='/var/lib/libvirt/images/QEMUGuest1'/> + <target dev='hda' bus='ide'/> + <address type='drive' controller='0' bus='0' target='0' unit='0'/> + </disk> + <controller type='ide' index='0'/> + <controller type='usb' index='0'/> + <controller type='pci' index='0' model='pci-root'/> + <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <video> + <model type='virtio' heads='1' device='virtio-gpu'/> + </video> + <memballoon model='virtio'/> + </devices> +</domain> diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index 2423eadbfb..856aa046b6 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -2639,6 +2639,7 @@ mymain(void) ARG_CAPS_VER, "latest", ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_VIRTIO_VGA, QEMU_CAPS_LAST, ARG_END); + DO_TEST_CAPS_LATEST("video-virtio-vga-device-downgrade"); DO_TEST_CAPS_LATEST("video-virtio-blob-on"); DO_TEST_CAPS_LATEST("video-virtio-blob-off"); DO_TEST_CAPS_LATEST("video-virtio-vga-gpu-gl"); -- 2.54.0
From: Peter Krempa <pkrempa@redhat.com> There's no point in falling through to the check reporting invalid type since if the code picks a model that one will be valid. Reorganize the code so that we can return final decision right away. This means that the two flags 'virtio' and 'virtioBusSuffix' need to be set prior to the return. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/qemu/qemu_command.c | 160 +++++++++++++++++++--------------------- 1 file changed, 77 insertions(+), 83 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index a5350acec2..ab77cd56ce 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -719,7 +719,6 @@ qemuDeviceVideoGetModel(virQEMUCaps *qemuCaps, bool *virtio, bool *virtioBusSuffix) { - const char *model = NULL; bool primaryVga = false; virTristateBool accel3d = VIR_TRISTATE_BOOL_ABSENT; @@ -732,98 +731,93 @@ qemuDeviceVideoGetModel(virQEMUCaps *qemuCaps, if (video->primary && qemuDomainSupportsVideoVga(video, qemuCaps)) primaryVga = true; + if (video->backend == VIR_DOMAIN_VIDEO_BACKEND_TYPE_VHOSTUSER) { + if (primaryVga) + return "vhost-user-vga"; + + *virtio = true; + *virtioBusSuffix = true; + return "vhost-user-gpu"; + } + /* We try to chose the best model for primary video device by preferring * model with VGA compatibility mode. For some video devices on some * architectures there might not be such model so fallback to one * without VGA compatibility mode. */ - if (video->backend == VIR_DOMAIN_VIDEO_BACKEND_TYPE_VHOSTUSER) { - if (primaryVga) { - model = "vhost-user-vga"; - } else { - model = "vhost-user-gpu"; + if (primaryVga) { + switch ((virDomainVideoType) video->type) { + case VIR_DOMAIN_VIDEO_TYPE_VGA: + return "VGA"; + + case VIR_DOMAIN_VIDEO_TYPE_CIRRUS: + return "cirrus-vga"; + + case VIR_DOMAIN_VIDEO_TYPE_VMVGA: + return "vmware-svga"; + + case VIR_DOMAIN_VIDEO_TYPE_QXL: + return "qxl-vga"; + + case VIR_DOMAIN_VIDEO_TYPE_VIRTIO: *virtio = true; - *virtioBusSuffix = true; + *virtioBusSuffix = false; + + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_VGA_GL) && + accel3d == VIR_TRISTATE_BOOL_YES) + return "virtio-vga-gl"; + + return "virtio-vga"; + + case VIR_DOMAIN_VIDEO_TYPE_BOCHS: + return "bochs-display"; + + case VIR_DOMAIN_VIDEO_TYPE_RAMFB: + return "ramfb"; + + case VIR_DOMAIN_VIDEO_TYPE_DEFAULT: + case VIR_DOMAIN_VIDEO_TYPE_XEN: + case VIR_DOMAIN_VIDEO_TYPE_VBOX: + case VIR_DOMAIN_VIDEO_TYPE_PARALLELS: + case VIR_DOMAIN_VIDEO_TYPE_GOP: + case VIR_DOMAIN_VIDEO_TYPE_NONE: + case VIR_DOMAIN_VIDEO_TYPE_LAST: + break; } } else { - if (primaryVga) { - switch ((virDomainVideoType) video->type) { - case VIR_DOMAIN_VIDEO_TYPE_VGA: - model = "VGA"; - break; - case VIR_DOMAIN_VIDEO_TYPE_CIRRUS: - model = "cirrus-vga"; - break; - case VIR_DOMAIN_VIDEO_TYPE_VMVGA: - model = "vmware-svga"; - break; - case VIR_DOMAIN_VIDEO_TYPE_QXL: - model = "qxl-vga"; - break; - case VIR_DOMAIN_VIDEO_TYPE_VIRTIO: - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_VGA_GL) && - accel3d == VIR_TRISTATE_BOOL_YES) - model = "virtio-vga-gl"; - else - model = "virtio-vga"; - - *virtio = true; - *virtioBusSuffix = false; - break; - case VIR_DOMAIN_VIDEO_TYPE_BOCHS: - model = "bochs-display"; - break; - case VIR_DOMAIN_VIDEO_TYPE_RAMFB: - model = "ramfb"; - break; - case VIR_DOMAIN_VIDEO_TYPE_DEFAULT: - case VIR_DOMAIN_VIDEO_TYPE_XEN: - case VIR_DOMAIN_VIDEO_TYPE_VBOX: - case VIR_DOMAIN_VIDEO_TYPE_PARALLELS: - case VIR_DOMAIN_VIDEO_TYPE_GOP: - case VIR_DOMAIN_VIDEO_TYPE_NONE: - case VIR_DOMAIN_VIDEO_TYPE_LAST: - break; - } - } else { - switch ((virDomainVideoType) video->type) { - case VIR_DOMAIN_VIDEO_TYPE_QXL: - model = "qxl"; - break; - case VIR_DOMAIN_VIDEO_TYPE_VIRTIO: - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_GPU_GL_PCI) && - accel3d == VIR_TRISTATE_BOOL_YES) - model = "virtio-gpu-gl"; - else - model = "virtio-gpu"; - - *virtio = true; - *virtioBusSuffix = true; - break; - case VIR_DOMAIN_VIDEO_TYPE_DEFAULT: - case VIR_DOMAIN_VIDEO_TYPE_VGA: - case VIR_DOMAIN_VIDEO_TYPE_CIRRUS: - case VIR_DOMAIN_VIDEO_TYPE_VMVGA: - case VIR_DOMAIN_VIDEO_TYPE_XEN: - case VIR_DOMAIN_VIDEO_TYPE_VBOX: - case VIR_DOMAIN_VIDEO_TYPE_PARALLELS: - case VIR_DOMAIN_VIDEO_TYPE_GOP: - case VIR_DOMAIN_VIDEO_TYPE_NONE: - case VIR_DOMAIN_VIDEO_TYPE_BOCHS: - case VIR_DOMAIN_VIDEO_TYPE_RAMFB: - case VIR_DOMAIN_VIDEO_TYPE_LAST: - break; - } - } - } + switch ((virDomainVideoType) video->type) { + case VIR_DOMAIN_VIDEO_TYPE_QXL: + return "qxl"; - if (!model || STREQ(model, "")) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("invalid model for video type '%1$s'"), - virDomainVideoTypeToString(video->type)); - return NULL; + case VIR_DOMAIN_VIDEO_TYPE_VIRTIO: + *virtio = true; + *virtioBusSuffix = true; + + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_GPU_GL_PCI) && + accel3d == VIR_TRISTATE_BOOL_YES) + return "virtio-gpu-gl"; + + return "virtio-gpu"; + + case VIR_DOMAIN_VIDEO_TYPE_DEFAULT: + case VIR_DOMAIN_VIDEO_TYPE_VGA: + case VIR_DOMAIN_VIDEO_TYPE_CIRRUS: + case VIR_DOMAIN_VIDEO_TYPE_VMVGA: + case VIR_DOMAIN_VIDEO_TYPE_XEN: + case VIR_DOMAIN_VIDEO_TYPE_VBOX: + case VIR_DOMAIN_VIDEO_TYPE_PARALLELS: + case VIR_DOMAIN_VIDEO_TYPE_GOP: + case VIR_DOMAIN_VIDEO_TYPE_NONE: + case VIR_DOMAIN_VIDEO_TYPE_BOCHS: + case VIR_DOMAIN_VIDEO_TYPE_RAMFB: + case VIR_DOMAIN_VIDEO_TYPE_LAST: + break; + } } - return model; + virReportError(VIR_ERR_INTERNAL_ERROR, + _("invalid model for video type '%1$s'"), + virDomainVideoTypeToString(video->type)); + return NULL; } -- 2.54.0
From: Peter Krempa <pkrempa@redhat.com> Historically 'virtio-vga' was always picked as the first '<video>' (virtio) device and any sub-sequent ones were 'virtio-gpu'. When support for aarch64 VMs was being added an exception to use 'virtio-gpu' for the primary device was added as aarch64 doesn't have anything resembling the "legacy" 'VGA' interface. At this point this exception was only for aarch64. The distinction between 'virtio-vga' and 'virtio-gpu' was *not* recorded in the VM XML as it was a new feature (for aarch64) and it didn't make sense to pick 'virtio-vga'. Some time later the following commit: commit 4c029e8cfa3338ef1a2d6851908a9fcf494a32e5 Author: Pavel Hrdina <phrdina@redhat.com> Date: Fri Sep 30 14:41:37 2016 +0200 qemu_command: properly detect which model to use for video device This improves commit 706b5b6277 in a way that we check qemu capabilities instead of what architecture we are running on to detect whether we can use *virtio-vga* model or not. This is not a case only for arm/aarch64. modified the code to do this picking by checking presence of 'virtio-vga' device instead. That approach didn't consider the fact that the modular deployment of qemu allows for the 'virtio-vga' device to be missing in certain cases, thus introducing a latent bug as we'll pick 'virtio-gpu' in such case but don't record it anywhere. Now this creates a problem, if the deployments differ, because you can have two *incompatible* (at migration stream level) setups which are based on the same identical XML without the possibility for the destination libvirt instance during migration to pick which is the correct one. To prevent this and actually fix any existing such deployment (which allows upgrade of libvirt daemons on the source) we will record the picked device frontend at post-parse time into the XML. This luckily properly handles running VMs even if 'virtio-vga' were already installed since we record the actual qemuCaps we've started the VM with. Now 'virtio-vga' vs 'virtio-gpu' is not the only broken piece of logic. In fact 'virtio-vga-gl' could have been downgraded to 'virtio-vga' based on some very weird logic (see comments in code for explanation). The logic in 'qemuDomainDeviceVideoDefPostParse' re-creates the logic used to setup virtio-vga vs. virtio-gpu, and 'vhost-user-vga' vs. 'vhost-user-gpu' as those still make sense. For the 'gl' variants two versions exist, one meant to recover running VMs and one for new VMs where the broken logic makes no sense. Now this patch just records what was selected into the XML, but doesn't yet modify the commandline to actually use that value verbatim (e.g. if the user specified an actual non-default value already). Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/qemu/qemu_postparse.c | 97 ++++++++++++++++++- .../virtio-vga-upgrade-missing-out.xml | 2 +- .../virtio-vga-upgrade-out.xml | 2 +- .../aarch64-video-default.aarch64-latest.xml | 2 +- ...64-video-virtio-gpu-pci.aarch64-latest.xml | 2 +- ...fault-models.aarch64-latest.abi-update.xml | 2 +- ...h64-virt-default-models.aarch64-latest.xml | 2 +- .../aarch64-virt-graphics.aarch64-latest.xml | 2 +- ...ault-video-type-aarch64.aarch64-latest.xml | 2 +- ...eo-type-loongarch64.loongarch64-latest.xml | 2 +- ...ault-video-type-riscv64.riscv64-latest.xml | 2 +- .../default-video-type-s390x.s390x-latest.xml | 2 +- ...t-models.loongarch64-latest.abi-update.xml | 2 +- ...virt-default-models.loongarch64-latest.xml | 2 +- ...rch64-virt-graphics.loongarch64-latest.xml | 2 +- .../q35-pcie-autoadd.x86_64-latest.xml | 2 +- .../q35-pcie.x86_64-latest.xml | 2 +- ...fault-models.riscv64-latest.abi-update.xml | 2 +- ...v64-virt-default-models.riscv64-latest.xml | 2 +- .../riscv64-virt-graphics.riscv64-latest.xml | 2 +- ...default-models.s390x-latest.abi-update.xml | 2 +- .../s390x-ccw-default-models.s390x-latest.xml | 2 +- .../s390x-ccw-graphics.s390x-latest.xml | 2 +- ...vhost-user-gpu-secondary.x86_64-latest.xml | 4 +- .../vhost-user-vga.x86_64-latest.xml | 2 +- .../video-virtio-blob-off.x86_64-latest.xml | 4 +- .../video-virtio-blob-on.x86_64-latest.xml | 4 +- .../video-virtio-edid-none.x86_64-latest.xml | 2 +- .../video-virtio-edid-off.x86_64-latest.xml | 2 +- .../video-virtio-edid-on.x86_64-latest.xml | 2 +- ...video-virtio-gpu-ccw-auto.s390x-latest.xml | 2 +- .../video-virtio-gpu-ccw.s390x-latest.xml | 4 +- .../video-virtio-gpu-device.x86_64-latest.xml | 2 +- .../video-virtio-gpu-sdl-gl.x86_64-latest.xml | 2 +- ...deo-virtio-gpu-secondary.x86_64-latest.xml | 4 +- ...ideo-virtio-gpu-spice-gl.x86_64-latest.xml | 2 +- .../video-virtio-gpu-virgl.x86_64-latest.xml | 2 +- ..._VIRTIO_GPU_GL_PCI-disabled-ABI_UPDATE.xml | 2 +- ...t.QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled.xml | 4 +- ...CAPS_VIRTIO_VGA_GL-disabled-ABI_UPDATE.xml | 4 +- ...atest.QEMU_CAPS_VIRTIO_VGA_GL-disabled.xml | 4 +- .../video-virtio-vga-gpu-gl.x86_64-latest.xml | 4 +- ...t.QEMU_CAPS_DEVICE_VIRTIO_VGA-disabled.xml | 2 +- .../video-virtio-vga.x86_64-latest.xml | 2 +- ...virtio-options-video-ats.x86_64-latest.xml | 4 +- ...rtio-options-video-iommu.x86_64-latest.xml | 4 +- ...tio-options-video-packed.x86_64-latest.xml | 4 +- tests/qemuxmlconfdata/virtio-options.xml | 2 +- 48 files changed, 154 insertions(+), 61 deletions(-) diff --git a/src/qemu/qemu_postparse.c b/src/qemu/qemu_postparse.c index e4ff902ae1..9eda2f6b99 100644 --- a/src/qemu/qemu_postparse.c +++ b/src/qemu/qemu_postparse.c @@ -308,7 +308,8 @@ qemuDomainDefaultVideoDevice(const virDomainDef *def, static int qemuDomainDeviceVideoDefPostParse(virDomainVideoDef *video, const virDomainDef *def, - virQEMUCaps *qemuCaps) + virQEMUCaps *qemuCaps, + unsigned int parseFlags) { if (video->type == VIR_DOMAIN_VIDEO_TYPE_DEFAULT) video->type = qemuDomainDefaultVideoDevice(def, qemuCaps); @@ -318,6 +319,98 @@ qemuDomainDeviceVideoDefPostParse(virDomainVideoDef *video, video->vgamem = QEMU_QXL_VGAMEM_DEFAULT; } + /* Fill in 'virtiodevice' (device='%s' attribute in XML. + * + * Historically for <video><model type='virtio' ... the selection of the + * actual device type (virtio-vga, virtio-vga-gl, virtio-gpu, virtio-gpu-gl) + * was done when formatting commandline based on capabilities. + * + * Unfortunately neither of the aforementioned models are ABI/migration + * compatible. We must thus record the selcted model in the XML and that + * possibly retroactively based on the capabilities. + * + * For non accelerated video devices the logic is as follows: + * - for any secondary video device 'virtio-gpu' is always picked + * - for 'primary' video device 'virtio-vga' is used if available. If not + * 'virtio-gpu' is picked instead. + * + * We want to use the above logic both for existing VMs and new VMs since + * this is currently the proper configuration. + * + * For accelerated video devices the logic is slightly more broken as the + * fallbacks depended both on which of 'virtio-vga', 'virtio-vga-gl', + * 'virtio-gpu-gl', modules was actually found (see code below). + * + * For new VMs we do not want to fall back to non-gl versions since that + * disables acceleration. + */ + if (qemuCaps && + video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO && + video->virtiodevice == VIR_DOMAIN_VIDEO_VIRTIO_DEVICE_DEFAULT) { + /* in certain cases video->primary was not yet assigned */ + bool primary = video->primary || (video == def->videos[0]); + + if (video->backend == VIR_DOMAIN_VIDEO_BACKEND_TYPE_VHOSTUSER) { + /* primary device is 'vhost-user-vga' if available */ + if (primary && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VHOST_USER_VGA)) { + video->virtiodevice = VIR_DOMAIN_VIDEO_VIRTIO_DEVICE_VHOST_USER_VGA; + } else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VHOST_USER_GPU)) { + video->virtiodevice = VIR_DOMAIN_VIDEO_VIRTIO_DEVICE_VHOST_USER_GPU; + } else { + /* Don't fill in default; let validation reject the config */ + } + } else { + if (video->accel && + video->accel->accel3d == VIR_TRISTATE_BOOL_YES) { + /* if starting a new config don't downgrade to the non '-gl' vriants, + * allow downgrade only to preserve migration/ABI compatibility */ + if (parseFlags & VIR_DOMAIN_DEF_PARSE_ABI_UPDATE) { + if (primary && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_VGA_GL)) { + video->virtiodevice = VIR_DOMAIN_VIDEO_VIRTIO_DEVICE_VGA_GL; + } else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_GPU_GL_PCI)) { + video->virtiodevice = VIR_DOMAIN_VIDEO_VIRTIO_DEVICE_GPU_GL; + } else { + /* Don't fill in default; let validation reject the config */ + } + } else { + /* This logic is wrong, but faithfully represents the device + * the qemu driver would pick for an accelerated video device */ + if (primary && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_VGA)) { + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_VGA_GL)) { + video->virtiodevice = VIR_DOMAIN_VIDEO_VIRTIO_DEVICE_VGA_GL; + } else { + /* based on the above check we know this one exists */ + video->virtiodevice = VIR_DOMAIN_VIDEO_VIRTIO_DEVICE_VGA; + } + } else { + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_GPU_GL_PCI)) { + video->virtiodevice = VIR_DOMAIN_VIDEO_VIRTIO_DEVICE_GPU_GL; + } else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU)) { + video->virtiodevice = VIR_DOMAIN_VIDEO_VIRTIO_DEVICE_GPU; + } else { + /* this branch isn't a faithful representation of + * the old logic, but the VM wouldn't start anyway + * so we might as well make validation reject it */ + } + } + } + } else { + /* primary device is 'virtio-vga' if available */ + if (primary && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_VGA)) { + video->virtiodevice = VIR_DOMAIN_VIDEO_VIRTIO_DEVICE_VGA; + } else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU)) { + video->virtiodevice = VIR_DOMAIN_VIDEO_VIRTIO_DEVICE_GPU; + } else { + /* Don't fill in default; let validation reject the config */ + } + } + } + } + return 0; } @@ -867,7 +960,7 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDef *dev, break; case VIR_DOMAIN_DEVICE_VIDEO: - ret = qemuDomainDeviceVideoDefPostParse(dev->data.video, def, qemuCaps); + ret = qemuDomainDeviceVideoDefPostParse(dev->data.video, def, qemuCaps, parseFlags); break; case VIR_DOMAIN_DEVICE_PANIC: diff --git a/tests/qemustatusxml2xmldata/virtio-vga-upgrade-missing-out.xml b/tests/qemustatusxml2xmldata/virtio-vga-upgrade-missing-out.xml index a2b11ede2a..e483478d78 100644 --- a/tests/qemustatusxml2xmldata/virtio-vga-upgrade-missing-out.xml +++ b/tests/qemustatusxml2xmldata/virtio-vga-upgrade-missing-out.xml @@ -428,7 +428,7 @@ </graphics> <audio id='1' type='none'/> <video> - <model type='virtio' heads='1' primary='yes'/> + <model type='virtio' heads='1' primary='yes' device='virtio-gpu'/> <alias name='video0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> </video> diff --git a/tests/qemustatusxml2xmldata/virtio-vga-upgrade-out.xml b/tests/qemustatusxml2xmldata/virtio-vga-upgrade-out.xml index 7f59c46a5c..9fb5ef642e 100644 --- a/tests/qemustatusxml2xmldata/virtio-vga-upgrade-out.xml +++ b/tests/qemustatusxml2xmldata/virtio-vga-upgrade-out.xml @@ -430,7 +430,7 @@ </graphics> <audio id='1' type='none'/> <video> - <model type='virtio' heads='1' primary='yes'/> + <model type='virtio' heads='1' primary='yes' device='virtio-vga'/> <alias name='video0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> </video> diff --git a/tests/qemuxmlconfdata/aarch64-video-default.aarch64-latest.xml b/tests/qemuxmlconfdata/aarch64-video-default.aarch64-latest.xml index 558b8fab3e..c559134106 100644 --- a/tests/qemuxmlconfdata/aarch64-video-default.aarch64-latest.xml +++ b/tests/qemuxmlconfdata/aarch64-video-default.aarch64-latest.xml @@ -36,7 +36,7 @@ </graphics> <audio id='1' type='none'/> <video> - <model type='virtio' heads='1' primary='yes'/> + <model type='virtio' heads='1' primary='yes' device='virtio-gpu'/> <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> </video> </devices> diff --git a/tests/qemuxmlconfdata/aarch64-video-virtio-gpu-pci.aarch64-latest.xml b/tests/qemuxmlconfdata/aarch64-video-virtio-gpu-pci.aarch64-latest.xml index a212a28350..167b40887c 100644 --- a/tests/qemuxmlconfdata/aarch64-video-virtio-gpu-pci.aarch64-latest.xml +++ b/tests/qemuxmlconfdata/aarch64-video-virtio-gpu-pci.aarch64-latest.xml @@ -38,7 +38,7 @@ </interface> <audio id='1' type='none'/> <video> - <model type='virtio' heads='1' primary='yes'/> + <model type='virtio' heads='1' primary='yes' device='virtio-gpu'/> <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/> </video> </devices> diff --git a/tests/qemuxmlconfdata/aarch64-virt-default-models.aarch64-latest.abi-update.xml b/tests/qemuxmlconfdata/aarch64-virt-default-models.aarch64-latest.abi-update.xml index 09292686a3..8ce1412331 100644 --- a/tests/qemuxmlconfdata/aarch64-virt-default-models.aarch64-latest.abi-update.xml +++ b/tests/qemuxmlconfdata/aarch64-virt-default-models.aarch64-latest.abi-update.xml @@ -67,7 +67,7 @@ </tpm> <audio id='1' type='none'/> <video> - <model type='virtio' heads='1' primary='yes'/> + <model type='virtio' heads='1' primary='yes' device='virtio-gpu'/> <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/> </video> <memballoon model='none'/> diff --git a/tests/qemuxmlconfdata/aarch64-virt-default-models.aarch64-latest.xml b/tests/qemuxmlconfdata/aarch64-virt-default-models.aarch64-latest.xml index 09292686a3..8ce1412331 100644 --- a/tests/qemuxmlconfdata/aarch64-virt-default-models.aarch64-latest.xml +++ b/tests/qemuxmlconfdata/aarch64-virt-default-models.aarch64-latest.xml @@ -67,7 +67,7 @@ </tpm> <audio id='1' type='none'/> <video> - <model type='virtio' heads='1' primary='yes'/> + <model type='virtio' heads='1' primary='yes' device='virtio-gpu'/> <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/> </video> <memballoon model='none'/> diff --git a/tests/qemuxmlconfdata/aarch64-virt-graphics.aarch64-latest.xml b/tests/qemuxmlconfdata/aarch64-virt-graphics.aarch64-latest.xml index 20153b8e04..486af3467e 100644 --- a/tests/qemuxmlconfdata/aarch64-virt-graphics.aarch64-latest.xml +++ b/tests/qemuxmlconfdata/aarch64-virt-graphics.aarch64-latest.xml @@ -106,7 +106,7 @@ </graphics> <audio id='1' type='none'/> <video> - <model type='virtio' heads='1' primary='yes'/> + <model type='virtio' heads='1' primary='yes' device='virtio-gpu'/> <address type='pci' domain='0x0000' bus='0x07' slot='0x00' function='0x0'/> </video> <memballoon model='virtio'> diff --git a/tests/qemuxmlconfdata/default-video-type-aarch64.aarch64-latest.xml b/tests/qemuxmlconfdata/default-video-type-aarch64.aarch64-latest.xml index 308ec6acfd..6d0b0febe5 100644 --- a/tests/qemuxmlconfdata/default-video-type-aarch64.aarch64-latest.xml +++ b/tests/qemuxmlconfdata/default-video-type-aarch64.aarch64-latest.xml @@ -34,7 +34,7 @@ </graphics> <audio id='1' type='none'/> <video> - <model type='virtio' heads='1' primary='yes'/> + <model type='virtio' heads='1' primary='yes' device='virtio-gpu'/> <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> </video> <memballoon model='none'/> diff --git a/tests/qemuxmlconfdata/default-video-type-loongarch64.loongarch64-latest.xml b/tests/qemuxmlconfdata/default-video-type-loongarch64.loongarch64-latest.xml index 244f57ff8e..41b8bf8133 100644 --- a/tests/qemuxmlconfdata/default-video-type-loongarch64.loongarch64-latest.xml +++ b/tests/qemuxmlconfdata/default-video-type-loongarch64.loongarch64-latest.xml @@ -37,7 +37,7 @@ </graphics> <audio id='1' type='spice'/> <video> - <model type='virtio' heads='1' primary='yes'/> + <model type='virtio' heads='1' primary='yes' device='virtio-vga'/> <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> </video> <memballoon model='none'/> diff --git a/tests/qemuxmlconfdata/default-video-type-riscv64.riscv64-latest.xml b/tests/qemuxmlconfdata/default-video-type-riscv64.riscv64-latest.xml index 4e138ea717..b9a8152924 100644 --- a/tests/qemuxmlconfdata/default-video-type-riscv64.riscv64-latest.xml +++ b/tests/qemuxmlconfdata/default-video-type-riscv64.riscv64-latest.xml @@ -34,7 +34,7 @@ </graphics> <audio id='1' type='spice'/> <video> - <model type='virtio' heads='1' primary='yes'/> + <model type='virtio' heads='1' primary='yes' device='virtio-vga'/> <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> </video> <memballoon model='none'/> diff --git a/tests/qemuxmlconfdata/default-video-type-s390x.s390x-latest.xml b/tests/qemuxmlconfdata/default-video-type-s390x.s390x-latest.xml index c8aac8f1bf..d6223b84a0 100644 --- a/tests/qemuxmlconfdata/default-video-type-s390x.s390x-latest.xml +++ b/tests/qemuxmlconfdata/default-video-type-s390x.s390x-latest.xml @@ -22,7 +22,7 @@ </graphics> <audio id='1' type='none'/> <video> - <model type='virtio' heads='1' primary='yes'/> + <model type='virtio' heads='1' primary='yes' device='virtio-gpu'/> <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/> </video> <memballoon model='none'/> diff --git a/tests/qemuxmlconfdata/loongarch64-virt-default-models.loongarch64-latest.abi-update.xml b/tests/qemuxmlconfdata/loongarch64-virt-default-models.loongarch64-latest.abi-update.xml index f25d6c2cf0..0d27ffda54 100644 --- a/tests/qemuxmlconfdata/loongarch64-virt-default-models.loongarch64-latest.abi-update.xml +++ b/tests/qemuxmlconfdata/loongarch64-virt-default-models.loongarch64-latest.abi-update.xml @@ -64,7 +64,7 @@ </console> <audio id='1' type='none'/> <video> - <model type='virtio' heads='1' primary='yes'/> + <model type='virtio' heads='1' primary='yes' device='virtio-vga'/> <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/> </video> <memballoon model='none'/> diff --git a/tests/qemuxmlconfdata/loongarch64-virt-default-models.loongarch64-latest.xml b/tests/qemuxmlconfdata/loongarch64-virt-default-models.loongarch64-latest.xml index f25d6c2cf0..0d27ffda54 100644 --- a/tests/qemuxmlconfdata/loongarch64-virt-default-models.loongarch64-latest.xml +++ b/tests/qemuxmlconfdata/loongarch64-virt-default-models.loongarch64-latest.xml @@ -64,7 +64,7 @@ </console> <audio id='1' type='none'/> <video> - <model type='virtio' heads='1' primary='yes'/> + <model type='virtio' heads='1' primary='yes' device='virtio-vga'/> <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/> </video> <memballoon model='none'/> diff --git a/tests/qemuxmlconfdata/loongarch64-virt-graphics.loongarch64-latest.xml b/tests/qemuxmlconfdata/loongarch64-virt-graphics.loongarch64-latest.xml index 0be35dcba8..7bb6b123ea 100644 --- a/tests/qemuxmlconfdata/loongarch64-virt-graphics.loongarch64-latest.xml +++ b/tests/qemuxmlconfdata/loongarch64-virt-graphics.loongarch64-latest.xml @@ -102,7 +102,7 @@ </graphics> <audio id='1' type='none'/> <video> - <model type='virtio' heads='1' primary='yes'/> + <model type='virtio' heads='1' primary='yes' device='virtio-vga'/> <address type='pci' domain='0x0000' bus='0x07' slot='0x00' function='0x0'/> </video> <memballoon model='virtio'> diff --git a/tests/qemuxmlconfdata/q35-pcie-autoadd.x86_64-latest.xml b/tests/qemuxmlconfdata/q35-pcie-autoadd.x86_64-latest.xml index c92408d95c..92e3943a20 100644 --- a/tests/qemuxmlconfdata/q35-pcie-autoadd.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/q35-pcie-autoadd.x86_64-latest.xml @@ -138,7 +138,7 @@ <input type='keyboard' bus='ps2'/> <audio id='1' type='none'/> <video> - <model type='virtio' heads='1' primary='yes'/> + <model type='virtio' heads='1' primary='yes' device='virtio-vga'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> </video> <watchdog model='itco' action='reset'/> diff --git a/tests/qemuxmlconfdata/q35-pcie.x86_64-latest.xml b/tests/qemuxmlconfdata/q35-pcie.x86_64-latest.xml index 0a36e78e02..b68284320c 100644 --- a/tests/qemuxmlconfdata/q35-pcie.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/q35-pcie.x86_64-latest.xml @@ -142,7 +142,7 @@ <input type='keyboard' bus='ps2'/> <audio id='1' type='none'/> <video> - <model type='virtio' heads='1' primary='yes'/> + <model type='virtio' heads='1' primary='yes' device='virtio-vga'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> </video> <watchdog model='itco' action='reset'/> diff --git a/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.abi-update.xml b/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.abi-update.xml index 620da73422..2e0d5f6634 100644 --- a/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.abi-update.xml +++ b/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.abi-update.xml @@ -67,7 +67,7 @@ </tpm> <audio id='1' type='none'/> <video> - <model type='virtio' heads='1' primary='yes'/> + <model type='virtio' heads='1' primary='yes' device='virtio-vga'/> <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/> </video> <memballoon model='none'/> diff --git a/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.xml b/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.xml index 620da73422..2e0d5f6634 100644 --- a/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.xml +++ b/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.xml @@ -67,7 +67,7 @@ </tpm> <audio id='1' type='none'/> <video> - <model type='virtio' heads='1' primary='yes'/> + <model type='virtio' heads='1' primary='yes' device='virtio-vga'/> <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/> </video> <memballoon model='none'/> diff --git a/tests/qemuxmlconfdata/riscv64-virt-graphics.riscv64-latest.xml b/tests/qemuxmlconfdata/riscv64-virt-graphics.riscv64-latest.xml index 9f35b5ed18..0857a00710 100644 --- a/tests/qemuxmlconfdata/riscv64-virt-graphics.riscv64-latest.xml +++ b/tests/qemuxmlconfdata/riscv64-virt-graphics.riscv64-latest.xml @@ -99,7 +99,7 @@ </graphics> <audio id='1' type='none'/> <video> - <model type='virtio' heads='1' primary='yes'/> + <model type='virtio' heads='1' primary='yes' device='virtio-vga'/> <address type='pci' domain='0x0000' bus='0x07' slot='0x00' function='0x0'/> </video> <memballoon model='virtio'> diff --git a/tests/qemuxmlconfdata/s390x-ccw-default-models.s390x-latest.abi-update.xml b/tests/qemuxmlconfdata/s390x-ccw-default-models.s390x-latest.abi-update.xml index 9e0af389a9..cd3a00d01a 100644 --- a/tests/qemuxmlconfdata/s390x-ccw-default-models.s390x-latest.abi-update.xml +++ b/tests/qemuxmlconfdata/s390x-ccw-default-models.s390x-latest.abi-update.xml @@ -37,7 +37,7 @@ </console> <audio id='1' type='none'/> <video> - <model type='virtio' heads='1' primary='yes'/> + <model type='virtio' heads='1' primary='yes' device='virtio-gpu'/> <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/> </video> <memballoon model='none'/> diff --git a/tests/qemuxmlconfdata/s390x-ccw-default-models.s390x-latest.xml b/tests/qemuxmlconfdata/s390x-ccw-default-models.s390x-latest.xml index 9e0af389a9..cd3a00d01a 100644 --- a/tests/qemuxmlconfdata/s390x-ccw-default-models.s390x-latest.xml +++ b/tests/qemuxmlconfdata/s390x-ccw-default-models.s390x-latest.xml @@ -37,7 +37,7 @@ </console> <audio id='1' type='none'/> <video> - <model type='virtio' heads='1' primary='yes'/> + <model type='virtio' heads='1' primary='yes' device='virtio-gpu'/> <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/> </video> <memballoon model='none'/> diff --git a/tests/qemuxmlconfdata/s390x-ccw-graphics.s390x-latest.xml b/tests/qemuxmlconfdata/s390x-ccw-graphics.s390x-latest.xml index c4c4c4cfdb..3865e00da7 100644 --- a/tests/qemuxmlconfdata/s390x-ccw-graphics.s390x-latest.xml +++ b/tests/qemuxmlconfdata/s390x-ccw-graphics.s390x-latest.xml @@ -55,7 +55,7 @@ </graphics> <audio id='1' type='none'/> <video> - <model type='virtio' heads='1' primary='yes'/> + <model type='virtio' heads='1' primary='yes' device='virtio-gpu'/> <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0002'/> </video> <memballoon model='virtio'> diff --git a/tests/qemuxmlconfdata/vhost-user-gpu-secondary.x86_64-latest.xml b/tests/qemuxmlconfdata/vhost-user-gpu-secondary.x86_64-latest.xml index 1362326590..9acf8eff2e 100644 --- a/tests/qemuxmlconfdata/vhost-user-gpu-secondary.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/vhost-user-gpu-secondary.x86_64-latest.xml @@ -42,12 +42,12 @@ <audio id='1' type='none'/> <video> <driver name='vhostuser'/> - <model type='virtio' heads='1' primary='yes'/> + <model type='virtio' heads='1' primary='yes' device='vhost-user-vga'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <video> <driver name='vhostuser'/> - <model type='virtio' heads='1'/> + <model type='virtio' heads='1' device='vhost-user-gpu'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> </video> <memballoon model='virtio'> diff --git a/tests/qemuxmlconfdata/vhost-user-vga.x86_64-latest.xml b/tests/qemuxmlconfdata/vhost-user-vga.x86_64-latest.xml index 9a8bb9f92a..51bf78f8f4 100644 --- a/tests/qemuxmlconfdata/vhost-user-vga.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/vhost-user-vga.x86_64-latest.xml @@ -42,7 +42,7 @@ <audio id='1' type='none'/> <video> <driver name='vhostuser'/> - <model type='virtio' heads='1' primary='yes'/> + <model type='virtio' heads='1' primary='yes' device='vhost-user-vga'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <memballoon model='virtio'> diff --git a/tests/qemuxmlconfdata/video-virtio-blob-off.x86_64-latest.xml b/tests/qemuxmlconfdata/video-virtio-blob-off.x86_64-latest.xml index d8de97a642..4a93f53cca 100644 --- a/tests/qemuxmlconfdata/video-virtio-blob-off.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/video-virtio-blob-off.x86_64-latest.xml @@ -34,11 +34,11 @@ <input type='keyboard' bus='ps2'/> <audio id='1' type='none'/> <video> - <model type='virtio' heads='1' primary='yes' blob='off'/> + <model type='virtio' heads='1' primary='yes' blob='off' device='virtio-vga'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <video> - <model type='virtio' heads='1' blob='off'/> + <model type='virtio' heads='1' blob='off' device='virtio-gpu'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> </video> <memballoon model='virtio'> diff --git a/tests/qemuxmlconfdata/video-virtio-blob-on.x86_64-latest.xml b/tests/qemuxmlconfdata/video-virtio-blob-on.x86_64-latest.xml index 40f40b4132..916a6bd37f 100644 --- a/tests/qemuxmlconfdata/video-virtio-blob-on.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/video-virtio-blob-on.x86_64-latest.xml @@ -37,11 +37,11 @@ <input type='keyboard' bus='ps2'/> <audio id='1' type='none'/> <video> - <model type='virtio' heads='1' primary='yes' blob='on'/> + <model type='virtio' heads='1' primary='yes' blob='on' device='virtio-vga'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <video> - <model type='virtio' heads='1' blob='on'/> + <model type='virtio' heads='1' blob='on' device='virtio-gpu'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> </video> <memballoon model='virtio'> diff --git a/tests/qemuxmlconfdata/video-virtio-edid-none.x86_64-latest.xml b/tests/qemuxmlconfdata/video-virtio-edid-none.x86_64-latest.xml index 175828f44a..4fd2d71ad2 100644 --- a/tests/qemuxmlconfdata/video-virtio-edid-none.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/video-virtio-edid-none.x86_64-latest.xml @@ -31,7 +31,7 @@ <input type='keyboard' bus='ps2'/> <audio id='1' type='none'/> <video> - <model type='virtio' heads='1' primary='yes'/> + <model type='virtio' heads='1' primary='yes' device='virtio-vga'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <memballoon model='virtio'> diff --git a/tests/qemuxmlconfdata/video-virtio-edid-off.x86_64-latest.xml b/tests/qemuxmlconfdata/video-virtio-edid-off.x86_64-latest.xml index 35c01128b7..1e90b74ea2 100644 --- a/tests/qemuxmlconfdata/video-virtio-edid-off.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/video-virtio-edid-off.x86_64-latest.xml @@ -31,7 +31,7 @@ <input type='keyboard' bus='ps2'/> <audio id='1' type='none'/> <video> - <model type='virtio' heads='1' primary='yes' edid='off'/> + <model type='virtio' heads='1' primary='yes' edid='off' device='virtio-vga'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <memballoon model='virtio'> diff --git a/tests/qemuxmlconfdata/video-virtio-edid-on.x86_64-latest.xml b/tests/qemuxmlconfdata/video-virtio-edid-on.x86_64-latest.xml index b6feb171c2..9981cf0584 100644 --- a/tests/qemuxmlconfdata/video-virtio-edid-on.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/video-virtio-edid-on.x86_64-latest.xml @@ -31,7 +31,7 @@ <input type='keyboard' bus='ps2'/> <audio id='1' type='none'/> <video> - <model type='virtio' heads='1' primary='yes' edid='on'/> + <model type='virtio' heads='1' primary='yes' edid='on' device='virtio-vga'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <memballoon model='virtio'> diff --git a/tests/qemuxmlconfdata/video-virtio-gpu-ccw-auto.s390x-latest.xml b/tests/qemuxmlconfdata/video-virtio-gpu-ccw-auto.s390x-latest.xml index 87ee9eee54..5bf5369ee2 100644 --- a/tests/qemuxmlconfdata/video-virtio-gpu-ccw-auto.s390x-latest.xml +++ b/tests/qemuxmlconfdata/video-virtio-gpu-ccw-auto.s390x-latest.xml @@ -29,7 +29,7 @@ </graphics> <audio id='1' type='none'/> <video> - <model type='virtio' heads='1' primary='yes'/> + <model type='virtio' heads='1' primary='yes' device='virtio-gpu'/> <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/> </video> <memballoon model='virtio'> diff --git a/tests/qemuxmlconfdata/video-virtio-gpu-ccw.s390x-latest.xml b/tests/qemuxmlconfdata/video-virtio-gpu-ccw.s390x-latest.xml index 9b6bf6c980..cb1dbf10af 100644 --- a/tests/qemuxmlconfdata/video-virtio-gpu-ccw.s390x-latest.xml +++ b/tests/qemuxmlconfdata/video-virtio-gpu-ccw.s390x-latest.xml @@ -29,11 +29,11 @@ </graphics> <audio id='1' type='none'/> <video> - <model type='virtio' heads='1' primary='yes'/> + <model type='virtio' heads='1' primary='yes' device='virtio-gpu'/> <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0002'/> </video> <video> - <model type='virtio' heads='1'/> + <model type='virtio' heads='1' device='virtio-gpu'/> <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0003'/> </video> <memballoon model='virtio'> diff --git a/tests/qemuxmlconfdata/video-virtio-gpu-device.x86_64-latest.xml b/tests/qemuxmlconfdata/video-virtio-gpu-device.x86_64-latest.xml index 0c31cfb927..601932351b 100644 --- a/tests/qemuxmlconfdata/video-virtio-gpu-device.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/video-virtio-gpu-device.x86_64-latest.xml @@ -34,7 +34,7 @@ <input type='keyboard' bus='ps2'/> <audio id='1' type='none'/> <video> - <model type='virtio' heads='1' primary='yes'/> + <model type='virtio' heads='1' primary='yes' device='virtio-vga'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <memballoon model='virtio'> diff --git a/tests/qemuxmlconfdata/video-virtio-gpu-sdl-gl.x86_64-latest.xml b/tests/qemuxmlconfdata/video-virtio-gpu-sdl-gl.x86_64-latest.xml index 401fdaf697..12687e63d6 100644 --- a/tests/qemuxmlconfdata/video-virtio-gpu-sdl-gl.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/video-virtio-gpu-sdl-gl.x86_64-latest.xml @@ -36,7 +36,7 @@ <gl enable='yes'/> </graphics> <video> - <model type='virtio' heads='1' primary='yes'> + <model type='virtio' heads='1' primary='yes' device='virtio-vga-gl'> <acceleration accel3d='yes'/> </model> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> diff --git a/tests/qemuxmlconfdata/video-virtio-gpu-secondary.x86_64-latest.xml b/tests/qemuxmlconfdata/video-virtio-gpu-secondary.x86_64-latest.xml index 7eae993cc0..776217c498 100644 --- a/tests/qemuxmlconfdata/video-virtio-gpu-secondary.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/video-virtio-gpu-secondary.x86_64-latest.xml @@ -25,11 +25,11 @@ <input type='keyboard' bus='ps2'/> <audio id='1' type='none'/> <video> - <model type='virtio' heads='1' primary='yes'/> + <model type='virtio' heads='1' primary='yes' device='virtio-vga'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <video> - <model type='virtio' heads='1'/> + <model type='virtio' heads='1' device='virtio-gpu'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> </video> <memballoon model='virtio'> diff --git a/tests/qemuxmlconfdata/video-virtio-gpu-spice-gl.x86_64-latest.xml b/tests/qemuxmlconfdata/video-virtio-gpu-spice-gl.x86_64-latest.xml index 89da83de01..cc0426e2db 100644 --- a/tests/qemuxmlconfdata/video-virtio-gpu-spice-gl.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/video-virtio-gpu-spice-gl.x86_64-latest.xml @@ -38,7 +38,7 @@ </graphics> <audio id='1' type='spice'/> <video> - <model type='virtio' heads='1' primary='yes'> + <model type='virtio' heads='1' primary='yes' device='virtio-vga-gl'> <acceleration accel3d='yes'/> </model> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> diff --git a/tests/qemuxmlconfdata/video-virtio-gpu-virgl.x86_64-latest.xml b/tests/qemuxmlconfdata/video-virtio-gpu-virgl.x86_64-latest.xml index 48b1d833ff..fcbff0885e 100644 --- a/tests/qemuxmlconfdata/video-virtio-gpu-virgl.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/video-virtio-gpu-virgl.x86_64-latest.xml @@ -34,7 +34,7 @@ <input type='keyboard' bus='ps2'/> <audio id='1' type='none'/> <video> - <model type='virtio' heads='1' primary='yes'> + <model type='virtio' heads='1' primary='yes' device='virtio-vga-gl'> <acceleration accel3d='yes'/> </model> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> diff --git a/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled-ABI_UPDATE.xml b/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled-ABI_UPDATE.xml index 991141c643..587a1c1d0e 100644 --- a/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled-ABI_UPDATE.xml +++ b/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled-ABI_UPDATE.xml @@ -28,7 +28,7 @@ <input type='keyboard' bus='ps2'/> <audio id='1' type='none'/> <video> - <model type='virtio' heads='1' primary='yes'> + <model type='virtio' heads='1' primary='yes' device='virtio-vga-gl'> <acceleration accel3d='yes'/> </model> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> diff --git a/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled.xml b/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled.xml index 991141c643..2b53a42bc6 100644 --- a/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled.xml +++ b/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled.xml @@ -28,13 +28,13 @@ <input type='keyboard' bus='ps2'/> <audio id='1' type='none'/> <video> - <model type='virtio' heads='1' primary='yes'> + <model type='virtio' heads='1' primary='yes' device='virtio-vga-gl'> <acceleration accel3d='yes'/> </model> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <video> - <model type='virtio' heads='1'> + <model type='virtio' heads='1' device='virtio-gpu'> <acceleration accel3d='yes'/> </model> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> diff --git a/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_VGA_GL-disabled-ABI_UPDATE.xml b/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_VGA_GL-disabled-ABI_UPDATE.xml index 991141c643..19388b100c 100644 --- a/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_VGA_GL-disabled-ABI_UPDATE.xml +++ b/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_VGA_GL-disabled-ABI_UPDATE.xml @@ -28,13 +28,13 @@ <input type='keyboard' bus='ps2'/> <audio id='1' type='none'/> <video> - <model type='virtio' heads='1' primary='yes'> + <model type='virtio' heads='1' primary='yes' device='virtio-gpu-gl'> <acceleration accel3d='yes'/> </model> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <video> - <model type='virtio' heads='1'> + <model type='virtio' heads='1' device='virtio-gpu-gl'> <acceleration accel3d='yes'/> </model> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> diff --git a/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_VGA_GL-disabled.xml b/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_VGA_GL-disabled.xml index 991141c643..b84241fdac 100644 --- a/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_VGA_GL-disabled.xml +++ b/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_VGA_GL-disabled.xml @@ -28,13 +28,13 @@ <input type='keyboard' bus='ps2'/> <audio id='1' type='none'/> <video> - <model type='virtio' heads='1' primary='yes'> + <model type='virtio' heads='1' primary='yes' device='virtio-vga'> <acceleration accel3d='yes'/> </model> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <video> - <model type='virtio' heads='1'> + <model type='virtio' heads='1' device='virtio-gpu-gl'> <acceleration accel3d='yes'/> </model> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> diff --git a/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.xml b/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.xml index 991141c643..023db901dd 100644 --- a/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.xml @@ -28,13 +28,13 @@ <input type='keyboard' bus='ps2'/> <audio id='1' type='none'/> <video> - <model type='virtio' heads='1' primary='yes'> + <model type='virtio' heads='1' primary='yes' device='virtio-vga-gl'> <acceleration accel3d='yes'/> </model> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <video> - <model type='virtio' heads='1'> + <model type='virtio' heads='1' device='virtio-gpu-gl'> <acceleration accel3d='yes'/> </model> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> diff --git a/tests/qemuxmlconfdata/video-virtio-vga.x86_64-latest.QEMU_CAPS_DEVICE_VIRTIO_VGA-disabled.xml b/tests/qemuxmlconfdata/video-virtio-vga.x86_64-latest.QEMU_CAPS_DEVICE_VIRTIO_VGA-disabled.xml index 0c31cfb927..c04687983d 100644 --- a/tests/qemuxmlconfdata/video-virtio-vga.x86_64-latest.QEMU_CAPS_DEVICE_VIRTIO_VGA-disabled.xml +++ b/tests/qemuxmlconfdata/video-virtio-vga.x86_64-latest.QEMU_CAPS_DEVICE_VIRTIO_VGA-disabled.xml @@ -34,7 +34,7 @@ <input type='keyboard' bus='ps2'/> <audio id='1' type='none'/> <video> - <model type='virtio' heads='1' primary='yes'/> + <model type='virtio' heads='1' primary='yes' device='virtio-gpu'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <memballoon model='virtio'> diff --git a/tests/qemuxmlconfdata/video-virtio-vga.x86_64-latest.xml b/tests/qemuxmlconfdata/video-virtio-vga.x86_64-latest.xml index 0c31cfb927..601932351b 100644 --- a/tests/qemuxmlconfdata/video-virtio-vga.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/video-virtio-vga.x86_64-latest.xml @@ -34,7 +34,7 @@ <input type='keyboard' bus='ps2'/> <audio id='1' type='none'/> <video> - <model type='virtio' heads='1' primary='yes'/> + <model type='virtio' heads='1' primary='yes' device='virtio-vga'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <memballoon model='virtio'> diff --git a/tests/qemuxmlconfdata/virtio-options-video-ats.x86_64-latest.xml b/tests/qemuxmlconfdata/virtio-options-video-ats.x86_64-latest.xml index 228ace3fa5..49e488c6b4 100644 --- a/tests/qemuxmlconfdata/virtio-options-video-ats.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/virtio-options-video-ats.x86_64-latest.xml @@ -26,14 +26,14 @@ <audio id='1' type='none'/> <video> <driver ats='on' name='vhostuser'/> - <model type='virtio' heads='1' primary='yes'> + <model type='virtio' heads='1' primary='yes' device='vhost-user-vga'> <acceleration accel3d='yes' rendernode='/dev/dri/test'/> </model> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <video> <driver ats='off' name='vhostuser'/> - <model type='virtio' heads='1'> + <model type='virtio' heads='1' device='vhost-user-gpu'> <acceleration accel3d='yes' rendernode='/dev/dri/test'/> </model> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> diff --git a/tests/qemuxmlconfdata/virtio-options-video-iommu.x86_64-latest.xml b/tests/qemuxmlconfdata/virtio-options-video-iommu.x86_64-latest.xml index 971cab51e7..a3fe36980f 100644 --- a/tests/qemuxmlconfdata/virtio-options-video-iommu.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/virtio-options-video-iommu.x86_64-latest.xml @@ -26,14 +26,14 @@ <audio id='1' type='none'/> <video> <driver iommu='on' name='vhostuser'/> - <model type='virtio' heads='1' primary='yes'> + <model type='virtio' heads='1' primary='yes' device='vhost-user-vga'> <acceleration accel3d='yes' rendernode='/dev/dri/test'/> </model> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <video> <driver iommu='off' name='vhostuser'/> - <model type='virtio' heads='1'> + <model type='virtio' heads='1' device='vhost-user-gpu'> <acceleration accel3d='yes' rendernode='/dev/dri/test'/> </model> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> diff --git a/tests/qemuxmlconfdata/virtio-options-video-packed.x86_64-latest.xml b/tests/qemuxmlconfdata/virtio-options-video-packed.x86_64-latest.xml index 26856e5e45..efdd865561 100644 --- a/tests/qemuxmlconfdata/virtio-options-video-packed.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/virtio-options-video-packed.x86_64-latest.xml @@ -26,14 +26,14 @@ <audio id='1' type='none'/> <video> <driver packed='on' name='vhostuser'/> - <model type='virtio' heads='1' primary='yes'> + <model type='virtio' heads='1' primary='yes' device='vhost-user-vga'> <acceleration accel3d='yes' rendernode='/dev/dri/test'/> </model> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <video> <driver packed='off' name='vhostuser'/> - <model type='virtio' heads='1'> + <model type='virtio' heads='1' device='vhost-user-gpu'> <acceleration accel3d='yes' rendernode='/dev/dri/test'/> </model> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> diff --git a/tests/qemuxmlconfdata/virtio-options.xml b/tests/qemuxmlconfdata/virtio-options.xml index 05eaae35a9..89a424febf 100644 --- a/tests/qemuxmlconfdata/virtio-options.xml +++ b/tests/qemuxmlconfdata/virtio-options.xml @@ -82,7 +82,7 @@ <audio id='1' type='none'/> <video> <driver iommu='on' ats='on' packed='on' page_per_vq='on' name='vhostuser'/> - <model type='virtio' heads='1' primary='yes'> + <model type='virtio' heads='1' primary='yes' device='vhost-user-vga'> <acceleration accel3d='yes' rendernode='/dev/dri/test'/> </model> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> -- 2.54.0
From: Peter Krempa <pkrempa@redhat.com> The currently existing checks are broken: - only QEMU_CAPS_DEVICE_VHOST_USER_GPU is checked for vhostuser backends (vhost-user-vga is actually separately packaged) - the check for the 3d accelerated (-gl) versions checks only if one of them exists (the commandline formatter picks a non-gl afterwards) - 'virtio-vga'/'virtio-gpu' is not checked at all The code also doesn't yet check if, when the user passes the new 'device' property manually the config actually makes sense. To fix all of the above introduce a table of supported frontend devices as well as properties that need to be checked for them. This requires fixing a recently-introduced test case which shows a nonsensical situation. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/qemu/qemu_validate.c | 88 +++++++++++++------ ...VIRTIO_GPU_GL_PCI-disabled-ABI_UPDATE.args | 35 -------- ..._VIRTIO_GPU_GL_PCI-disabled-ABI_UPDATE.err | 1 + ..._VIRTIO_GPU_GL_PCI-disabled-ABI_UPDATE.xml | 46 ---------- tests/qemuxmlconftest.c | 1 + 5 files changed, 65 insertions(+), 106 deletions(-) delete mode 100644 tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled-ABI_UPDATE.args create mode 100644 tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled-ABI_UPDATE.err delete mode 100644 tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled-ABI_UPDATE.xml diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 7c0ea402c3..439d4b1916 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -2853,6 +2853,26 @@ qemuValidateDomainDeviceDefHostdev(const virDomainHostdevDef *hostdev, } +struct qemuValidateDeviceVideoVirtioData { + virQEMUCapsFlags cap; /* capability for the device */ + bool primary; /* this device can be only the primary device */ + bool vhostuser; /* uses the vhostuser protocol */ + bool gl; /* supports 3d accel */ +}; + + +struct qemuValidateDeviceVideoVirtioData qemuValidateDeviceVideoVirtioTable[] = { + [VIR_DOMAIN_VIDEO_VIRTIO_DEVICE_DEFAULT] = { .cap = QEMU_CAPS_LAST }, + [VIR_DOMAIN_VIDEO_VIRTIO_DEVICE_VGA] = { .cap = QEMU_CAPS_DEVICE_VIRTIO_VGA, .primary = true }, + [VIR_DOMAIN_VIDEO_VIRTIO_DEVICE_GPU] = { .cap = QEMU_CAPS_DEVICE_VIRTIO_GPU }, + [VIR_DOMAIN_VIDEO_VIRTIO_DEVICE_VGA_GL] = { .cap = QEMU_CAPS_VIRTIO_VGA_GL, .gl = true, .primary = true }, + [VIR_DOMAIN_VIDEO_VIRTIO_DEVICE_GPU_GL] = { .cap = QEMU_CAPS_VIRTIO_GPU_GL_PCI, .gl = true }, + [VIR_DOMAIN_VIDEO_VIRTIO_DEVICE_VHOST_USER_VGA] = { .cap = QEMU_CAPS_DEVICE_VHOST_USER_VGA, .vhostuser = true, .primary = true }, + [VIR_DOMAIN_VIDEO_VIRTIO_DEVICE_VHOST_USER_GPU] = { .cap = QEMU_CAPS_DEVICE_VHOST_USER_GPU, .vhostuser = true }, +}; +G_STATIC_ASSERT(G_N_ELEMENTS(qemuValidateDeviceVideoVirtioTable) == VIR_DOMAIN_VIDEO_VIRTIO_DEVICE_LAST); + + static int qemuValidateDomainDeviceDefVideo(const virDomainVideoDef *video, const virDomainDef *def, @@ -2873,6 +2893,49 @@ qemuValidateDomainDeviceDefVideo(const virDomainVideoDef *video, return -1; } + if (video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO) { + struct qemuValidateDeviceVideoVirtioData *data = &qemuValidateDeviceVideoVirtioTable[video->virtiodevice]; + + if (data->cap == QEMU_CAPS_LAST) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("this QEMU binary lacks any suitable 'virtio' video device frontend")); + return -1; + } + + if (!virQEMUCapsGet(qemuCaps, data->cap)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("this QEMU doesn't support the '%1$s' virtio video device frontend"), + virDomainVideoVirtioDeviceTypeToString(video->virtiodevice)); + return -1; + } + + if (data->primary && !video->primary) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("the '%1$s' virtio video device frontend can be only used as primary video device"), + virDomainVideoVirtioDeviceTypeToString(video->virtiodevice)); + return -1; + } + + /* this check deliberately allows downgrade to the non-gl frontend as + * that was possible due to a bug in capability checking and the + * commandline formatter. More details are explained in + * 'qemuDomainDeviceVideoDefPostParse' which selects the frontend */ + if (data->gl && + !(video->accel && video->accel->accel3d == VIR_TRISTATE_BOOL_YES)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("the '%1$s' virtio video device frontend can be only with enabled 3d acceleration"), + virDomainVideoVirtioDeviceTypeToString(video->virtiodevice)); + return -1; + } + + if (data->vhostuser != (video->backend == VIR_DOMAIN_VIDEO_BACKEND_TYPE_VHOSTUSER)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("the '%1$s' virtio video device doesn't match the selected vhostuser backend"), + virDomainVideoVirtioDeviceTypeToString(video->virtiodevice)); + return -1; + } + } + if (video->type != VIR_DOMAIN_VIDEO_TYPE_QXL && video->type != VIR_DOMAIN_VIDEO_TYPE_VIRTIO) { if (!video->primary) { @@ -2944,31 +3007,6 @@ qemuValidateDomainDeviceDefVideo(const virDomainVideoDef *video, } } - if (video->backend == VIR_DOMAIN_VIDEO_BACKEND_TYPE_VHOSTUSER) { - if (video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO && - !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VHOST_USER_GPU)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("this QEMU does not support 'vhost-user' video device")); - return -1; - } - } else if (video->accel) { - if (video->accel->accel3d == VIR_TRISTATE_BOOL_YES) { - if (video->type != VIR_DOMAIN_VIDEO_TYPE_VIRTIO) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("3d acceleration is supported only with 'virtio' video device")); - return -1; - } - - if (!(virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_GPU_VIRGL) || - virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_GPU_GL_PCI) || - virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_VGA_GL))) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("3d acceleration is not supported by this QEMU binary")); - return -1; - } - } - } - if (video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO) { if (video->blob != VIR_TRISTATE_SWITCH_ABSENT) { if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_GPU_BLOB)) { diff --git a/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled-ABI_UPDATE.args b/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled-ABI_UPDATE.args deleted file mode 100644 index cd19fd5d17..0000000000 --- a/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled-ABI_UPDATE.args +++ /dev/null @@ -1,35 +0,0 @@ -LC_ALL=C \ -PATH=/bin \ -HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1 \ -USER=test \ -LOGNAME=test \ -XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.local/share \ -XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.cache \ -XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -/usr/bin/qemu-system-x86_64 \ --name guest=QEMUGuest1,debug-threads=on \ --S \ --object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ --machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \ --accel tcg \ --cpu qemu64 \ --m size=1048576k \ --object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":1073741824}' \ --overcommit mem-lock=off \ --smp 1,sockets=1,cores=1,threads=1 \ --uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ --display none \ --no-user-config \ --nodefaults \ --chardev socket,id=charmonitor,fd=@mon-fd@,server=on,wait=off \ --mon chardev=charmonitor,id=monitor,mode=control \ --rtc base=utc \ --no-shutdown \ --boot strict=on \ --device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \ --audiodev '{"id":"audio1","driver":"none"}' \ --device '{"driver":"virtio-vga-gl","id":"video0","max_outputs":1,"bus":"pci.0","addr":"0x2"}' \ --device '{"driver":"virtio-gpu-pci","id":"video1","max_outputs":1,"bus":"pci.0","addr":"0x4"}' \ --device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x3"}' \ --sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ --msg timestamp=on diff --git a/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled-ABI_UPDATE.err b/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled-ABI_UPDATE.err new file mode 100644 index 0000000000..b94bf12d69 --- /dev/null +++ b/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled-ABI_UPDATE.err @@ -0,0 +1 @@ +unsupported configuration: this QEMU binary lacks any suitable 'virtio' video device frontend diff --git a/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled-ABI_UPDATE.xml b/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled-ABI_UPDATE.xml deleted file mode 100644 index 587a1c1d0e..0000000000 --- a/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_GPU_GL_PCI-disabled-ABI_UPDATE.xml +++ /dev/null @@ -1,46 +0,0 @@ -<domain type='qemu'> - <name>QEMUGuest1</name> - <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> - <memory unit='KiB'>1048576</memory> - <currentMemory unit='KiB'>1048576</currentMemory> - <vcpu placement='static'>1</vcpu> - <os> - <type arch='x86_64' machine='pc'>hvm</type> - <boot dev='hd'/> - </os> - <cpu mode='custom' match='exact' check='none'> - <model fallback='forbid'>qemu64</model> - </cpu> - <clock offset='utc'/> - <on_poweroff>destroy</on_poweroff> - <on_reboot>restart</on_reboot> - <on_crash>destroy</on_crash> - <devices> - <emulator>/usr/bin/qemu-system-x86_64</emulator> - <controller type='ide' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> - </controller> - <controller type='usb' index='0' model='piix3-uhci'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> - </controller> - <controller type='pci' index='0' model='pci-root'/> - <input type='mouse' bus='ps2'/> - <input type='keyboard' bus='ps2'/> - <audio id='1' type='none'/> - <video> - <model type='virtio' heads='1' primary='yes' device='virtio-vga-gl'> - <acceleration accel3d='yes'/> - </model> - <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> - </video> - <video> - <model type='virtio' heads='1'> - <acceleration accel3d='yes'/> - </model> - <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> - </video> - <memballoon model='virtio'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> - </memballoon> - </devices> -</domain> diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index 856aa046b6..a1389775b9 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -2664,6 +2664,7 @@ mymain(void) ARG_CAPS_VER, "latest", ARG_QEMU_CAPS_DEL, QEMU_CAPS_VIRTIO_GPU_GL_PCI, QEMU_CAPS_LAST, ARG_PARSEFLAGS, VIR_DOMAIN_DEF_PARSE_ABI_UPDATE, + ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR, ARG_END); DO_TEST_CAPS_LATEST("video-virtio-edid-none"); DO_TEST_CAPS_LATEST("video-virtio-edid-off"); -- 2.54.0
From: Peter Krempa <pkrempa@redhat.com> The virtio video device frontend type is either selected by the post-parse code based on capabilities or provided by the user/existing XML explicitly. No need to try to come up with a model when generating commandline based on broken logic. The difference in test output shows: - honours user's config in case of the new 'device' attribute - shows how incorrect fallback would be used for 'virtio-vga-gl' (picked virtio-vga (non-gl) instead of 'virtio-gpu-gl') Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/qemu/qemu_command.c | 75 +++++++------------ ...io-vga-device-downgrade.x86_64-latest.args | 2 +- ...APS_VIRTIO_VGA_GL-disabled-ABI_UPDATE.args | 2 +- 3 files changed, 30 insertions(+), 49 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index ab77cd56ce..c6d3c9ce16 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -703,9 +703,25 @@ qemuBuildDeviceAddressProps(virJSONValue *props, } +struct qemuDeviceVideoModelVirtioOpts { + bool virtio; + bool virtioBusSuffix; +}; + +struct qemuDeviceVideoModelVirtioOpts qemuDeviceVideoGetModelVirtioOptsTable[] = { + [VIR_DOMAIN_VIDEO_VIRTIO_DEVICE_DEFAULT] = { .virtio = false, .virtioBusSuffix = false }, + [VIR_DOMAIN_VIDEO_VIRTIO_DEVICE_VGA] = { .virtio = true, .virtioBusSuffix = false }, + [VIR_DOMAIN_VIDEO_VIRTIO_DEVICE_GPU] = { .virtio = true, .virtioBusSuffix = true }, + [VIR_DOMAIN_VIDEO_VIRTIO_DEVICE_VGA_GL] = { .virtio = true, .virtioBusSuffix = false }, + [VIR_DOMAIN_VIDEO_VIRTIO_DEVICE_GPU_GL] = { .virtio = true, .virtioBusSuffix = true }, + [VIR_DOMAIN_VIDEO_VIRTIO_DEVICE_VHOST_USER_VGA] = { .virtio = false, .virtioBusSuffix = false }, + [VIR_DOMAIN_VIDEO_VIRTIO_DEVICE_VHOST_USER_GPU] = { .virtio = true, .virtioBusSuffix = true }, +}; +G_STATIC_ASSERT(G_N_ELEMENTS(qemuDeviceVideoGetModelVirtioOptsTable) == VIR_DOMAIN_VIDEO_VIRTIO_DEVICE_LAST); + + /** * qemuDeviceVideoGetModel: - * @qemuCaps: qemu capabilities * @video: video device definition * @virtio: the returned video device is a 'virtio' device * @virtioBusSuffix: the returned device needs to get the bus-suffix @@ -714,37 +730,23 @@ qemuBuildDeviceAddressProps(virJSONValue *props, * @virtioBusSuffix are filled with the corresponding flags. */ static const char * -qemuDeviceVideoGetModel(virQEMUCaps *qemuCaps, - const virDomainVideoDef *video, +qemuDeviceVideoGetModel(const virDomainVideoDef *video, bool *virtio, bool *virtioBusSuffix) { - bool primaryVga = false; - virTristateBool accel3d = VIR_TRISTATE_BOOL_ABSENT; - *virtio = false; *virtioBusSuffix = false; - if (video->accel) - accel3d = video->accel->accel3d; + if (video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO) { + struct qemuDeviceVideoModelVirtioOpts *opts = &qemuDeviceVideoGetModelVirtioOptsTable[video->virtiodevice]; - if (video->primary && qemuDomainSupportsVideoVga(video, qemuCaps)) - primaryVga = true; + *virtio = opts->virtio; + *virtioBusSuffix = opts->virtioBusSuffix; - if (video->backend == VIR_DOMAIN_VIDEO_BACKEND_TYPE_VHOSTUSER) { - if (primaryVga) - return "vhost-user-vga"; - - *virtio = true; - *virtioBusSuffix = true; - return "vhost-user-gpu"; + return virDomainVideoVirtioDeviceTypeToString(video->virtiodevice); } - /* We try to chose the best model for primary video device by preferring - * model with VGA compatibility mode. For some video devices on some - * architectures there might not be such model so fallback to one - * without VGA compatibility mode. */ - if (primaryVga) { + if (video->primary) { switch ((virDomainVideoType) video->type) { case VIR_DOMAIN_VIDEO_TYPE_VGA: return "VGA"; @@ -758,22 +760,12 @@ qemuDeviceVideoGetModel(virQEMUCaps *qemuCaps, case VIR_DOMAIN_VIDEO_TYPE_QXL: return "qxl-vga"; - case VIR_DOMAIN_VIDEO_TYPE_VIRTIO: - *virtio = true; - *virtioBusSuffix = false; - - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_VGA_GL) && - accel3d == VIR_TRISTATE_BOOL_YES) - return "virtio-vga-gl"; - - return "virtio-vga"; - case VIR_DOMAIN_VIDEO_TYPE_BOCHS: return "bochs-display"; case VIR_DOMAIN_VIDEO_TYPE_RAMFB: return "ramfb"; - + case VIR_DOMAIN_VIDEO_TYPE_VIRTIO: case VIR_DOMAIN_VIDEO_TYPE_DEFAULT: case VIR_DOMAIN_VIDEO_TYPE_XEN: case VIR_DOMAIN_VIDEO_TYPE_VBOX: @@ -789,15 +781,6 @@ qemuDeviceVideoGetModel(virQEMUCaps *qemuCaps, return "qxl"; case VIR_DOMAIN_VIDEO_TYPE_VIRTIO: - *virtio = true; - *virtioBusSuffix = true; - - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_GPU_GL_PCI) && - accel3d == VIR_TRISTATE_BOOL_YES) - return "virtio-gpu-gl"; - - return "virtio-gpu"; - case VIR_DOMAIN_VIDEO_TYPE_DEFAULT: case VIR_DOMAIN_VIDEO_TYPE_VGA: case VIR_DOMAIN_VIDEO_TYPE_CIRRUS: @@ -823,7 +806,6 @@ qemuDeviceVideoGetModel(virQEMUCaps *qemuCaps, static void qemuBuildVirtioDevGetConfigDev(const virDomainDeviceDef *device, - virQEMUCaps *qemuCaps, const char **baseName, virDomainVirtioOptions **virtioOptions, bool *has_tmodel, @@ -948,8 +930,7 @@ qemuBuildVirtioDevGetConfigDev(const virDomainDeviceDef *device, bool virtio; bool virtioBusSuffix; - if (!(*baseName = qemuDeviceVideoGetModel(qemuCaps, - device->data.video, + if (!(*baseName = qemuDeviceVideoGetModel(device->data.video, &virtio, &virtioBusSuffix))) return; @@ -1028,7 +1009,7 @@ qemuBuildVirtioDevGetConfig(const virDomainDeviceDef *device, bool has_ntmodel = false; bool useBusSuffix = true; - qemuBuildVirtioDevGetConfigDev(device, qemuCaps, &baseName, + qemuBuildVirtioDevGetConfigDev(device, &baseName, virtioOptions, &has_tmodel, &has_ntmodel, &useBusSuffix); @@ -4610,7 +4591,7 @@ qemuBuildDeviceVideoCmd(virCommand *cmd, g_autoptr(virJSONValue) props = NULL; unsigned int max_outputs = 0; - if (!(model = qemuDeviceVideoGetModel(qemuCaps, video, &virtio, &virtioBusSuffix))) + if (!(model = qemuDeviceVideoGetModel(video, &virtio, &virtioBusSuffix))) return -1; if (virtio) { diff --git a/tests/qemuxmlconfdata/video-virtio-vga-device-downgrade.x86_64-latest.args b/tests/qemuxmlconfdata/video-virtio-vga-device-downgrade.x86_64-latest.args index 74b64b3c91..34d0ab7ce1 100644 --- a/tests/qemuxmlconfdata/video-virtio-vga-device-downgrade.x86_64-latest.args +++ b/tests/qemuxmlconfdata/video-virtio-vga-device-downgrade.x86_64-latest.args @@ -31,7 +31,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"direct":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1,"write-cache":"on"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ --device '{"driver":"virtio-vga","id":"video0","max_outputs":1,"bus":"pci.0","addr":"0x2"}' \ +-device '{"driver":"virtio-gpu-pci","id":"video0","max_outputs":1,"bus":"pci.0","addr":"0x2"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x3"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_VGA_GL-disabled-ABI_UPDATE.args b/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_VGA_GL-disabled-ABI_UPDATE.args index c84e9ee9a2..1171a862d7 100644 --- a/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_VGA_GL-disabled-ABI_UPDATE.args +++ b/tests/qemuxmlconfdata/video-virtio-vga-gpu-gl.x86_64-latest.QEMU_CAPS_VIRTIO_VGA_GL-disabled-ABI_UPDATE.args @@ -28,7 +28,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -boot strict=on \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ --device '{"driver":"virtio-vga","id":"video0","max_outputs":1,"bus":"pci.0","addr":"0x2"}' \ +-device '{"driver":"virtio-gpu-gl-pci","id":"video0","max_outputs":1,"bus":"pci.0","addr":"0x2"}' \ -device '{"driver":"virtio-gpu-gl-pci","id":"video1","max_outputs":1,"bus":"pci.0","addr":"0x4"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x3"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -- 2.54.0
From: Peter Krempa <pkrempa@redhat.com> 'qemuValidateDomainDeviceDefVideo' ensures that only the correct video device models are selected as well as that only QXL and VIRTIO video devices can be selected as secondary. Remove unnecessary checks and simplify the code. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/qemu/qemu_command.c | 94 ++++++++++++++++++----------------------- 1 file changed, 40 insertions(+), 54 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index c6d3c9ce16..e726dc661c 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -737,7 +737,32 @@ qemuDeviceVideoGetModel(const virDomainVideoDef *video, *virtio = false; *virtioBusSuffix = false; - if (video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO) { + /* 'qemuValidateDomainDeviceDefVideo' ensures that only supported models + * are used as well as that only 'QXL' and 'virtio' graphics can be + * secondary */ + switch ((virDomainVideoType) video->type) { + case VIR_DOMAIN_VIDEO_TYPE_VGA: + return "VGA"; + + case VIR_DOMAIN_VIDEO_TYPE_CIRRUS: + return "cirrus-vga"; + + case VIR_DOMAIN_VIDEO_TYPE_VMVGA: + return "vmware-svga"; + + case VIR_DOMAIN_VIDEO_TYPE_QXL: + if (video->primary) + return "qxl-vga"; + + return "qxl"; + + case VIR_DOMAIN_VIDEO_TYPE_BOCHS: + return "bochs-display"; + + case VIR_DOMAIN_VIDEO_TYPE_RAMFB: + return "ramfb"; + + case VIR_DOMAIN_VIDEO_TYPE_VIRTIO: { struct qemuDeviceVideoModelVirtioOpts *opts = &qemuDeviceVideoGetModelVirtioOptsTable[video->virtiodevice]; *virtio = opts->virtio; @@ -746,61 +771,22 @@ qemuDeviceVideoGetModel(const virDomainVideoDef *video, return virDomainVideoVirtioDeviceTypeToString(video->virtiodevice); } - if (video->primary) { - switch ((virDomainVideoType) video->type) { - case VIR_DOMAIN_VIDEO_TYPE_VGA: - return "VGA"; - - case VIR_DOMAIN_VIDEO_TYPE_CIRRUS: - return "cirrus-vga"; - - case VIR_DOMAIN_VIDEO_TYPE_VMVGA: - return "vmware-svga"; - - case VIR_DOMAIN_VIDEO_TYPE_QXL: - return "qxl-vga"; + case VIR_DOMAIN_VIDEO_TYPE_DEFAULT: + case VIR_DOMAIN_VIDEO_TYPE_XEN: + case VIR_DOMAIN_VIDEO_TYPE_VBOX: + case VIR_DOMAIN_VIDEO_TYPE_PARALLELS: + case VIR_DOMAIN_VIDEO_TYPE_GOP: + case VIR_DOMAIN_VIDEO_TYPE_NONE: + virReportError(VIR_ERR_INTERNAL_ERROR, + _("invalid model for video type '%1$s'"), + virDomainVideoTypeToString(video->type)); + return NULL; - case VIR_DOMAIN_VIDEO_TYPE_BOCHS: - return "bochs-display"; - - case VIR_DOMAIN_VIDEO_TYPE_RAMFB: - return "ramfb"; - case VIR_DOMAIN_VIDEO_TYPE_VIRTIO: - case VIR_DOMAIN_VIDEO_TYPE_DEFAULT: - case VIR_DOMAIN_VIDEO_TYPE_XEN: - case VIR_DOMAIN_VIDEO_TYPE_VBOX: - case VIR_DOMAIN_VIDEO_TYPE_PARALLELS: - case VIR_DOMAIN_VIDEO_TYPE_GOP: - case VIR_DOMAIN_VIDEO_TYPE_NONE: - case VIR_DOMAIN_VIDEO_TYPE_LAST: - break; - } - } else { - switch ((virDomainVideoType) video->type) { - case VIR_DOMAIN_VIDEO_TYPE_QXL: - return "qxl"; - - case VIR_DOMAIN_VIDEO_TYPE_VIRTIO: - case VIR_DOMAIN_VIDEO_TYPE_DEFAULT: - case VIR_DOMAIN_VIDEO_TYPE_VGA: - case VIR_DOMAIN_VIDEO_TYPE_CIRRUS: - case VIR_DOMAIN_VIDEO_TYPE_VMVGA: - case VIR_DOMAIN_VIDEO_TYPE_XEN: - case VIR_DOMAIN_VIDEO_TYPE_VBOX: - case VIR_DOMAIN_VIDEO_TYPE_PARALLELS: - case VIR_DOMAIN_VIDEO_TYPE_GOP: - case VIR_DOMAIN_VIDEO_TYPE_NONE: - case VIR_DOMAIN_VIDEO_TYPE_BOCHS: - case VIR_DOMAIN_VIDEO_TYPE_RAMFB: - case VIR_DOMAIN_VIDEO_TYPE_LAST: - break; - } + case VIR_DOMAIN_VIDEO_TYPE_LAST: + default: + virReportEnumRangeError(virDomainVideoType, video->type); + return NULL; } - - virReportError(VIR_ERR_INTERNAL_ERROR, - _("invalid model for video type '%1$s'"), - virDomainVideoTypeToString(video->type)); - return NULL; } -- 2.54.0
From: Peter Krempa <pkrempa@redhat.com> The function is unused remove it. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/qemu/qemu_domain.c | 17 ----------------- src/qemu/qemu_domain.h | 3 --- 2 files changed, 20 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index e87ea8bdc0..a43a5c0e4f 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -9272,23 +9272,6 @@ qemuDomainVcpuPersistOrder(virDomainDef *def) } -bool -qemuDomainSupportsVideoVga(const virDomainVideoDef *video, - virQEMUCaps *qemuCaps) -{ - if (video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO) { - if (video->backend == VIR_DOMAIN_VIDEO_BACKEND_TYPE_VHOSTUSER) { - if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VHOST_USER_VGA)) - return false; - } else if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_VGA)) { - return false; - } - } - - return true; -} - - /** * qemuDomainNeedsVFIO: * @def: domain definition to check diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index f1654d8a19..50ab492023 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -980,9 +980,6 @@ bool qemuDomainVcpuHotplugIsInOrder(virDomainDef *def) void qemuDomainVcpuPersistOrder(virDomainDef *def) ATTRIBUTE_NONNULL(1); -bool qemuDomainSupportsVideoVga(const virDomainVideoDef *video, - virQEMUCaps *qemuCaps); - bool qemuDomainNeedsVFIO(const virDomainDef *def); int qemuDomainGetHostdevPath(virDomainHostdevDef *dev, -- 2.54.0
participants (1)
-
Peter Krempa