[PATCH V2 0/3] domain capabilites improvements

A V2 of https://listman.redhat.com/archives/libvir-list/2022-September/234189.html Although not much has changed beyond a rebase to current master Jim Fehlig (3): conf: Add USB redirect devices to domain capabilities conf: Add channel devices to domain capabilities qemu: Use command line to properly check for spice support docs/formatdomaincaps.rst | 46 +++++++++++++++++++ src/conf/domain_capabilities.c | 26 +++++++++++ src/conf/domain_capabilities.h | 16 +++++++ src/conf/schemas/domaincaps.rng | 20 ++++++++ src/qemu/qemu_capabilities.c | 35 +++++++++++++- src/qemu/qemu_capabilities.h | 6 +++ .../domaincapsdata/qemu_4.2.0-q35.x86_64.xml | 12 +++++ .../domaincapsdata/qemu_4.2.0-tcg.x86_64.xml | 12 +++++ .../qemu_4.2.0-virt.aarch64.xml | 7 +++ tests/domaincapsdata/qemu_4.2.0.aarch64.xml | 7 +++ tests/domaincapsdata/qemu_4.2.0.ppc64.xml | 7 +++ tests/domaincapsdata/qemu_4.2.0.s390x.xml | 11 +++++ tests/domaincapsdata/qemu_4.2.0.x86_64.xml | 12 +++++ .../domaincapsdata/qemu_5.0.0-q35.x86_64.xml | 12 +++++ .../domaincapsdata/qemu_5.0.0-tcg.x86_64.xml | 12 +++++ .../qemu_5.0.0-virt.aarch64.xml | 7 +++ tests/domaincapsdata/qemu_5.0.0.aarch64.xml | 7 +++ tests/domaincapsdata/qemu_5.0.0.ppc64.xml | 7 +++ tests/domaincapsdata/qemu_5.0.0.x86_64.xml | 12 +++++ .../domaincapsdata/qemu_5.1.0-q35.x86_64.xml | 12 +++++ .../domaincapsdata/qemu_5.1.0-tcg.x86_64.xml | 12 +++++ tests/domaincapsdata/qemu_5.1.0.sparc.xml | 12 +++++ tests/domaincapsdata/qemu_5.1.0.x86_64.xml | 12 +++++ .../domaincapsdata/qemu_5.2.0-q35.x86_64.xml | 12 +++++ .../domaincapsdata/qemu_5.2.0-tcg.x86_64.xml | 12 +++++ .../qemu_5.2.0-virt.aarch64.xml | 7 +++ tests/domaincapsdata/qemu_5.2.0.aarch64.xml | 7 +++ tests/domaincapsdata/qemu_5.2.0.ppc64.xml | 7 +++ tests/domaincapsdata/qemu_5.2.0.s390x.xml | 11 +++++ tests/domaincapsdata/qemu_5.2.0.x86_64.xml | 12 +++++ .../domaincapsdata/qemu_6.0.0-q35.x86_64.xml | 12 +++++ .../domaincapsdata/qemu_6.0.0-tcg.x86_64.xml | 12 +++++ .../qemu_6.0.0-virt.aarch64.xml | 7 +++ tests/domaincapsdata/qemu_6.0.0.aarch64.xml | 7 +++ tests/domaincapsdata/qemu_6.0.0.s390x.xml | 11 +++++ tests/domaincapsdata/qemu_6.0.0.x86_64.xml | 12 +++++ .../domaincapsdata/qemu_6.1.0-q35.x86_64.xml | 12 +++++ .../domaincapsdata/qemu_6.1.0-tcg.x86_64.xml | 12 +++++ tests/domaincapsdata/qemu_6.1.0.x86_64.xml | 12 +++++ .../domaincapsdata/qemu_6.2.0-q35.x86_64.xml | 12 +++++ .../domaincapsdata/qemu_6.2.0-tcg.x86_64.xml | 12 +++++ .../qemu_6.2.0-virt.aarch64.xml | 12 +++++ tests/domaincapsdata/qemu_6.2.0.aarch64.xml | 12 +++++ tests/domaincapsdata/qemu_6.2.0.ppc64.xml | 7 +++ tests/domaincapsdata/qemu_6.2.0.x86_64.xml | 12 +++++ .../domaincapsdata/qemu_7.0.0-q35.x86_64.xml | 12 +++++ .../domaincapsdata/qemu_7.0.0-tcg.x86_64.xml | 12 +++++ .../qemu_7.0.0-virt.aarch64.xml | 12 +++++ tests/domaincapsdata/qemu_7.0.0.aarch64.xml | 12 +++++ tests/domaincapsdata/qemu_7.0.0.ppc64.xml | 11 +++++ tests/domaincapsdata/qemu_7.0.0.x86_64.xml | 12 +++++ .../domaincapsdata/qemu_7.1.0-q35.x86_64.xml | 12 +++++ .../domaincapsdata/qemu_7.1.0-tcg.x86_64.xml | 12 +++++ tests/domaincapsdata/qemu_7.1.0.x86_64.xml | 12 +++++ .../caps_4.2.0.x86_64.xml | 1 + .../caps_5.0.0.riscv64.xml | 1 + .../caps_5.0.0.x86_64.xml | 1 + .../qemucapabilitiesdata/caps_5.1.0.sparc.xml | 1 + .../caps_5.1.0.x86_64.xml | 1 + .../caps_5.2.0.riscv64.xml | 1 + .../caps_5.2.0.x86_64.xml | 1 + .../caps_6.0.0.x86_64.xml | 1 + .../caps_6.1.0.x86_64.xml | 1 + .../caps_6.2.0.aarch64.xml | 1 + .../caps_6.2.0.x86_64.xml | 1 + .../caps_7.0.0.aarch64.xml | 1 + .../caps_7.0.0.x86_64.xml | 1 + .../caps_7.1.0.x86_64.xml | 1 + 68 files changed, 674 insertions(+), 1 deletion(-) -- 2.37.3

As qemu becomes more modularized, it is important for libvirt to advertise availability of the modularized functionality through capabilities. This change adds USB redirect devices to domain capabilities, allowing clients such as virt-install to avoid using redirdev devices when not supported by the target qemu. Signed-off-by: Jim Fehlig <jfehlig@suse.com> --- docs/formatdomaincaps.rst | 22 +++++++++++++++++++ src/conf/domain_capabilities.c | 13 +++++++++++ src/conf/domain_capabilities.h | 8 +++++++ src/conf/schemas/domaincaps.rng | 10 +++++++++ src/qemu/qemu_capabilities.c | 17 ++++++++++++++ src/qemu/qemu_capabilities.h | 3 +++ .../domaincapsdata/qemu_4.2.0-q35.x86_64.xml | 5 +++++ .../domaincapsdata/qemu_4.2.0-tcg.x86_64.xml | 5 +++++ .../qemu_4.2.0-virt.aarch64.xml | 1 + tests/domaincapsdata/qemu_4.2.0.aarch64.xml | 1 + tests/domaincapsdata/qemu_4.2.0.ppc64.xml | 1 + tests/domaincapsdata/qemu_4.2.0.s390x.xml | 5 +++++ tests/domaincapsdata/qemu_4.2.0.x86_64.xml | 5 +++++ .../domaincapsdata/qemu_5.0.0-q35.x86_64.xml | 5 +++++ .../domaincapsdata/qemu_5.0.0-tcg.x86_64.xml | 5 +++++ .../qemu_5.0.0-virt.aarch64.xml | 1 + tests/domaincapsdata/qemu_5.0.0.aarch64.xml | 1 + tests/domaincapsdata/qemu_5.0.0.ppc64.xml | 1 + tests/domaincapsdata/qemu_5.0.0.x86_64.xml | 5 +++++ .../domaincapsdata/qemu_5.1.0-q35.x86_64.xml | 5 +++++ .../domaincapsdata/qemu_5.1.0-tcg.x86_64.xml | 5 +++++ tests/domaincapsdata/qemu_5.1.0.sparc.xml | 5 +++++ tests/domaincapsdata/qemu_5.1.0.x86_64.xml | 5 +++++ .../domaincapsdata/qemu_5.2.0-q35.x86_64.xml | 5 +++++ .../domaincapsdata/qemu_5.2.0-tcg.x86_64.xml | 5 +++++ .../qemu_5.2.0-virt.aarch64.xml | 1 + tests/domaincapsdata/qemu_5.2.0.aarch64.xml | 1 + tests/domaincapsdata/qemu_5.2.0.ppc64.xml | 1 + tests/domaincapsdata/qemu_5.2.0.s390x.xml | 5 +++++ tests/domaincapsdata/qemu_5.2.0.x86_64.xml | 5 +++++ .../domaincapsdata/qemu_6.0.0-q35.x86_64.xml | 5 +++++ .../domaincapsdata/qemu_6.0.0-tcg.x86_64.xml | 5 +++++ .../qemu_6.0.0-virt.aarch64.xml | 1 + tests/domaincapsdata/qemu_6.0.0.aarch64.xml | 1 + tests/domaincapsdata/qemu_6.0.0.s390x.xml | 5 +++++ tests/domaincapsdata/qemu_6.0.0.x86_64.xml | 5 +++++ .../domaincapsdata/qemu_6.1.0-q35.x86_64.xml | 5 +++++ .../domaincapsdata/qemu_6.1.0-tcg.x86_64.xml | 5 +++++ tests/domaincapsdata/qemu_6.1.0.x86_64.xml | 5 +++++ .../domaincapsdata/qemu_6.2.0-q35.x86_64.xml | 5 +++++ .../domaincapsdata/qemu_6.2.0-tcg.x86_64.xml | 5 +++++ .../qemu_6.2.0-virt.aarch64.xml | 5 +++++ tests/domaincapsdata/qemu_6.2.0.aarch64.xml | 5 +++++ tests/domaincapsdata/qemu_6.2.0.ppc64.xml | 1 + tests/domaincapsdata/qemu_6.2.0.x86_64.xml | 5 +++++ .../domaincapsdata/qemu_7.0.0-q35.x86_64.xml | 5 +++++ .../domaincapsdata/qemu_7.0.0-tcg.x86_64.xml | 5 +++++ .../qemu_7.0.0-virt.aarch64.xml | 5 +++++ tests/domaincapsdata/qemu_7.0.0.aarch64.xml | 5 +++++ tests/domaincapsdata/qemu_7.0.0.ppc64.xml | 5 +++++ tests/domaincapsdata/qemu_7.0.0.x86_64.xml | 5 +++++ .../domaincapsdata/qemu_7.1.0-q35.x86_64.xml | 5 +++++ .../domaincapsdata/qemu_7.1.0-tcg.x86_64.xml | 5 +++++ tests/domaincapsdata/qemu_7.1.0.x86_64.xml | 5 +++++ 54 files changed, 265 insertions(+) diff --git a/docs/formatdomaincaps.rst b/docs/formatdomaincaps.rst index afade16bc0..93d36f2702 100644 --- a/docs/formatdomaincaps.rst +++ b/docs/formatdomaincaps.rst @@ -543,6 +543,28 @@ TPM device capabilities are exposed under the ``tpm`` element. For instance: ``backendVersion`` Options for the ``version`` attribute of the ``<tpm><backend/>`` element. +USB redirect device +^^^^^^^^^^^^^^^^^^^ + +USB redirdev device capabilities are exposed under the ``redirdev`` element. For instance: + +:: + + <domainCapabilities> + ... + <devices> + <redirdev supported='yes'> + <enum name='bus'> + <value>usb</value> + </enum> + </redirdev> + ... + </devices> + </domainCapabilities> + +``bus`` + Options for the ``bus`` attribute of the ``<redirdev/>`` element. + Features ~~~~~~~~ diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index b5d8288982..f8b2f88376 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -562,6 +562,18 @@ virDomainCapsDeviceFilesystemFormat(virBuffer *buf, } +static void +virDomainCapsDeviceRedirdevFormat(virBuffer *buf, + const virDomainCapsDeviceRedirdev *redirdev) +{ + FORMAT_PROLOGUE(redirdev); + + ENUM_PROCESS(redirdev, bus, virDomainRedirdevBusTypeToString); + + FORMAT_EPILOGUE(redirdev); +} + + /** * virDomainCapsFeatureGICFormat: * @buf: target buffer @@ -675,6 +687,7 @@ virDomainCapsFormat(const virDomainCaps *caps) virDomainCapsDeviceRNGFormat(&buf, &caps->rng); virDomainCapsDeviceFilesystemFormat(&buf, &caps->filesystem); virDomainCapsDeviceTPMFormat(&buf, &caps->tpm); + virDomainCapsDeviceRedirdevFormat(&buf, &caps->redirdev); virBufferAdjustIndent(&buf, -2); virBufferAddLit(&buf, "</devices>\n"); diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h index f5fa1fb8e3..ba7c2a5e42 100644 --- a/src/conf/domain_capabilities.h +++ b/src/conf/domain_capabilities.h @@ -130,6 +130,13 @@ struct _virDomainCapsDeviceTPM { virDomainCapsEnum backendVersion; /* virDomainTPMVersion */ }; +STATIC_ASSERT_ENUM(VIR_DOMAIN_REDIRDEV_BUS_LAST); +typedef struct _virDomainCapsDeviceRedirdev virDomainCapsDeviceRedirdev; +struct _virDomainCapsDeviceRedirdev { + virTristateBool supported; + virDomainCapsEnum bus; /* virDomainRedirdevBus */ +}; + STATIC_ASSERT_ENUM(VIR_DOMAIN_FS_DRIVER_TYPE_LAST); typedef struct _virDomainCapsDeviceFilesystem virDomainCapsDeviceFilesystem; struct _virDomainCapsDeviceFilesystem { @@ -226,6 +233,7 @@ struct _virDomainCaps { virDomainCapsDeviceRNG rng; virDomainCapsDeviceFilesystem filesystem; virDomainCapsDeviceTPM tpm; + virDomainCapsDeviceRedirdev redirdev; /* add new domain devices here */ virDomainCapsFeatureGIC gic; diff --git a/src/conf/schemas/domaincaps.rng b/src/conf/schemas/domaincaps.rng index c4cb9afeba..cf7a1d1d89 100644 --- a/src/conf/schemas/domaincaps.rng +++ b/src/conf/schemas/domaincaps.rng @@ -198,6 +198,9 @@ <optional> <ref name="tpm"/> </optional> + <optional> + <ref name="redirdev"/> + </optional> </element> </define> @@ -250,6 +253,13 @@ </element> </define> + <define name="redirdev"> + <element name="redirdev"> + <ref name="supported"/> + <ref name="enum"/> + </element> + </define> + <define name="features"> <element name="features"> <optional> diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 04b2eef215..5a664ec628 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -6333,6 +6333,21 @@ virQEMUCapsFillDomainDeviceTPMCaps(virQEMUCaps *qemuCaps, } +void +virQEMUCapsFillDomainDeviceRedirdevCaps(virQEMUCaps *qemuCaps, + virDomainCapsDeviceRedirdev *redirdev) +{ + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_USB_REDIR)) { + redirdev->supported = VIR_TRISTATE_BOOL_YES; + redirdev->bus.report = true; + VIR_DOMAIN_CAPS_ENUM_SET(redirdev->bus, VIR_DOMAIN_REDIRDEV_BUS_USB); + } else { + redirdev->supported = VIR_TRISTATE_BOOL_NO; + } +} + + + /** * virQEMUCapsSupportsGICVersion: * @qemuCaps: QEMU capabilities @@ -6468,6 +6483,7 @@ virQEMUCapsFillDomainCaps(virQEMUCaps *qemuCaps, virDomainCapsDeviceRNG *rng = &domCaps->rng; virDomainCapsDeviceFilesystem *filesystem = &domCaps->filesystem; virDomainCapsDeviceTPM *tpm = &domCaps->tpm; + virDomainCapsDeviceRedirdev *redirdev = &domCaps->redirdev; virDomainCapsMemoryBacking *memoryBacking = &domCaps->memoryBacking; virQEMUCapsFillDomainFeaturesFromQEMUCaps(qemuCaps, domCaps); @@ -6500,6 +6516,7 @@ virQEMUCapsFillDomainCaps(virQEMUCaps *qemuCaps, virQEMUCapsFillDomainDeviceRNGCaps(qemuCaps, rng); virQEMUCapsFillDomainDeviceFSCaps(qemuCaps, filesystem); virQEMUCapsFillDomainDeviceTPMCaps(qemuCaps, tpm); + virQEMUCapsFillDomainDeviceRedirdevCaps(qemuCaps, redirdev); virQEMUCapsFillDomainFeatureGICCaps(qemuCaps, domCaps); virQEMUCapsFillDomainFeatureSEVCaps(qemuCaps, domCaps); virQEMUCapsFillDomainFeatureS390PVCaps(qemuCaps, domCaps); diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 4b2782c462..051bfbc0a1 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -830,6 +830,9 @@ void virQEMUCapsFillDomainDeviceFSCaps(virQEMUCaps *qemuCaps, void virQEMUCapsFillDomainDeviceTPMCaps(virQEMUCaps *qemuCaps, virDomainCapsDeviceTPM *tpm); +void virQEMUCapsFillDomainDeviceRedirdevCaps(virQEMUCaps *qemuCaps, + virDomainCapsDeviceRedirdev *redirdev); + bool virQEMUCapsGuestIsNative(virArch host, virArch guest); diff --git a/tests/domaincapsdata/qemu_4.2.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_4.2.0-q35.x86_64.xml index dab12e5888..5b83883e39 100644 --- a/tests/domaincapsdata/qemu_4.2.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_4.2.0-q35.x86_64.xml @@ -216,6 +216,11 @@ <value>1.2</value> </enum> </tpm> + <redirdev supported='yes'> + <enum name='bus'> + <value>usb</value> + </enum> + </redirdev> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_4.2.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_4.2.0-tcg.x86_64.xml index 6dc6decf1e..ab55ec2452 100644 --- a/tests/domaincapsdata/qemu_4.2.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_4.2.0-tcg.x86_64.xml @@ -231,6 +231,11 @@ <value>1.2</value> </enum> </tpm> + <redirdev supported='yes'> + <enum name='bus'> + <value>usb</value> + </enum> + </redirdev> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_4.2.0-virt.aarch64.xml b/tests/domaincapsdata/qemu_4.2.0-virt.aarch64.xml index 51581c1816..e0af576d5c 100644 --- a/tests/domaincapsdata/qemu_4.2.0-virt.aarch64.xml +++ b/tests/domaincapsdata/qemu_4.2.0-virt.aarch64.xml @@ -165,6 +165,7 @@ </enum> </filesystem> <tpm supported='no'/> + <redirdev supported='no'/> </devices> <features> <gic supported='yes'> diff --git a/tests/domaincapsdata/qemu_4.2.0.aarch64.xml b/tests/domaincapsdata/qemu_4.2.0.aarch64.xml index c993e0e7d1..61839a1983 100644 --- a/tests/domaincapsdata/qemu_4.2.0.aarch64.xml +++ b/tests/domaincapsdata/qemu_4.2.0.aarch64.xml @@ -163,6 +163,7 @@ </enum> </filesystem> <tpm supported='no'/> + <redirdev supported='no'/> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_4.2.0.ppc64.xml b/tests/domaincapsdata/qemu_4.2.0.ppc64.xml index 7093c35355..1626d9b186 100644 --- a/tests/domaincapsdata/qemu_4.2.0.ppc64.xml +++ b/tests/domaincapsdata/qemu_4.2.0.ppc64.xml @@ -136,6 +136,7 @@ <value>1.2</value> </enum> </tpm> + <redirdev supported='no'/> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_4.2.0.s390x.xml b/tests/domaincapsdata/qemu_4.2.0.s390x.xml index 3187e637d3..ee07f4c274 100644 --- a/tests/domaincapsdata/qemu_4.2.0.s390x.xml +++ b/tests/domaincapsdata/qemu_4.2.0.s390x.xml @@ -238,6 +238,11 @@ </enum> </filesystem> <tpm supported='no'/> + <redirdev supported='yes'> + <enum name='bus'> + <value>usb</value> + </enum> + </redirdev> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_4.2.0.x86_64.xml b/tests/domaincapsdata/qemu_4.2.0.x86_64.xml index d9c12424c6..a6eaf7962f 100644 --- a/tests/domaincapsdata/qemu_4.2.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_4.2.0.x86_64.xml @@ -216,6 +216,11 @@ <value>1.2</value> </enum> </tpm> + <redirdev supported='yes'> + <enum name='bus'> + <value>usb</value> + </enum> + </redirdev> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_5.0.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_5.0.0-q35.x86_64.xml index 52c5d235bb..232f1f0e12 100644 --- a/tests/domaincapsdata/qemu_5.0.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_5.0.0-q35.x86_64.xml @@ -218,6 +218,11 @@ <value>1.2</value> </enum> </tpm> + <redirdev supported='yes'> + <enum name='bus'> + <value>usb</value> + </enum> + </redirdev> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_5.0.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_5.0.0-tcg.x86_64.xml index 8a0f20b06f..ce2c08f205 100644 --- a/tests/domaincapsdata/qemu_5.0.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_5.0.0-tcg.x86_64.xml @@ -233,6 +233,11 @@ <value>1.2</value> </enum> </tpm> + <redirdev supported='yes'> + <enum name='bus'> + <value>usb</value> + </enum> + </redirdev> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_5.0.0-virt.aarch64.xml b/tests/domaincapsdata/qemu_5.0.0-virt.aarch64.xml index 8fe15c0bcb..9215371d0c 100644 --- a/tests/domaincapsdata/qemu_5.0.0-virt.aarch64.xml +++ b/tests/domaincapsdata/qemu_5.0.0-virt.aarch64.xml @@ -177,6 +177,7 @@ <value>1.2</value> </enum> </tpm> + <redirdev supported='no'/> </devices> <features> <gic supported='yes'> diff --git a/tests/domaincapsdata/qemu_5.0.0.aarch64.xml b/tests/domaincapsdata/qemu_5.0.0.aarch64.xml index 49380bd218..fcc77ad8db 100644 --- a/tests/domaincapsdata/qemu_5.0.0.aarch64.xml +++ b/tests/domaincapsdata/qemu_5.0.0.aarch64.xml @@ -175,6 +175,7 @@ <value>1.2</value> </enum> </tpm> + <redirdev supported='no'/> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_5.0.0.ppc64.xml b/tests/domaincapsdata/qemu_5.0.0.ppc64.xml index b944723885..711ccc2cb0 100644 --- a/tests/domaincapsdata/qemu_5.0.0.ppc64.xml +++ b/tests/domaincapsdata/qemu_5.0.0.ppc64.xml @@ -142,6 +142,7 @@ <value>1.2</value> </enum> </tpm> + <redirdev supported='no'/> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_5.0.0.x86_64.xml b/tests/domaincapsdata/qemu_5.0.0.x86_64.xml index d9b7c31448..f52613f584 100644 --- a/tests/domaincapsdata/qemu_5.0.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_5.0.0.x86_64.xml @@ -218,6 +218,11 @@ <value>1.2</value> </enum> </tpm> + <redirdev supported='yes'> + <enum name='bus'> + <value>usb</value> + </enum> + </redirdev> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_5.1.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_5.1.0-q35.x86_64.xml index 0917fb3e94..542d32b018 100644 --- a/tests/domaincapsdata/qemu_5.1.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_5.1.0-q35.x86_64.xml @@ -219,6 +219,11 @@ <value>1.2</value> </enum> </tpm> + <redirdev supported='yes'> + <enum name='bus'> + <value>usb</value> + </enum> + </redirdev> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_5.1.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_5.1.0-tcg.x86_64.xml index b2dc0cecca..8bd5c6073c 100644 --- a/tests/domaincapsdata/qemu_5.1.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_5.1.0-tcg.x86_64.xml @@ -233,6 +233,11 @@ <value>1.2</value> </enum> </tpm> + <redirdev supported='yes'> + <enum name='bus'> + <value>usb</value> + </enum> + </redirdev> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_5.1.0.sparc.xml b/tests/domaincapsdata/qemu_5.1.0.sparc.xml index 5c1c0c4680..ea4d1d28dd 100644 --- a/tests/domaincapsdata/qemu_5.1.0.sparc.xml +++ b/tests/domaincapsdata/qemu_5.1.0.sparc.xml @@ -105,6 +105,11 @@ </enum> </filesystem> <tpm supported='no'/> + <redirdev supported='yes'> + <enum name='bus'> + <value>usb</value> + </enum> + </redirdev> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_5.1.0.x86_64.xml b/tests/domaincapsdata/qemu_5.1.0.x86_64.xml index abddcd6e62..5c48efc8c6 100644 --- a/tests/domaincapsdata/qemu_5.1.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_5.1.0.x86_64.xml @@ -219,6 +219,11 @@ <value>1.2</value> </enum> </tpm> + <redirdev supported='yes'> + <enum name='bus'> + <value>usb</value> + </enum> + </redirdev> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_5.2.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_5.2.0-q35.x86_64.xml index f441139af2..70c4f3cbd1 100644 --- a/tests/domaincapsdata/qemu_5.2.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_5.2.0-q35.x86_64.xml @@ -219,6 +219,11 @@ <value>1.2</value> </enum> </tpm> + <redirdev supported='yes'> + <enum name='bus'> + <value>usb</value> + </enum> + </redirdev> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_5.2.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_5.2.0-tcg.x86_64.xml index 690fba9fc2..636a84e55f 100644 --- a/tests/domaincapsdata/qemu_5.2.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_5.2.0-tcg.x86_64.xml @@ -233,6 +233,11 @@ <value>1.2</value> </enum> </tpm> + <redirdev supported='yes'> + <enum name='bus'> + <value>usb</value> + </enum> + </redirdev> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_5.2.0-virt.aarch64.xml b/tests/domaincapsdata/qemu_5.2.0-virt.aarch64.xml index a6363b0aad..900d10f720 100644 --- a/tests/domaincapsdata/qemu_5.2.0-virt.aarch64.xml +++ b/tests/domaincapsdata/qemu_5.2.0-virt.aarch64.xml @@ -177,6 +177,7 @@ <value>1.2</value> </enum> </tpm> + <redirdev supported='no'/> </devices> <features> <gic supported='yes'> diff --git a/tests/domaincapsdata/qemu_5.2.0.aarch64.xml b/tests/domaincapsdata/qemu_5.2.0.aarch64.xml index 49380bd218..fcc77ad8db 100644 --- a/tests/domaincapsdata/qemu_5.2.0.aarch64.xml +++ b/tests/domaincapsdata/qemu_5.2.0.aarch64.xml @@ -175,6 +175,7 @@ <value>1.2</value> </enum> </tpm> + <redirdev supported='no'/> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_5.2.0.ppc64.xml b/tests/domaincapsdata/qemu_5.2.0.ppc64.xml index 71f47c8748..99c2767276 100644 --- a/tests/domaincapsdata/qemu_5.2.0.ppc64.xml +++ b/tests/domaincapsdata/qemu_5.2.0.ppc64.xml @@ -142,6 +142,7 @@ <value>1.2</value> </enum> </tpm> + <redirdev supported='no'/> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_5.2.0.s390x.xml b/tests/domaincapsdata/qemu_5.2.0.s390x.xml index 84820332e4..bdade9c5bb 100644 --- a/tests/domaincapsdata/qemu_5.2.0.s390x.xml +++ b/tests/domaincapsdata/qemu_5.2.0.s390x.xml @@ -240,6 +240,11 @@ </enum> </filesystem> <tpm supported='no'/> + <redirdev supported='yes'> + <enum name='bus'> + <value>usb</value> + </enum> + </redirdev> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_5.2.0.x86_64.xml b/tests/domaincapsdata/qemu_5.2.0.x86_64.xml index 27a3af5ba0..db22085e31 100644 --- a/tests/domaincapsdata/qemu_5.2.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_5.2.0.x86_64.xml @@ -219,6 +219,11 @@ <value>1.2</value> </enum> </tpm> + <redirdev supported='yes'> + <enum name='bus'> + <value>usb</value> + </enum> + </redirdev> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_6.0.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_6.0.0-q35.x86_64.xml index 56f2ee8b15..395eb3b9eb 100644 --- a/tests/domaincapsdata/qemu_6.0.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_6.0.0-q35.x86_64.xml @@ -221,6 +221,11 @@ <value>2.0</value> </enum> </tpm> + <redirdev supported='yes'> + <enum name='bus'> + <value>usb</value> + </enum> + </redirdev> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_6.0.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_6.0.0-tcg.x86_64.xml index dab11a82d6..769a1147b6 100644 --- a/tests/domaincapsdata/qemu_6.0.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_6.0.0-tcg.x86_64.xml @@ -235,6 +235,11 @@ <value>2.0</value> </enum> </tpm> + <redirdev supported='yes'> + <enum name='bus'> + <value>usb</value> + </enum> + </redirdev> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_6.0.0-virt.aarch64.xml b/tests/domaincapsdata/qemu_6.0.0-virt.aarch64.xml index 68f3a523f4..2f56e36c28 100644 --- a/tests/domaincapsdata/qemu_6.0.0-virt.aarch64.xml +++ b/tests/domaincapsdata/qemu_6.0.0-virt.aarch64.xml @@ -179,6 +179,7 @@ <value>2.0</value> </enum> </tpm> + <redirdev supported='no'/> </devices> <features> <gic supported='yes'> diff --git a/tests/domaincapsdata/qemu_6.0.0.aarch64.xml b/tests/domaincapsdata/qemu_6.0.0.aarch64.xml index c9830c3b25..4639a84c1d 100644 --- a/tests/domaincapsdata/qemu_6.0.0.aarch64.xml +++ b/tests/domaincapsdata/qemu_6.0.0.aarch64.xml @@ -177,6 +177,7 @@ <value>2.0</value> </enum> </tpm> + <redirdev supported='no'/> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_6.0.0.s390x.xml b/tests/domaincapsdata/qemu_6.0.0.s390x.xml index d0375c68ef..25abcac608 100644 --- a/tests/domaincapsdata/qemu_6.0.0.s390x.xml +++ b/tests/domaincapsdata/qemu_6.0.0.s390x.xml @@ -241,6 +241,11 @@ </enum> </filesystem> <tpm supported='no'/> + <redirdev supported='yes'> + <enum name='bus'> + <value>usb</value> + </enum> + </redirdev> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_6.0.0.x86_64.xml b/tests/domaincapsdata/qemu_6.0.0.x86_64.xml index 338a9a7494..2be8f3e33b 100644 --- a/tests/domaincapsdata/qemu_6.0.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_6.0.0.x86_64.xml @@ -221,6 +221,11 @@ <value>2.0</value> </enum> </tpm> + <redirdev supported='yes'> + <enum name='bus'> + <value>usb</value> + </enum> + </redirdev> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_6.1.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_6.1.0-q35.x86_64.xml index c023a72dec..f23e758b1a 100644 --- a/tests/domaincapsdata/qemu_6.1.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_6.1.0-q35.x86_64.xml @@ -222,6 +222,11 @@ <value>2.0</value> </enum> </tpm> + <redirdev supported='yes'> + <enum name='bus'> + <value>usb</value> + </enum> + </redirdev> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_6.1.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_6.1.0-tcg.x86_64.xml index 18da71d0a7..f78abdefc5 100644 --- a/tests/domaincapsdata/qemu_6.1.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_6.1.0-tcg.x86_64.xml @@ -235,6 +235,11 @@ <value>2.0</value> </enum> </tpm> + <redirdev supported='yes'> + <enum name='bus'> + <value>usb</value> + </enum> + </redirdev> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_6.1.0.x86_64.xml b/tests/domaincapsdata/qemu_6.1.0.x86_64.xml index de17a784f6..9de18c682e 100644 --- a/tests/domaincapsdata/qemu_6.1.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_6.1.0.x86_64.xml @@ -222,6 +222,11 @@ <value>2.0</value> </enum> </tpm> + <redirdev supported='yes'> + <enum name='bus'> + <value>usb</value> + </enum> + </redirdev> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_6.2.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_6.2.0-q35.x86_64.xml index f767ded170..dff92d65aa 100644 --- a/tests/domaincapsdata/qemu_6.2.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_6.2.0-q35.x86_64.xml @@ -222,6 +222,11 @@ <value>2.0</value> </enum> </tpm> + <redirdev supported='yes'> + <enum name='bus'> + <value>usb</value> + </enum> + </redirdev> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_6.2.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_6.2.0-tcg.x86_64.xml index 5122df5419..f027eb25a5 100644 --- a/tests/domaincapsdata/qemu_6.2.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_6.2.0-tcg.x86_64.xml @@ -236,6 +236,11 @@ <value>2.0</value> </enum> </tpm> + <redirdev supported='yes'> + <enum name='bus'> + <value>usb</value> + </enum> + </redirdev> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_6.2.0-virt.aarch64.xml b/tests/domaincapsdata/qemu_6.2.0-virt.aarch64.xml index c356fc21d4..c572b0481c 100644 --- a/tests/domaincapsdata/qemu_6.2.0-virt.aarch64.xml +++ b/tests/domaincapsdata/qemu_6.2.0-virt.aarch64.xml @@ -181,6 +181,11 @@ <value>2.0</value> </enum> </tpm> + <redirdev supported='yes'> + <enum name='bus'> + <value>usb</value> + </enum> + </redirdev> </devices> <features> <gic supported='yes'> diff --git a/tests/domaincapsdata/qemu_6.2.0.aarch64.xml b/tests/domaincapsdata/qemu_6.2.0.aarch64.xml index 9e817d15e4..eb521a0cfa 100644 --- a/tests/domaincapsdata/qemu_6.2.0.aarch64.xml +++ b/tests/domaincapsdata/qemu_6.2.0.aarch64.xml @@ -179,6 +179,11 @@ <value>2.0</value> </enum> </tpm> + <redirdev supported='yes'> + <enum name='bus'> + <value>usb</value> + </enum> + </redirdev> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_6.2.0.ppc64.xml b/tests/domaincapsdata/qemu_6.2.0.ppc64.xml index bf2c679c51..7797b94cf2 100644 --- a/tests/domaincapsdata/qemu_6.2.0.ppc64.xml +++ b/tests/domaincapsdata/qemu_6.2.0.ppc64.xml @@ -141,6 +141,7 @@ <value>2.0</value> </enum> </tpm> + <redirdev supported='no'/> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_6.2.0.x86_64.xml b/tests/domaincapsdata/qemu_6.2.0.x86_64.xml index bdce41d4db..aff2ee6662 100644 --- a/tests/domaincapsdata/qemu_6.2.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_6.2.0.x86_64.xml @@ -222,6 +222,11 @@ <value>2.0</value> </enum> </tpm> + <redirdev supported='yes'> + <enum name='bus'> + <value>usb</value> + </enum> + </redirdev> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_7.0.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_7.0.0-q35.x86_64.xml index e7850eafcf..e70b0990a7 100644 --- a/tests/domaincapsdata/qemu_7.0.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_7.0.0-q35.x86_64.xml @@ -223,6 +223,11 @@ <value>2.0</value> </enum> </tpm> + <redirdev supported='yes'> + <enum name='bus'> + <value>usb</value> + </enum> + </redirdev> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_7.0.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_7.0.0-tcg.x86_64.xml index 53b0de03e7..03c5411c4e 100644 --- a/tests/domaincapsdata/qemu_7.0.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_7.0.0-tcg.x86_64.xml @@ -237,6 +237,11 @@ <value>2.0</value> </enum> </tpm> + <redirdev supported='yes'> + <enum name='bus'> + <value>usb</value> + </enum> + </redirdev> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_7.0.0-virt.aarch64.xml b/tests/domaincapsdata/qemu_7.0.0-virt.aarch64.xml index 96c8fbfdf3..59f89afd9b 100644 --- a/tests/domaincapsdata/qemu_7.0.0-virt.aarch64.xml +++ b/tests/domaincapsdata/qemu_7.0.0-virt.aarch64.xml @@ -180,6 +180,11 @@ <value>2.0</value> </enum> </tpm> + <redirdev supported='yes'> + <enum name='bus'> + <value>usb</value> + </enum> + </redirdev> </devices> <features> <gic supported='yes'> diff --git a/tests/domaincapsdata/qemu_7.0.0.aarch64.xml b/tests/domaincapsdata/qemu_7.0.0.aarch64.xml index ce0a313bb9..1e6bf544dc 100644 --- a/tests/domaincapsdata/qemu_7.0.0.aarch64.xml +++ b/tests/domaincapsdata/qemu_7.0.0.aarch64.xml @@ -178,6 +178,11 @@ <value>2.0</value> </enum> </tpm> + <redirdev supported='yes'> + <enum name='bus'> + <value>usb</value> + </enum> + </redirdev> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_7.0.0.ppc64.xml b/tests/domaincapsdata/qemu_7.0.0.ppc64.xml index 8f6f9f57e1..76da1f4f7d 100644 --- a/tests/domaincapsdata/qemu_7.0.0.ppc64.xml +++ b/tests/domaincapsdata/qemu_7.0.0.ppc64.xml @@ -142,6 +142,11 @@ <value>2.0</value> </enum> </tpm> + <redirdev supported='yes'> + <enum name='bus'> + <value>usb</value> + </enum> + </redirdev> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_7.0.0.x86_64.xml b/tests/domaincapsdata/qemu_7.0.0.x86_64.xml index ccee94df7a..da23f5703a 100644 --- a/tests/domaincapsdata/qemu_7.0.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_7.0.0.x86_64.xml @@ -223,6 +223,11 @@ <value>2.0</value> </enum> </tpm> + <redirdev supported='yes'> + <enum name='bus'> + <value>usb</value> + </enum> + </redirdev> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_7.1.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_7.1.0-q35.x86_64.xml index 6e3df1e24b..05b36ee79e 100644 --- a/tests/domaincapsdata/qemu_7.1.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_7.1.0-q35.x86_64.xml @@ -222,6 +222,11 @@ <value>2.0</value> </enum> </tpm> + <redirdev supported='yes'> + <enum name='bus'> + <value>usb</value> + </enum> + </redirdev> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_7.1.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_7.1.0-tcg.x86_64.xml index 61aa269741..0786cd8430 100644 --- a/tests/domaincapsdata/qemu_7.1.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_7.1.0-tcg.x86_64.xml @@ -235,6 +235,11 @@ <value>2.0</value> </enum> </tpm> + <redirdev supported='yes'> + <enum name='bus'> + <value>usb</value> + </enum> + </redirdev> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_7.1.0.x86_64.xml b/tests/domaincapsdata/qemu_7.1.0.x86_64.xml index e1218e3f16..ae67a16947 100644 --- a/tests/domaincapsdata/qemu_7.1.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_7.1.0.x86_64.xml @@ -222,6 +222,11 @@ <value>2.0</value> </enum> </tpm> + <redirdev supported='yes'> + <enum name='bus'> + <value>usb</value> + </enum> + </redirdev> </devices> <features> <gic supported='no'/> -- 2.37.3

On 10/13/22 01:24, Jim Fehlig wrote:
As qemu becomes more modularized, it is important for libvirt to advertise availability of the modularized functionality through capabilities. This change adds USB redirect devices to domain capabilities, allowing clients such as virt-install to avoid using redirdev devices when not supported by the target qemu.
Signed-off-by: Jim Fehlig <jfehlig@suse.com> --- docs/formatdomaincaps.rst | 22 +++++++++++++++++++ src/conf/domain_capabilities.c | 13 +++++++++++ src/conf/domain_capabilities.h | 8 +++++++ src/conf/schemas/domaincaps.rng | 10 +++++++++ src/qemu/qemu_capabilities.c | 17 ++++++++++++++ src/qemu/qemu_capabilities.h | 3 +++ .../domaincapsdata/qemu_4.2.0-q35.x86_64.xml | 5 +++++ .../domaincapsdata/qemu_4.2.0-tcg.x86_64.xml | 5 +++++ .../qemu_4.2.0-virt.aarch64.xml | 1 + tests/domaincapsdata/qemu_4.2.0.aarch64.xml | 1 + tests/domaincapsdata/qemu_4.2.0.ppc64.xml | 1 + tests/domaincapsdata/qemu_4.2.0.s390x.xml | 5 +++++ tests/domaincapsdata/qemu_4.2.0.x86_64.xml | 5 +++++ .../domaincapsdata/qemu_5.0.0-q35.x86_64.xml | 5 +++++ .../domaincapsdata/qemu_5.0.0-tcg.x86_64.xml | 5 +++++ .../qemu_5.0.0-virt.aarch64.xml | 1 + tests/domaincapsdata/qemu_5.0.0.aarch64.xml | 1 + tests/domaincapsdata/qemu_5.0.0.ppc64.xml | 1 + tests/domaincapsdata/qemu_5.0.0.x86_64.xml | 5 +++++ .../domaincapsdata/qemu_5.1.0-q35.x86_64.xml | 5 +++++ .../domaincapsdata/qemu_5.1.0-tcg.x86_64.xml | 5 +++++ tests/domaincapsdata/qemu_5.1.0.sparc.xml | 5 +++++ tests/domaincapsdata/qemu_5.1.0.x86_64.xml | 5 +++++ .../domaincapsdata/qemu_5.2.0-q35.x86_64.xml | 5 +++++ .../domaincapsdata/qemu_5.2.0-tcg.x86_64.xml | 5 +++++ .../qemu_5.2.0-virt.aarch64.xml | 1 + tests/domaincapsdata/qemu_5.2.0.aarch64.xml | 1 + tests/domaincapsdata/qemu_5.2.0.ppc64.xml | 1 + tests/domaincapsdata/qemu_5.2.0.s390x.xml | 5 +++++ tests/domaincapsdata/qemu_5.2.0.x86_64.xml | 5 +++++ .../domaincapsdata/qemu_6.0.0-q35.x86_64.xml | 5 +++++ .../domaincapsdata/qemu_6.0.0-tcg.x86_64.xml | 5 +++++ .../qemu_6.0.0-virt.aarch64.xml | 1 + tests/domaincapsdata/qemu_6.0.0.aarch64.xml | 1 + tests/domaincapsdata/qemu_6.0.0.s390x.xml | 5 +++++ tests/domaincapsdata/qemu_6.0.0.x86_64.xml | 5 +++++ .../domaincapsdata/qemu_6.1.0-q35.x86_64.xml | 5 +++++ .../domaincapsdata/qemu_6.1.0-tcg.x86_64.xml | 5 +++++ tests/domaincapsdata/qemu_6.1.0.x86_64.xml | 5 +++++ .../domaincapsdata/qemu_6.2.0-q35.x86_64.xml | 5 +++++ .../domaincapsdata/qemu_6.2.0-tcg.x86_64.xml | 5 +++++ .../qemu_6.2.0-virt.aarch64.xml | 5 +++++ tests/domaincapsdata/qemu_6.2.0.aarch64.xml | 5 +++++ tests/domaincapsdata/qemu_6.2.0.ppc64.xml | 1 + tests/domaincapsdata/qemu_6.2.0.x86_64.xml | 5 +++++ .../domaincapsdata/qemu_7.0.0-q35.x86_64.xml | 5 +++++ .../domaincapsdata/qemu_7.0.0-tcg.x86_64.xml | 5 +++++ .../qemu_7.0.0-virt.aarch64.xml | 5 +++++ tests/domaincapsdata/qemu_7.0.0.aarch64.xml | 5 +++++ tests/domaincapsdata/qemu_7.0.0.ppc64.xml | 5 +++++ tests/domaincapsdata/qemu_7.0.0.x86_64.xml | 5 +++++ .../domaincapsdata/qemu_7.1.0-q35.x86_64.xml | 5 +++++ .../domaincapsdata/qemu_7.1.0-tcg.x86_64.xml | 5 +++++ tests/domaincapsdata/qemu_7.1.0.x86_64.xml | 5 +++++ 54 files changed, 265 insertions(+)
Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Michal

As qemu becomes more modularized, it is important for libvirt to advertise availability of the modularized functionality through capabilities. This change adds channel devices to domain capabilities, allowing clients such as virt-install to avoid using spicevmc channel devices when not supported by the target qemu. Signed-off-by: Jim Fehlig <jfehlig@suse.com> --- docs/formatdomaincaps.rst | 24 +++++++++++++++++++ src/conf/domain_capabilities.c | 13 ++++++++++ src/conf/domain_capabilities.h | 8 +++++++ src/conf/schemas/domaincaps.rng | 10 ++++++++ src/qemu/qemu_capabilities.c | 16 +++++++++++++ src/qemu/qemu_capabilities.h | 3 +++ .../domaincapsdata/qemu_4.2.0-q35.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_4.2.0-tcg.x86_64.xml | 7 ++++++ .../qemu_4.2.0-virt.aarch64.xml | 6 +++++ tests/domaincapsdata/qemu_4.2.0.aarch64.xml | 6 +++++ tests/domaincapsdata/qemu_4.2.0.ppc64.xml | 6 +++++ tests/domaincapsdata/qemu_4.2.0.s390x.xml | 6 +++++ tests/domaincapsdata/qemu_4.2.0.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_5.0.0-q35.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_5.0.0-tcg.x86_64.xml | 7 ++++++ .../qemu_5.0.0-virt.aarch64.xml | 6 +++++ tests/domaincapsdata/qemu_5.0.0.aarch64.xml | 6 +++++ tests/domaincapsdata/qemu_5.0.0.ppc64.xml | 6 +++++ tests/domaincapsdata/qemu_5.0.0.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_5.1.0-q35.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_5.1.0-tcg.x86_64.xml | 7 ++++++ tests/domaincapsdata/qemu_5.1.0.sparc.xml | 7 ++++++ tests/domaincapsdata/qemu_5.1.0.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_5.2.0-q35.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_5.2.0-tcg.x86_64.xml | 7 ++++++ .../qemu_5.2.0-virt.aarch64.xml | 6 +++++ tests/domaincapsdata/qemu_5.2.0.aarch64.xml | 6 +++++ tests/domaincapsdata/qemu_5.2.0.ppc64.xml | 6 +++++ tests/domaincapsdata/qemu_5.2.0.s390x.xml | 6 +++++ tests/domaincapsdata/qemu_5.2.0.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_6.0.0-q35.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_6.0.0-tcg.x86_64.xml | 7 ++++++ .../qemu_6.0.0-virt.aarch64.xml | 6 +++++ tests/domaincapsdata/qemu_6.0.0.aarch64.xml | 6 +++++ tests/domaincapsdata/qemu_6.0.0.s390x.xml | 6 +++++ tests/domaincapsdata/qemu_6.0.0.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_6.1.0-q35.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_6.1.0-tcg.x86_64.xml | 7 ++++++ tests/domaincapsdata/qemu_6.1.0.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_6.2.0-q35.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_6.2.0-tcg.x86_64.xml | 7 ++++++ .../qemu_6.2.0-virt.aarch64.xml | 7 ++++++ tests/domaincapsdata/qemu_6.2.0.aarch64.xml | 7 ++++++ tests/domaincapsdata/qemu_6.2.0.ppc64.xml | 6 +++++ tests/domaincapsdata/qemu_6.2.0.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_7.0.0-q35.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_7.0.0-tcg.x86_64.xml | 7 ++++++ .../qemu_7.0.0-virt.aarch64.xml | 7 ++++++ tests/domaincapsdata/qemu_7.0.0.aarch64.xml | 7 ++++++ tests/domaincapsdata/qemu_7.0.0.ppc64.xml | 6 +++++ tests/domaincapsdata/qemu_7.0.0.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_7.1.0-q35.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_7.1.0-tcg.x86_64.xml | 7 ++++++ tests/domaincapsdata/qemu_7.1.0.x86_64.xml | 7 ++++++ .../caps_4.2.0.x86_64.xml | 1 + .../caps_5.0.0.riscv64.xml | 1 + .../caps_5.0.0.x86_64.xml | 1 + .../qemucapabilitiesdata/caps_5.1.0.sparc.xml | 1 + .../caps_5.1.0.x86_64.xml | 1 + .../caps_5.2.0.riscv64.xml | 1 + .../caps_5.2.0.x86_64.xml | 1 + .../caps_6.0.0.x86_64.xml | 1 + .../caps_6.1.0.x86_64.xml | 1 + .../caps_6.2.0.aarch64.xml | 1 + .../caps_6.2.0.x86_64.xml | 1 + .../caps_7.0.0.aarch64.xml | 1 + .../caps_7.0.0.x86_64.xml | 1 + .../caps_7.1.0.x86_64.xml | 1 + 68 files changed, 408 insertions(+) diff --git a/docs/formatdomaincaps.rst b/docs/formatdomaincaps.rst index 93d36f2702..f95d3a7083 100644 --- a/docs/formatdomaincaps.rst +++ b/docs/formatdomaincaps.rst @@ -565,6 +565,30 @@ USB redirdev device capabilities are exposed under the ``redirdev`` element. For ``bus`` Options for the ``bus`` attribute of the ``<redirdev/>`` element. +Channel device +^^^^^^^^^^^^^^ + +Channel device capabilities are exposed under the ``channel`` element. For instance: + +:: + + <domainCapabilities> + ... + <devices> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + <value>spicevmc</value> + </enum> + </channel + ... + </devices> + </domainCapabilities> + +``type`` + Options for the ``type`` attribute of the ``<channel/>`` element. + Features ~~~~~~~~ diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index f8b2f88376..a7f256e4ec 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -574,6 +574,18 @@ virDomainCapsDeviceRedirdevFormat(virBuffer *buf, } +static void +virDomainCapsDeviceChannelFormat(virBuffer *buf, + const virDomainCapsDeviceChannel *channel) +{ + FORMAT_PROLOGUE(channel); + + ENUM_PROCESS(channel, type, virDomainChrTypeToString); + + FORMAT_EPILOGUE(channel); +} + + /** * virDomainCapsFeatureGICFormat: * @buf: target buffer @@ -688,6 +700,7 @@ virDomainCapsFormat(const virDomainCaps *caps) virDomainCapsDeviceFilesystemFormat(&buf, &caps->filesystem); virDomainCapsDeviceTPMFormat(&buf, &caps->tpm); virDomainCapsDeviceRedirdevFormat(&buf, &caps->redirdev); + virDomainCapsDeviceChannelFormat(&buf, &caps->channel); virBufferAdjustIndent(&buf, -2); virBufferAddLit(&buf, "</devices>\n"); diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h index ba7c2a5e42..e0cfa75531 100644 --- a/src/conf/domain_capabilities.h +++ b/src/conf/domain_capabilities.h @@ -137,6 +137,13 @@ struct _virDomainCapsDeviceRedirdev { virDomainCapsEnum bus; /* virDomainRedirdevBus */ }; +STATIC_ASSERT_ENUM(VIR_DOMAIN_CHR_TYPE_LAST); +typedef struct _virDomainCapsDeviceChannel virDomainCapsDeviceChannel; +struct _virDomainCapsDeviceChannel { + virTristateBool supported; + virDomainCapsEnum type; /* virDomainChrType */ +}; + STATIC_ASSERT_ENUM(VIR_DOMAIN_FS_DRIVER_TYPE_LAST); typedef struct _virDomainCapsDeviceFilesystem virDomainCapsDeviceFilesystem; struct _virDomainCapsDeviceFilesystem { @@ -234,6 +241,7 @@ struct _virDomainCaps { virDomainCapsDeviceFilesystem filesystem; virDomainCapsDeviceTPM tpm; virDomainCapsDeviceRedirdev redirdev; + virDomainCapsDeviceChannel channel; /* add new domain devices here */ virDomainCapsFeatureGIC gic; diff --git a/src/conf/schemas/domaincaps.rng b/src/conf/schemas/domaincaps.rng index cf7a1d1d89..a6747b20ef 100644 --- a/src/conf/schemas/domaincaps.rng +++ b/src/conf/schemas/domaincaps.rng @@ -201,6 +201,9 @@ <optional> <ref name="redirdev"/> </optional> + <optional> + <ref name="channel"/> + </optional> </element> </define> @@ -260,6 +263,13 @@ </element> </define> + <define name="channel"> + <element name="channel"> + <ref name="supported"/> + <ref name="enum"/> + </element> + </define> + <define name="features"> <element name="features"> <optional> diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 5a664ec628..98849daf4c 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1392,6 +1392,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { { "s390-pv-guest", QEMU_CAPS_S390_PV_GUEST }, { "virtio-mem-pci", QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI }, { "virtio-iommu-pci", QEMU_CAPS_DEVICE_VIRTIO_IOMMU_PCI }, + { "chardev-spicevmc", X_QEMU_CAPS_CHARDEV_SPICEVMC }, }; @@ -6347,6 +6348,19 @@ virQEMUCapsFillDomainDeviceRedirdevCaps(virQEMUCaps *qemuCaps, } +void +virQEMUCapsFillDomainDeviceChannelCaps(virQEMUCaps *qemuCaps, + virDomainCapsDeviceChannel *channel) +{ + channel->supported = VIR_TRISTATE_BOOL_YES; + channel->type.report = true; + VIR_DOMAIN_CAPS_ENUM_SET(channel->type, + VIR_DOMAIN_CHR_TYPE_PTY, VIR_DOMAIN_CHR_TYPE_UNIX); + + if (virQEMUCapsGet(qemuCaps, X_QEMU_CAPS_CHARDEV_SPICEVMC)) + VIR_DOMAIN_CAPS_ENUM_SET(channel->type, VIR_DOMAIN_CHR_TYPE_SPICEVMC); +} + /** * virQEMUCapsSupportsGICVersion: @@ -6484,6 +6498,7 @@ virQEMUCapsFillDomainCaps(virQEMUCaps *qemuCaps, virDomainCapsDeviceFilesystem *filesystem = &domCaps->filesystem; virDomainCapsDeviceTPM *tpm = &domCaps->tpm; virDomainCapsDeviceRedirdev *redirdev = &domCaps->redirdev; + virDomainCapsDeviceChannel *channel = &domCaps->channel; virDomainCapsMemoryBacking *memoryBacking = &domCaps->memoryBacking; virQEMUCapsFillDomainFeaturesFromQEMUCaps(qemuCaps, domCaps); @@ -6517,6 +6532,7 @@ virQEMUCapsFillDomainCaps(virQEMUCaps *qemuCaps, virQEMUCapsFillDomainDeviceFSCaps(qemuCaps, filesystem); virQEMUCapsFillDomainDeviceTPMCaps(qemuCaps, tpm); virQEMUCapsFillDomainDeviceRedirdevCaps(qemuCaps, redirdev); + virQEMUCapsFillDomainDeviceChannelCaps(qemuCaps, channel); virQEMUCapsFillDomainFeatureGICCaps(qemuCaps, domCaps); virQEMUCapsFillDomainFeatureSEVCaps(qemuCaps, domCaps); virQEMUCapsFillDomainFeatureS390PVCaps(qemuCaps, domCaps); diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 051bfbc0a1..4edbb5d40f 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -833,6 +833,9 @@ void virQEMUCapsFillDomainDeviceTPMCaps(virQEMUCaps *qemuCaps, void virQEMUCapsFillDomainDeviceRedirdevCaps(virQEMUCaps *qemuCaps, virDomainCapsDeviceRedirdev *redirdev); +void virQEMUCapsFillDomainDeviceChannelCaps(virQEMUCaps *qemuCaps, + virDomainCapsDeviceChannel *channel); + bool virQEMUCapsGuestIsNative(virArch host, virArch guest); diff --git a/tests/domaincapsdata/qemu_4.2.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_4.2.0-q35.x86_64.xml index 5b83883e39..def80fe8cd 100644 --- a/tests/domaincapsdata/qemu_4.2.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_4.2.0-q35.x86_64.xml @@ -221,6 +221,13 @@ <value>usb</value> </enum> </redirdev> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + <value>spicevmc</value> + </enum> + </channel> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_4.2.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_4.2.0-tcg.x86_64.xml index ab55ec2452..9e920d1ccb 100644 --- a/tests/domaincapsdata/qemu_4.2.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_4.2.0-tcg.x86_64.xml @@ -236,6 +236,13 @@ <value>usb</value> </enum> </redirdev> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + <value>spicevmc</value> + </enum> + </channel> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_4.2.0-virt.aarch64.xml b/tests/domaincapsdata/qemu_4.2.0-virt.aarch64.xml index e0af576d5c..776173e60e 100644 --- a/tests/domaincapsdata/qemu_4.2.0-virt.aarch64.xml +++ b/tests/domaincapsdata/qemu_4.2.0-virt.aarch64.xml @@ -166,6 +166,12 @@ </filesystem> <tpm supported='no'/> <redirdev supported='no'/> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + </enum> + </channel> </devices> <features> <gic supported='yes'> diff --git a/tests/domaincapsdata/qemu_4.2.0.aarch64.xml b/tests/domaincapsdata/qemu_4.2.0.aarch64.xml index 61839a1983..b6711fc3a4 100644 --- a/tests/domaincapsdata/qemu_4.2.0.aarch64.xml +++ b/tests/domaincapsdata/qemu_4.2.0.aarch64.xml @@ -164,6 +164,12 @@ </filesystem> <tpm supported='no'/> <redirdev supported='no'/> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + </enum> + </channel> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_4.2.0.ppc64.xml b/tests/domaincapsdata/qemu_4.2.0.ppc64.xml index 1626d9b186..88790451b0 100644 --- a/tests/domaincapsdata/qemu_4.2.0.ppc64.xml +++ b/tests/domaincapsdata/qemu_4.2.0.ppc64.xml @@ -137,6 +137,12 @@ </enum> </tpm> <redirdev supported='no'/> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + </enum> + </channel> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_4.2.0.s390x.xml b/tests/domaincapsdata/qemu_4.2.0.s390x.xml index ee07f4c274..fa416af038 100644 --- a/tests/domaincapsdata/qemu_4.2.0.s390x.xml +++ b/tests/domaincapsdata/qemu_4.2.0.s390x.xml @@ -243,6 +243,12 @@ <value>usb</value> </enum> </redirdev> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + </enum> + </channel> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_4.2.0.x86_64.xml b/tests/domaincapsdata/qemu_4.2.0.x86_64.xml index a6eaf7962f..ed9de89dfa 100644 --- a/tests/domaincapsdata/qemu_4.2.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_4.2.0.x86_64.xml @@ -221,6 +221,13 @@ <value>usb</value> </enum> </redirdev> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + <value>spicevmc</value> + </enum> + </channel> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_5.0.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_5.0.0-q35.x86_64.xml index 232f1f0e12..af0335eb3a 100644 --- a/tests/domaincapsdata/qemu_5.0.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_5.0.0-q35.x86_64.xml @@ -223,6 +223,13 @@ <value>usb</value> </enum> </redirdev> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + <value>spicevmc</value> + </enum> + </channel> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_5.0.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_5.0.0-tcg.x86_64.xml index ce2c08f205..fc09e9ff28 100644 --- a/tests/domaincapsdata/qemu_5.0.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_5.0.0-tcg.x86_64.xml @@ -238,6 +238,13 @@ <value>usb</value> </enum> </redirdev> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + <value>spicevmc</value> + </enum> + </channel> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_5.0.0-virt.aarch64.xml b/tests/domaincapsdata/qemu_5.0.0-virt.aarch64.xml index 9215371d0c..88bc77f50b 100644 --- a/tests/domaincapsdata/qemu_5.0.0-virt.aarch64.xml +++ b/tests/domaincapsdata/qemu_5.0.0-virt.aarch64.xml @@ -178,6 +178,12 @@ </enum> </tpm> <redirdev supported='no'/> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + </enum> + </channel> </devices> <features> <gic supported='yes'> diff --git a/tests/domaincapsdata/qemu_5.0.0.aarch64.xml b/tests/domaincapsdata/qemu_5.0.0.aarch64.xml index fcc77ad8db..5e030047d1 100644 --- a/tests/domaincapsdata/qemu_5.0.0.aarch64.xml +++ b/tests/domaincapsdata/qemu_5.0.0.aarch64.xml @@ -176,6 +176,12 @@ </enum> </tpm> <redirdev supported='no'/> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + </enum> + </channel> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_5.0.0.ppc64.xml b/tests/domaincapsdata/qemu_5.0.0.ppc64.xml index 711ccc2cb0..0c5aaade40 100644 --- a/tests/domaincapsdata/qemu_5.0.0.ppc64.xml +++ b/tests/domaincapsdata/qemu_5.0.0.ppc64.xml @@ -143,6 +143,12 @@ </enum> </tpm> <redirdev supported='no'/> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + </enum> + </channel> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_5.0.0.x86_64.xml b/tests/domaincapsdata/qemu_5.0.0.x86_64.xml index f52613f584..5b2a0bc83d 100644 --- a/tests/domaincapsdata/qemu_5.0.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_5.0.0.x86_64.xml @@ -223,6 +223,13 @@ <value>usb</value> </enum> </redirdev> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + <value>spicevmc</value> + </enum> + </channel> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_5.1.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_5.1.0-q35.x86_64.xml index 542d32b018..fb9f69bb9a 100644 --- a/tests/domaincapsdata/qemu_5.1.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_5.1.0-q35.x86_64.xml @@ -224,6 +224,13 @@ <value>usb</value> </enum> </redirdev> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + <value>spicevmc</value> + </enum> + </channel> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_5.1.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_5.1.0-tcg.x86_64.xml index 8bd5c6073c..ea31348ab1 100644 --- a/tests/domaincapsdata/qemu_5.1.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_5.1.0-tcg.x86_64.xml @@ -238,6 +238,13 @@ <value>usb</value> </enum> </redirdev> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + <value>spicevmc</value> + </enum> + </channel> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_5.1.0.sparc.xml b/tests/domaincapsdata/qemu_5.1.0.sparc.xml index ea4d1d28dd..5bbf4720dc 100644 --- a/tests/domaincapsdata/qemu_5.1.0.sparc.xml +++ b/tests/domaincapsdata/qemu_5.1.0.sparc.xml @@ -110,6 +110,13 @@ <value>usb</value> </enum> </redirdev> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + <value>spicevmc</value> + </enum> + </channel> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_5.1.0.x86_64.xml b/tests/domaincapsdata/qemu_5.1.0.x86_64.xml index 5c48efc8c6..584dad5a89 100644 --- a/tests/domaincapsdata/qemu_5.1.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_5.1.0.x86_64.xml @@ -224,6 +224,13 @@ <value>usb</value> </enum> </redirdev> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + <value>spicevmc</value> + </enum> + </channel> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_5.2.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_5.2.0-q35.x86_64.xml index 70c4f3cbd1..f1d20991e9 100644 --- a/tests/domaincapsdata/qemu_5.2.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_5.2.0-q35.x86_64.xml @@ -224,6 +224,13 @@ <value>usb</value> </enum> </redirdev> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + <value>spicevmc</value> + </enum> + </channel> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_5.2.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_5.2.0-tcg.x86_64.xml index 636a84e55f..cec260f56d 100644 --- a/tests/domaincapsdata/qemu_5.2.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_5.2.0-tcg.x86_64.xml @@ -238,6 +238,13 @@ <value>usb</value> </enum> </redirdev> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + <value>spicevmc</value> + </enum> + </channel> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_5.2.0-virt.aarch64.xml b/tests/domaincapsdata/qemu_5.2.0-virt.aarch64.xml index 900d10f720..be7262211c 100644 --- a/tests/domaincapsdata/qemu_5.2.0-virt.aarch64.xml +++ b/tests/domaincapsdata/qemu_5.2.0-virt.aarch64.xml @@ -178,6 +178,12 @@ </enum> </tpm> <redirdev supported='no'/> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + </enum> + </channel> </devices> <features> <gic supported='yes'> diff --git a/tests/domaincapsdata/qemu_5.2.0.aarch64.xml b/tests/domaincapsdata/qemu_5.2.0.aarch64.xml index fcc77ad8db..5e030047d1 100644 --- a/tests/domaincapsdata/qemu_5.2.0.aarch64.xml +++ b/tests/domaincapsdata/qemu_5.2.0.aarch64.xml @@ -176,6 +176,12 @@ </enum> </tpm> <redirdev supported='no'/> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + </enum> + </channel> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_5.2.0.ppc64.xml b/tests/domaincapsdata/qemu_5.2.0.ppc64.xml index 99c2767276..9367738157 100644 --- a/tests/domaincapsdata/qemu_5.2.0.ppc64.xml +++ b/tests/domaincapsdata/qemu_5.2.0.ppc64.xml @@ -143,6 +143,12 @@ </enum> </tpm> <redirdev supported='no'/> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + </enum> + </channel> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_5.2.0.s390x.xml b/tests/domaincapsdata/qemu_5.2.0.s390x.xml index bdade9c5bb..adc197648f 100644 --- a/tests/domaincapsdata/qemu_5.2.0.s390x.xml +++ b/tests/domaincapsdata/qemu_5.2.0.s390x.xml @@ -245,6 +245,12 @@ <value>usb</value> </enum> </redirdev> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + </enum> + </channel> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_5.2.0.x86_64.xml b/tests/domaincapsdata/qemu_5.2.0.x86_64.xml index db22085e31..a3707e6804 100644 --- a/tests/domaincapsdata/qemu_5.2.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_5.2.0.x86_64.xml @@ -224,6 +224,13 @@ <value>usb</value> </enum> </redirdev> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + <value>spicevmc</value> + </enum> + </channel> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_6.0.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_6.0.0-q35.x86_64.xml index 395eb3b9eb..7edb84e9bc 100644 --- a/tests/domaincapsdata/qemu_6.0.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_6.0.0-q35.x86_64.xml @@ -226,6 +226,13 @@ <value>usb</value> </enum> </redirdev> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + <value>spicevmc</value> + </enum> + </channel> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_6.0.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_6.0.0-tcg.x86_64.xml index 769a1147b6..cc0bfcac2d 100644 --- a/tests/domaincapsdata/qemu_6.0.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_6.0.0-tcg.x86_64.xml @@ -240,6 +240,13 @@ <value>usb</value> </enum> </redirdev> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + <value>spicevmc</value> + </enum> + </channel> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_6.0.0-virt.aarch64.xml b/tests/domaincapsdata/qemu_6.0.0-virt.aarch64.xml index 2f56e36c28..db9b45d74e 100644 --- a/tests/domaincapsdata/qemu_6.0.0-virt.aarch64.xml +++ b/tests/domaincapsdata/qemu_6.0.0-virt.aarch64.xml @@ -180,6 +180,12 @@ </enum> </tpm> <redirdev supported='no'/> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + </enum> + </channel> </devices> <features> <gic supported='yes'> diff --git a/tests/domaincapsdata/qemu_6.0.0.aarch64.xml b/tests/domaincapsdata/qemu_6.0.0.aarch64.xml index 4639a84c1d..1a65156544 100644 --- a/tests/domaincapsdata/qemu_6.0.0.aarch64.xml +++ b/tests/domaincapsdata/qemu_6.0.0.aarch64.xml @@ -178,6 +178,12 @@ </enum> </tpm> <redirdev supported='no'/> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + </enum> + </channel> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_6.0.0.s390x.xml b/tests/domaincapsdata/qemu_6.0.0.s390x.xml index 25abcac608..56d87f7a2f 100644 --- a/tests/domaincapsdata/qemu_6.0.0.s390x.xml +++ b/tests/domaincapsdata/qemu_6.0.0.s390x.xml @@ -246,6 +246,12 @@ <value>usb</value> </enum> </redirdev> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + </enum> + </channel> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_6.0.0.x86_64.xml b/tests/domaincapsdata/qemu_6.0.0.x86_64.xml index 2be8f3e33b..3afab2f4c2 100644 --- a/tests/domaincapsdata/qemu_6.0.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_6.0.0.x86_64.xml @@ -226,6 +226,13 @@ <value>usb</value> </enum> </redirdev> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + <value>spicevmc</value> + </enum> + </channel> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_6.1.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_6.1.0-q35.x86_64.xml index f23e758b1a..d0dbadd6d3 100644 --- a/tests/domaincapsdata/qemu_6.1.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_6.1.0-q35.x86_64.xml @@ -227,6 +227,13 @@ <value>usb</value> </enum> </redirdev> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + <value>spicevmc</value> + </enum> + </channel> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_6.1.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_6.1.0-tcg.x86_64.xml index f78abdefc5..52071fc2c5 100644 --- a/tests/domaincapsdata/qemu_6.1.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_6.1.0-tcg.x86_64.xml @@ -240,6 +240,13 @@ <value>usb</value> </enum> </redirdev> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + <value>spicevmc</value> + </enum> + </channel> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_6.1.0.x86_64.xml b/tests/domaincapsdata/qemu_6.1.0.x86_64.xml index 9de18c682e..17c30b394d 100644 --- a/tests/domaincapsdata/qemu_6.1.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_6.1.0.x86_64.xml @@ -227,6 +227,13 @@ <value>usb</value> </enum> </redirdev> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + <value>spicevmc</value> + </enum> + </channel> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_6.2.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_6.2.0-q35.x86_64.xml index dff92d65aa..c185ae4510 100644 --- a/tests/domaincapsdata/qemu_6.2.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_6.2.0-q35.x86_64.xml @@ -227,6 +227,13 @@ <value>usb</value> </enum> </redirdev> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + <value>spicevmc</value> + </enum> + </channel> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_6.2.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_6.2.0-tcg.x86_64.xml index f027eb25a5..7bebc1f8b2 100644 --- a/tests/domaincapsdata/qemu_6.2.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_6.2.0-tcg.x86_64.xml @@ -241,6 +241,13 @@ <value>usb</value> </enum> </redirdev> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + <value>spicevmc</value> + </enum> + </channel> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_6.2.0-virt.aarch64.xml b/tests/domaincapsdata/qemu_6.2.0-virt.aarch64.xml index c572b0481c..3d79cd7486 100644 --- a/tests/domaincapsdata/qemu_6.2.0-virt.aarch64.xml +++ b/tests/domaincapsdata/qemu_6.2.0-virt.aarch64.xml @@ -186,6 +186,13 @@ <value>usb</value> </enum> </redirdev> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + <value>spicevmc</value> + </enum> + </channel> </devices> <features> <gic supported='yes'> diff --git a/tests/domaincapsdata/qemu_6.2.0.aarch64.xml b/tests/domaincapsdata/qemu_6.2.0.aarch64.xml index eb521a0cfa..4ccffb3695 100644 --- a/tests/domaincapsdata/qemu_6.2.0.aarch64.xml +++ b/tests/domaincapsdata/qemu_6.2.0.aarch64.xml @@ -184,6 +184,13 @@ <value>usb</value> </enum> </redirdev> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + <value>spicevmc</value> + </enum> + </channel> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_6.2.0.ppc64.xml b/tests/domaincapsdata/qemu_6.2.0.ppc64.xml index 7797b94cf2..ba7bc17a98 100644 --- a/tests/domaincapsdata/qemu_6.2.0.ppc64.xml +++ b/tests/domaincapsdata/qemu_6.2.0.ppc64.xml @@ -142,6 +142,12 @@ </enum> </tpm> <redirdev supported='no'/> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + </enum> + </channel> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_6.2.0.x86_64.xml b/tests/domaincapsdata/qemu_6.2.0.x86_64.xml index aff2ee6662..ba40728489 100644 --- a/tests/domaincapsdata/qemu_6.2.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_6.2.0.x86_64.xml @@ -227,6 +227,13 @@ <value>usb</value> </enum> </redirdev> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + <value>spicevmc</value> + </enum> + </channel> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_7.0.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_7.0.0-q35.x86_64.xml index e70b0990a7..94c6f3d712 100644 --- a/tests/domaincapsdata/qemu_7.0.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_7.0.0-q35.x86_64.xml @@ -228,6 +228,13 @@ <value>usb</value> </enum> </redirdev> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + <value>spicevmc</value> + </enum> + </channel> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_7.0.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_7.0.0-tcg.x86_64.xml index 03c5411c4e..c6a02b6512 100644 --- a/tests/domaincapsdata/qemu_7.0.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_7.0.0-tcg.x86_64.xml @@ -242,6 +242,13 @@ <value>usb</value> </enum> </redirdev> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + <value>spicevmc</value> + </enum> + </channel> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_7.0.0-virt.aarch64.xml b/tests/domaincapsdata/qemu_7.0.0-virt.aarch64.xml index 59f89afd9b..3addb1fc57 100644 --- a/tests/domaincapsdata/qemu_7.0.0-virt.aarch64.xml +++ b/tests/domaincapsdata/qemu_7.0.0-virt.aarch64.xml @@ -185,6 +185,13 @@ <value>usb</value> </enum> </redirdev> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + <value>spicevmc</value> + </enum> + </channel> </devices> <features> <gic supported='yes'> diff --git a/tests/domaincapsdata/qemu_7.0.0.aarch64.xml b/tests/domaincapsdata/qemu_7.0.0.aarch64.xml index 1e6bf544dc..9f07a10a90 100644 --- a/tests/domaincapsdata/qemu_7.0.0.aarch64.xml +++ b/tests/domaincapsdata/qemu_7.0.0.aarch64.xml @@ -183,6 +183,13 @@ <value>usb</value> </enum> </redirdev> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + <value>spicevmc</value> + </enum> + </channel> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_7.0.0.ppc64.xml b/tests/domaincapsdata/qemu_7.0.0.ppc64.xml index 76da1f4f7d..ed6c74aac1 100644 --- a/tests/domaincapsdata/qemu_7.0.0.ppc64.xml +++ b/tests/domaincapsdata/qemu_7.0.0.ppc64.xml @@ -147,6 +147,12 @@ <value>usb</value> </enum> </redirdev> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + </enum> + </channel> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_7.0.0.x86_64.xml b/tests/domaincapsdata/qemu_7.0.0.x86_64.xml index da23f5703a..5913f44937 100644 --- a/tests/domaincapsdata/qemu_7.0.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_7.0.0.x86_64.xml @@ -228,6 +228,13 @@ <value>usb</value> </enum> </redirdev> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + <value>spicevmc</value> + </enum> + </channel> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_7.1.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_7.1.0-q35.x86_64.xml index 05b36ee79e..2d76581915 100644 --- a/tests/domaincapsdata/qemu_7.1.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_7.1.0-q35.x86_64.xml @@ -227,6 +227,13 @@ <value>usb</value> </enum> </redirdev> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + <value>spicevmc</value> + </enum> + </channel> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_7.1.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_7.1.0-tcg.x86_64.xml index 0786cd8430..c0b59c0d44 100644 --- a/tests/domaincapsdata/qemu_7.1.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_7.1.0-tcg.x86_64.xml @@ -240,6 +240,13 @@ <value>usb</value> </enum> </redirdev> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + <value>spicevmc</value> + </enum> + </channel> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsdata/qemu_7.1.0.x86_64.xml b/tests/domaincapsdata/qemu_7.1.0.x86_64.xml index ae67a16947..a419005ee3 100644 --- a/tests/domaincapsdata/qemu_7.1.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_7.1.0.x86_64.xml @@ -227,6 +227,13 @@ <value>usb</value> </enum> </redirdev> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + <value>spicevmc</value> + </enum> + </channel> </devices> <features> <gic supported='no'/> diff --git a/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml index 245a0bd2fb..b07fad7298 100644 --- a/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml @@ -10,6 +10,7 @@ <flag name='hda-duplex'/> <flag name='ccid-emulated'/> <flag name='ccid-passthru'/> + <flag name='chardev-spicevmc'/> <flag name='piix3-usb-uhci'/> <flag name='piix4-usb-uhci'/> <flag name='usb-ehci'/> diff --git a/tests/qemucapabilitiesdata/caps_5.0.0.riscv64.xml b/tests/qemucapabilitiesdata/caps_5.0.0.riscv64.xml index 19edb90927..378e5badd5 100644 --- a/tests/qemucapabilitiesdata/caps_5.0.0.riscv64.xml +++ b/tests/qemucapabilitiesdata/caps_5.0.0.riscv64.xml @@ -8,6 +8,7 @@ <flag name='hda-duplex'/> <flag name='ccid-emulated'/> <flag name='ccid-passthru'/> + <flag name='chardev-spicevmc'/> <flag name='piix3-usb-uhci'/> <flag name='piix4-usb-uhci'/> <flag name='usb-ehci'/> diff --git a/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml index 46bbfac186..250ade9bf4 100644 --- a/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml @@ -10,6 +10,7 @@ <flag name='hda-duplex'/> <flag name='ccid-emulated'/> <flag name='ccid-passthru'/> + <flag name='chardev-spicevmc'/> <flag name='piix3-usb-uhci'/> <flag name='piix4-usb-uhci'/> <flag name='usb-ehci'/> diff --git a/tests/qemucapabilitiesdata/caps_5.1.0.sparc.xml b/tests/qemucapabilitiesdata/caps_5.1.0.sparc.xml index 93ae1b6d0a..2cba338c29 100644 --- a/tests/qemucapabilitiesdata/caps_5.1.0.sparc.xml +++ b/tests/qemucapabilitiesdata/caps_5.1.0.sparc.xml @@ -5,6 +5,7 @@ <selfvers>0</selfvers> <flag name='sdl'/> <flag name='spice'/> + <flag name='chardev-spicevmc'/> <flag name='usb-redir'/> <flag name='scsi-disk.channel'/> <flag name='scsi-block'/> diff --git a/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml index 9dbe8f1ca8..c18bbee27e 100644 --- a/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml @@ -10,6 +10,7 @@ <flag name='hda-duplex'/> <flag name='ccid-emulated'/> <flag name='ccid-passthru'/> + <flag name='chardev-spicevmc'/> <flag name='piix3-usb-uhci'/> <flag name='piix4-usb-uhci'/> <flag name='usb-ehci'/> diff --git a/tests/qemucapabilitiesdata/caps_5.2.0.riscv64.xml b/tests/qemucapabilitiesdata/caps_5.2.0.riscv64.xml index 7b4915b67f..16d2d3df04 100644 --- a/tests/qemucapabilitiesdata/caps_5.2.0.riscv64.xml +++ b/tests/qemucapabilitiesdata/caps_5.2.0.riscv64.xml @@ -8,6 +8,7 @@ <flag name='hda-duplex'/> <flag name='ccid-emulated'/> <flag name='ccid-passthru'/> + <flag name='chardev-spicevmc'/> <flag name='piix3-usb-uhci'/> <flag name='piix4-usb-uhci'/> <flag name='usb-ehci'/> diff --git a/tests/qemucapabilitiesdata/caps_5.2.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_5.2.0.x86_64.xml index c71275506a..4d9edb56cf 100644 --- a/tests/qemucapabilitiesdata/caps_5.2.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_5.2.0.x86_64.xml @@ -10,6 +10,7 @@ <flag name='hda-duplex'/> <flag name='ccid-emulated'/> <flag name='ccid-passthru'/> + <flag name='chardev-spicevmc'/> <flag name='piix3-usb-uhci'/> <flag name='piix4-usb-uhci'/> <flag name='usb-ehci'/> diff --git a/tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml index 876a5afe43..575531feb4 100644 --- a/tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml @@ -10,6 +10,7 @@ <flag name='hda-duplex'/> <flag name='ccid-emulated'/> <flag name='ccid-passthru'/> + <flag name='chardev-spicevmc'/> <flag name='piix3-usb-uhci'/> <flag name='piix4-usb-uhci'/> <flag name='usb-ehci'/> diff --git a/tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml index f73c070c9e..bdf2f21746 100644 --- a/tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml @@ -10,6 +10,7 @@ <flag name='hda-duplex'/> <flag name='ccid-emulated'/> <flag name='ccid-passthru'/> + <flag name='chardev-spicevmc'/> <flag name='piix3-usb-uhci'/> <flag name='piix4-usb-uhci'/> <flag name='usb-ehci'/> diff --git a/tests/qemucapabilitiesdata/caps_6.2.0.aarch64.xml b/tests/qemucapabilitiesdata/caps_6.2.0.aarch64.xml index 234f386736..93e5a7aea5 100644 --- a/tests/qemucapabilitiesdata/caps_6.2.0.aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_6.2.0.aarch64.xml @@ -9,6 +9,7 @@ <flag name='hda-duplex'/> <flag name='ccid-emulated'/> <flag name='ccid-passthru'/> + <flag name='chardev-spicevmc'/> <flag name='piix3-usb-uhci'/> <flag name='piix4-usb-uhci'/> <flag name='usb-ehci'/> diff --git a/tests/qemucapabilitiesdata/caps_6.2.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_6.2.0.x86_64.xml index fd57627ad5..446063c08f 100644 --- a/tests/qemucapabilitiesdata/caps_6.2.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_6.2.0.x86_64.xml @@ -10,6 +10,7 @@ <flag name='hda-duplex'/> <flag name='ccid-emulated'/> <flag name='ccid-passthru'/> + <flag name='chardev-spicevmc'/> <flag name='piix3-usb-uhci'/> <flag name='piix4-usb-uhci'/> <flag name='usb-ehci'/> diff --git a/tests/qemucapabilitiesdata/caps_7.0.0.aarch64.xml b/tests/qemucapabilitiesdata/caps_7.0.0.aarch64.xml index 19a6c33353..74106a3d6f 100644 --- a/tests/qemucapabilitiesdata/caps_7.0.0.aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_7.0.0.aarch64.xml @@ -9,6 +9,7 @@ <flag name='hda-duplex'/> <flag name='ccid-emulated'/> <flag name='ccid-passthru'/> + <flag name='chardev-spicevmc'/> <flag name='piix3-usb-uhci'/> <flag name='piix4-usb-uhci'/> <flag name='usb-ehci'/> diff --git a/tests/qemucapabilitiesdata/caps_7.0.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_7.0.0.x86_64.xml index dc7b041294..b5b030d16c 100644 --- a/tests/qemucapabilitiesdata/caps_7.0.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_7.0.0.x86_64.xml @@ -10,6 +10,7 @@ <flag name='hda-duplex'/> <flag name='ccid-emulated'/> <flag name='ccid-passthru'/> + <flag name='chardev-spicevmc'/> <flag name='piix3-usb-uhci'/> <flag name='piix4-usb-uhci'/> <flag name='usb-ehci'/> diff --git a/tests/qemucapabilitiesdata/caps_7.1.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_7.1.0.x86_64.xml index 5c60b7cf88..04524a6038 100644 --- a/tests/qemucapabilitiesdata/caps_7.1.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_7.1.0.x86_64.xml @@ -10,6 +10,7 @@ <flag name='hda-duplex'/> <flag name='ccid-emulated'/> <flag name='ccid-passthru'/> + <flag name='chardev-spicevmc'/> <flag name='piix3-usb-uhci'/> <flag name='piix4-usb-uhci'/> <flag name='usb-ehci'/> -- 2.37.3

On 10/13/22 01:24, Jim Fehlig wrote:
As qemu becomes more modularized, it is important for libvirt to advertise availability of the modularized functionality through capabilities. This change adds channel devices to domain capabilities, allowing clients such as virt-install to avoid using spicevmc channel devices when not supported by the target qemu.
Signed-off-by: Jim Fehlig <jfehlig@suse.com> --- docs/formatdomaincaps.rst | 24 +++++++++++++++++++ src/conf/domain_capabilities.c | 13 ++++++++++ src/conf/domain_capabilities.h | 8 +++++++ src/conf/schemas/domaincaps.rng | 10 ++++++++ src/qemu/qemu_capabilities.c | 16 +++++++++++++ src/qemu/qemu_capabilities.h | 3 +++ .../domaincapsdata/qemu_4.2.0-q35.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_4.2.0-tcg.x86_64.xml | 7 ++++++ .../qemu_4.2.0-virt.aarch64.xml | 6 +++++ tests/domaincapsdata/qemu_4.2.0.aarch64.xml | 6 +++++ tests/domaincapsdata/qemu_4.2.0.ppc64.xml | 6 +++++ tests/domaincapsdata/qemu_4.2.0.s390x.xml | 6 +++++ tests/domaincapsdata/qemu_4.2.0.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_5.0.0-q35.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_5.0.0-tcg.x86_64.xml | 7 ++++++ .../qemu_5.0.0-virt.aarch64.xml | 6 +++++ tests/domaincapsdata/qemu_5.0.0.aarch64.xml | 6 +++++ tests/domaincapsdata/qemu_5.0.0.ppc64.xml | 6 +++++ tests/domaincapsdata/qemu_5.0.0.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_5.1.0-q35.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_5.1.0-tcg.x86_64.xml | 7 ++++++ tests/domaincapsdata/qemu_5.1.0.sparc.xml | 7 ++++++ tests/domaincapsdata/qemu_5.1.0.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_5.2.0-q35.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_5.2.0-tcg.x86_64.xml | 7 ++++++ .../qemu_5.2.0-virt.aarch64.xml | 6 +++++ tests/domaincapsdata/qemu_5.2.0.aarch64.xml | 6 +++++ tests/domaincapsdata/qemu_5.2.0.ppc64.xml | 6 +++++ tests/domaincapsdata/qemu_5.2.0.s390x.xml | 6 +++++ tests/domaincapsdata/qemu_5.2.0.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_6.0.0-q35.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_6.0.0-tcg.x86_64.xml | 7 ++++++ .../qemu_6.0.0-virt.aarch64.xml | 6 +++++ tests/domaincapsdata/qemu_6.0.0.aarch64.xml | 6 +++++ tests/domaincapsdata/qemu_6.0.0.s390x.xml | 6 +++++ tests/domaincapsdata/qemu_6.0.0.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_6.1.0-q35.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_6.1.0-tcg.x86_64.xml | 7 ++++++ tests/domaincapsdata/qemu_6.1.0.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_6.2.0-q35.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_6.2.0-tcg.x86_64.xml | 7 ++++++ .../qemu_6.2.0-virt.aarch64.xml | 7 ++++++ tests/domaincapsdata/qemu_6.2.0.aarch64.xml | 7 ++++++ tests/domaincapsdata/qemu_6.2.0.ppc64.xml | 6 +++++ tests/domaincapsdata/qemu_6.2.0.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_7.0.0-q35.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_7.0.0-tcg.x86_64.xml | 7 ++++++ .../qemu_7.0.0-virt.aarch64.xml | 7 ++++++ tests/domaincapsdata/qemu_7.0.0.aarch64.xml | 7 ++++++ tests/domaincapsdata/qemu_7.0.0.ppc64.xml | 6 +++++ tests/domaincapsdata/qemu_7.0.0.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_7.1.0-q35.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_7.1.0-tcg.x86_64.xml | 7 ++++++ tests/domaincapsdata/qemu_7.1.0.x86_64.xml | 7 ++++++ .../caps_4.2.0.x86_64.xml | 1 + .../caps_5.0.0.riscv64.xml | 1 + .../caps_5.0.0.x86_64.xml | 1 + .../qemucapabilitiesdata/caps_5.1.0.sparc.xml | 1 + .../caps_5.1.0.x86_64.xml | 1 + .../caps_5.2.0.riscv64.xml | 1 + .../caps_5.2.0.x86_64.xml | 1 + .../caps_6.0.0.x86_64.xml | 1 + .../caps_6.1.0.x86_64.xml | 1 + .../caps_6.2.0.aarch64.xml | 1 + .../caps_6.2.0.x86_64.xml | 1 + .../caps_7.0.0.aarch64.xml | 1 + .../caps_7.0.0.x86_64.xml | 1 + .../caps_7.1.0.x86_64.xml | 1 + 68 files changed, 408 insertions(+)
diff --git a/docs/formatdomaincaps.rst b/docs/formatdomaincaps.rst index 93d36f2702..f95d3a7083 100644 --- a/docs/formatdomaincaps.rst +++ b/docs/formatdomaincaps.rst @@ -565,6 +565,30 @@ USB redirdev device capabilities are exposed under the ``redirdev`` element. For ``bus`` Options for the ``bus`` attribute of the ``<redirdev/>`` element.
+Channel device +^^^^^^^^^^^^^^ + +Channel device capabilities are exposed under the ``channel`` element. For instance: + +:: + + <domainCapabilities> + ... + <devices> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + <value>spicevmc</value> + </enum> + </channel + ... + </devices> + </domainCapabilities> + +``type`` + Options for the ``type`` attribute of the ``<channel/>`` element. + Features ~~~~~~~~
diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index f8b2f88376..a7f256e4ec 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -574,6 +574,18 @@ virDomainCapsDeviceRedirdevFormat(virBuffer *buf, }
+static void +virDomainCapsDeviceChannelFormat(virBuffer *buf, + const virDomainCapsDeviceChannel *channel) +{ + FORMAT_PROLOGUE(channel); + + ENUM_PROCESS(channel, type, virDomainChrTypeToString); + + FORMAT_EPILOGUE(channel); +} + + /** * virDomainCapsFeatureGICFormat: * @buf: target buffer @@ -688,6 +700,7 @@ virDomainCapsFormat(const virDomainCaps *caps) virDomainCapsDeviceFilesystemFormat(&buf, &caps->filesystem); virDomainCapsDeviceTPMFormat(&buf, &caps->tpm); virDomainCapsDeviceRedirdevFormat(&buf, &caps->redirdev); + virDomainCapsDeviceChannelFormat(&buf, &caps->channel);
virBufferAdjustIndent(&buf, -2); virBufferAddLit(&buf, "</devices>\n"); diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h index ba7c2a5e42..e0cfa75531 100644 --- a/src/conf/domain_capabilities.h +++ b/src/conf/domain_capabilities.h @@ -137,6 +137,13 @@ struct _virDomainCapsDeviceRedirdev { virDomainCapsEnum bus; /* virDomainRedirdevBus */ };
+STATIC_ASSERT_ENUM(VIR_DOMAIN_CHR_TYPE_LAST); +typedef struct _virDomainCapsDeviceChannel virDomainCapsDeviceChannel; +struct _virDomainCapsDeviceChannel { + virTristateBool supported; + virDomainCapsEnum type; /* virDomainChrType */ +}; + STATIC_ASSERT_ENUM(VIR_DOMAIN_FS_DRIVER_TYPE_LAST); typedef struct _virDomainCapsDeviceFilesystem virDomainCapsDeviceFilesystem; struct _virDomainCapsDeviceFilesystem { @@ -234,6 +241,7 @@ struct _virDomainCaps { virDomainCapsDeviceFilesystem filesystem; virDomainCapsDeviceTPM tpm; virDomainCapsDeviceRedirdev redirdev; + virDomainCapsDeviceChannel channel; /* add new domain devices here */
virDomainCapsFeatureGIC gic; diff --git a/src/conf/schemas/domaincaps.rng b/src/conf/schemas/domaincaps.rng index cf7a1d1d89..a6747b20ef 100644 --- a/src/conf/schemas/domaincaps.rng +++ b/src/conf/schemas/domaincaps.rng @@ -201,6 +201,9 @@ <optional> <ref name="redirdev"/> </optional> + <optional> + <ref name="channel"/> + </optional> </element> </define>
@@ -260,6 +263,13 @@ </element> </define>
+ <define name="channel"> + <element name="channel"> + <ref name="supported"/> + <ref name="enum"/> + </element> + </define> + <define name="features"> <element name="features"> <optional> diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 5a664ec628..98849daf4c 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1392,6 +1392,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { { "s390-pv-guest", QEMU_CAPS_S390_PV_GUEST }, { "virtio-mem-pci", QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI }, { "virtio-iommu-pci", QEMU_CAPS_DEVICE_VIRTIO_IOMMU_PCI }, + { "chardev-spicevmc", X_QEMU_CAPS_CHARDEV_SPICEVMC },
The X_ prefix means that the capability was retired beause we are sure QEMU has it, always. Or another capability reflects the same. In this specific case I'd say QEMU_CAPS_SPICE is sufficient.
};
Michal

On 10/13/22 09:46, Michal Prívozník wrote:
On 10/13/22 01:24, Jim Fehlig wrote:
As qemu becomes more modularized, it is important for libvirt to advertise availability of the modularized functionality through capabilities. This change adds channel devices to domain capabilities, allowing clients such as virt-install to avoid using spicevmc channel devices when not supported by the target qemu.
Signed-off-by: Jim Fehlig <jfehlig@suse.com> --- docs/formatdomaincaps.rst | 24 +++++++++++++++++++ src/conf/domain_capabilities.c | 13 ++++++++++ src/conf/domain_capabilities.h | 8 +++++++ src/conf/schemas/domaincaps.rng | 10 ++++++++ src/qemu/qemu_capabilities.c | 16 +++++++++++++ src/qemu/qemu_capabilities.h | 3 +++ .../domaincapsdata/qemu_4.2.0-q35.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_4.2.0-tcg.x86_64.xml | 7 ++++++ .../qemu_4.2.0-virt.aarch64.xml | 6 +++++ tests/domaincapsdata/qemu_4.2.0.aarch64.xml | 6 +++++ tests/domaincapsdata/qemu_4.2.0.ppc64.xml | 6 +++++ tests/domaincapsdata/qemu_4.2.0.s390x.xml | 6 +++++ tests/domaincapsdata/qemu_4.2.0.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_5.0.0-q35.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_5.0.0-tcg.x86_64.xml | 7 ++++++ .../qemu_5.0.0-virt.aarch64.xml | 6 +++++ tests/domaincapsdata/qemu_5.0.0.aarch64.xml | 6 +++++ tests/domaincapsdata/qemu_5.0.0.ppc64.xml | 6 +++++ tests/domaincapsdata/qemu_5.0.0.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_5.1.0-q35.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_5.1.0-tcg.x86_64.xml | 7 ++++++ tests/domaincapsdata/qemu_5.1.0.sparc.xml | 7 ++++++ tests/domaincapsdata/qemu_5.1.0.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_5.2.0-q35.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_5.2.0-tcg.x86_64.xml | 7 ++++++ .../qemu_5.2.0-virt.aarch64.xml | 6 +++++ tests/domaincapsdata/qemu_5.2.0.aarch64.xml | 6 +++++ tests/domaincapsdata/qemu_5.2.0.ppc64.xml | 6 +++++ tests/domaincapsdata/qemu_5.2.0.s390x.xml | 6 +++++ tests/domaincapsdata/qemu_5.2.0.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_6.0.0-q35.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_6.0.0-tcg.x86_64.xml | 7 ++++++ .../qemu_6.0.0-virt.aarch64.xml | 6 +++++ tests/domaincapsdata/qemu_6.0.0.aarch64.xml | 6 +++++ tests/domaincapsdata/qemu_6.0.0.s390x.xml | 6 +++++ tests/domaincapsdata/qemu_6.0.0.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_6.1.0-q35.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_6.1.0-tcg.x86_64.xml | 7 ++++++ tests/domaincapsdata/qemu_6.1.0.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_6.2.0-q35.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_6.2.0-tcg.x86_64.xml | 7 ++++++ .../qemu_6.2.0-virt.aarch64.xml | 7 ++++++ tests/domaincapsdata/qemu_6.2.0.aarch64.xml | 7 ++++++ tests/domaincapsdata/qemu_6.2.0.ppc64.xml | 6 +++++ tests/domaincapsdata/qemu_6.2.0.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_7.0.0-q35.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_7.0.0-tcg.x86_64.xml | 7 ++++++ .../qemu_7.0.0-virt.aarch64.xml | 7 ++++++ tests/domaincapsdata/qemu_7.0.0.aarch64.xml | 7 ++++++ tests/domaincapsdata/qemu_7.0.0.ppc64.xml | 6 +++++ tests/domaincapsdata/qemu_7.0.0.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_7.1.0-q35.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_7.1.0-tcg.x86_64.xml | 7 ++++++ tests/domaincapsdata/qemu_7.1.0.x86_64.xml | 7 ++++++ .../caps_4.2.0.x86_64.xml | 1 + .../caps_5.0.0.riscv64.xml | 1 + .../caps_5.0.0.x86_64.xml | 1 + .../qemucapabilitiesdata/caps_5.1.0.sparc.xml | 1 + .../caps_5.1.0.x86_64.xml | 1 + .../caps_5.2.0.riscv64.xml | 1 + .../caps_5.2.0.x86_64.xml | 1 + .../caps_6.0.0.x86_64.xml | 1 + .../caps_6.1.0.x86_64.xml | 1 + .../caps_6.2.0.aarch64.xml | 1 + .../caps_6.2.0.x86_64.xml | 1 + .../caps_7.0.0.aarch64.xml | 1 + .../caps_7.0.0.x86_64.xml | 1 + .../caps_7.1.0.x86_64.xml | 1 + 68 files changed, 408 insertions(+)
diff --git a/docs/formatdomaincaps.rst b/docs/formatdomaincaps.rst index 93d36f2702..f95d3a7083 100644 --- a/docs/formatdomaincaps.rst +++ b/docs/formatdomaincaps.rst @@ -565,6 +565,30 @@ USB redirdev device capabilities are exposed under the ``redirdev`` element. For ``bus`` Options for the ``bus`` attribute of the ``<redirdev/>`` element.
+Channel device +^^^^^^^^^^^^^^ + +Channel device capabilities are exposed under the ``channel`` element. For instance: + +:: + + <domainCapabilities> + ... + <devices> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + <value>spicevmc</value> + </enum> + </channel + ... + </devices> + </domainCapabilities> + +``type`` + Options for the ``type`` attribute of the ``<channel/>`` element. + Features ~~~~~~~~
diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index f8b2f88376..a7f256e4ec 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -574,6 +574,18 @@ virDomainCapsDeviceRedirdevFormat(virBuffer *buf, }
+static void +virDomainCapsDeviceChannelFormat(virBuffer *buf, + const virDomainCapsDeviceChannel *channel) +{ + FORMAT_PROLOGUE(channel); + + ENUM_PROCESS(channel, type, virDomainChrTypeToString); + + FORMAT_EPILOGUE(channel); +} + + /** * virDomainCapsFeatureGICFormat: * @buf: target buffer @@ -688,6 +700,7 @@ virDomainCapsFormat(const virDomainCaps *caps) virDomainCapsDeviceFilesystemFormat(&buf, &caps->filesystem); virDomainCapsDeviceTPMFormat(&buf, &caps->tpm); virDomainCapsDeviceRedirdevFormat(&buf, &caps->redirdev); + virDomainCapsDeviceChannelFormat(&buf, &caps->channel);
virBufferAdjustIndent(&buf, -2); virBufferAddLit(&buf, "</devices>\n"); diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h index ba7c2a5e42..e0cfa75531 100644 --- a/src/conf/domain_capabilities.h +++ b/src/conf/domain_capabilities.h @@ -137,6 +137,13 @@ struct _virDomainCapsDeviceRedirdev { virDomainCapsEnum bus; /* virDomainRedirdevBus */ };
+STATIC_ASSERT_ENUM(VIR_DOMAIN_CHR_TYPE_LAST); +typedef struct _virDomainCapsDeviceChannel virDomainCapsDeviceChannel; +struct _virDomainCapsDeviceChannel { + virTristateBool supported; + virDomainCapsEnum type; /* virDomainChrType */ +}; + STATIC_ASSERT_ENUM(VIR_DOMAIN_FS_DRIVER_TYPE_LAST); typedef struct _virDomainCapsDeviceFilesystem virDomainCapsDeviceFilesystem; struct _virDomainCapsDeviceFilesystem { @@ -234,6 +241,7 @@ struct _virDomainCaps { virDomainCapsDeviceFilesystem filesystem; virDomainCapsDeviceTPM tpm; virDomainCapsDeviceRedirdev redirdev; + virDomainCapsDeviceChannel channel; /* add new domain devices here */
virDomainCapsFeatureGIC gic; diff --git a/src/conf/schemas/domaincaps.rng b/src/conf/schemas/domaincaps.rng index cf7a1d1d89..a6747b20ef 100644 --- a/src/conf/schemas/domaincaps.rng +++ b/src/conf/schemas/domaincaps.rng @@ -201,6 +201,9 @@ <optional> <ref name="redirdev"/> </optional> + <optional> + <ref name="channel"/> + </optional> </element> </define>
@@ -260,6 +263,13 @@ </element> </define>
+ <define name="channel"> + <element name="channel"> + <ref name="supported"/> + <ref name="enum"/> + </element> + </define> + <define name="features"> <element name="features"> <optional> diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 5a664ec628..98849daf4c 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1392,6 +1392,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { { "s390-pv-guest", QEMU_CAPS_S390_PV_GUEST }, { "virtio-mem-pci", QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI }, { "virtio-iommu-pci", QEMU_CAPS_DEVICE_VIRTIO_IOMMU_PCI }, + { "chardev-spicevmc", X_QEMU_CAPS_CHARDEV_SPICEVMC },
The X_ prefix means that the capability was retired beause we are sure QEMU has it, always. Or another capability reflects the same. In this specific case I'd say QEMU_CAPS_SPICE is sufficient.
If you mean s/X_QEMU_CAPS_CHARDEV_SPICEVMC/QEMU_CAPS_SPICE/, it doesn't work. 'spicevmc' is not shown as a supported channel type in domcapabilities. I thought it was safe to use the X_ variant since it is already included in CapsFlags https://gitlab.com/libvirt/libvirt/-/blob/master/src/qemu/qemu_capabilities.... Regards, Jim

On 10/13/22 22:18, Jim Fehlig wrote:
On 10/13/22 09:46, Michal Prívozník wrote:
On 10/13/22 01:24, Jim Fehlig wrote:
As qemu becomes more modularized, it is important for libvirt to advertise availability of the modularized functionality through capabilities. This change adds channel devices to domain capabilities, allowing clients such as virt-install to avoid using spicevmc channel devices when not supported by the target qemu.
Signed-off-by: Jim Fehlig <jfehlig@suse.com> --- docs/formatdomaincaps.rst | 24 +++++++++++++++++++ src/conf/domain_capabilities.c | 13 ++++++++++ src/conf/domain_capabilities.h | 8 +++++++ src/conf/schemas/domaincaps.rng | 10 ++++++++ src/qemu/qemu_capabilities.c | 16 +++++++++++++ src/qemu/qemu_capabilities.h | 3 +++ .../domaincapsdata/qemu_4.2.0-q35.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_4.2.0-tcg.x86_64.xml | 7 ++++++ .../qemu_4.2.0-virt.aarch64.xml | 6 +++++ tests/domaincapsdata/qemu_4.2.0.aarch64.xml | 6 +++++ tests/domaincapsdata/qemu_4.2.0.ppc64.xml | 6 +++++ tests/domaincapsdata/qemu_4.2.0.s390x.xml | 6 +++++ tests/domaincapsdata/qemu_4.2.0.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_5.0.0-q35.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_5.0.0-tcg.x86_64.xml | 7 ++++++ .../qemu_5.0.0-virt.aarch64.xml | 6 +++++ tests/domaincapsdata/qemu_5.0.0.aarch64.xml | 6 +++++ tests/domaincapsdata/qemu_5.0.0.ppc64.xml | 6 +++++ tests/domaincapsdata/qemu_5.0.0.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_5.1.0-q35.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_5.1.0-tcg.x86_64.xml | 7 ++++++ tests/domaincapsdata/qemu_5.1.0.sparc.xml | 7 ++++++ tests/domaincapsdata/qemu_5.1.0.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_5.2.0-q35.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_5.2.0-tcg.x86_64.xml | 7 ++++++ .../qemu_5.2.0-virt.aarch64.xml | 6 +++++ tests/domaincapsdata/qemu_5.2.0.aarch64.xml | 6 +++++ tests/domaincapsdata/qemu_5.2.0.ppc64.xml | 6 +++++ tests/domaincapsdata/qemu_5.2.0.s390x.xml | 6 +++++ tests/domaincapsdata/qemu_5.2.0.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_6.0.0-q35.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_6.0.0-tcg.x86_64.xml | 7 ++++++ .../qemu_6.0.0-virt.aarch64.xml | 6 +++++ tests/domaincapsdata/qemu_6.0.0.aarch64.xml | 6 +++++ tests/domaincapsdata/qemu_6.0.0.s390x.xml | 6 +++++ tests/domaincapsdata/qemu_6.0.0.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_6.1.0-q35.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_6.1.0-tcg.x86_64.xml | 7 ++++++ tests/domaincapsdata/qemu_6.1.0.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_6.2.0-q35.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_6.2.0-tcg.x86_64.xml | 7 ++++++ .../qemu_6.2.0-virt.aarch64.xml | 7 ++++++ tests/domaincapsdata/qemu_6.2.0.aarch64.xml | 7 ++++++ tests/domaincapsdata/qemu_6.2.0.ppc64.xml | 6 +++++ tests/domaincapsdata/qemu_6.2.0.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_7.0.0-q35.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_7.0.0-tcg.x86_64.xml | 7 ++++++ .../qemu_7.0.0-virt.aarch64.xml | 7 ++++++ tests/domaincapsdata/qemu_7.0.0.aarch64.xml | 7 ++++++ tests/domaincapsdata/qemu_7.0.0.ppc64.xml | 6 +++++ tests/domaincapsdata/qemu_7.0.0.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_7.1.0-q35.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_7.1.0-tcg.x86_64.xml | 7 ++++++ tests/domaincapsdata/qemu_7.1.0.x86_64.xml | 7 ++++++ .../caps_4.2.0.x86_64.xml | 1 + .../caps_5.0.0.riscv64.xml | 1 + .../caps_5.0.0.x86_64.xml | 1 + .../qemucapabilitiesdata/caps_5.1.0.sparc.xml | 1 + .../caps_5.1.0.x86_64.xml | 1 + .../caps_5.2.0.riscv64.xml | 1 + .../caps_5.2.0.x86_64.xml | 1 + .../caps_6.0.0.x86_64.xml | 1 + .../caps_6.1.0.x86_64.xml | 1 + .../caps_6.2.0.aarch64.xml | 1 + .../caps_6.2.0.x86_64.xml | 1 + .../caps_7.0.0.aarch64.xml | 1 + .../caps_7.0.0.x86_64.xml | 1 + .../caps_7.1.0.x86_64.xml | 1 + 68 files changed, 408 insertions(+)
diff --git a/docs/formatdomaincaps.rst b/docs/formatdomaincaps.rst index 93d36f2702..f95d3a7083 100644 --- a/docs/formatdomaincaps.rst +++ b/docs/formatdomaincaps.rst @@ -565,6 +565,30 @@ USB redirdev device capabilities are exposed under the ``redirdev`` element. For ``bus`` Options for the ``bus`` attribute of the ``<redirdev/>`` element. +Channel device +^^^^^^^^^^^^^^ + +Channel device capabilities are exposed under the ``channel`` element. For instance: + +:: + + <domainCapabilities> + ... + <devices> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + <value>spicevmc</value> + </enum> + </channel + ... + </devices> + </domainCapabilities> + +``type`` + Options for the ``type`` attribute of the ``<channel/>`` element. + Features ~~~~~~~~ diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index f8b2f88376..a7f256e4ec 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -574,6 +574,18 @@ virDomainCapsDeviceRedirdevFormat(virBuffer *buf, } +static void +virDomainCapsDeviceChannelFormat(virBuffer *buf, + const virDomainCapsDeviceChannel *channel) +{ + FORMAT_PROLOGUE(channel); + + ENUM_PROCESS(channel, type, virDomainChrTypeToString); + + FORMAT_EPILOGUE(channel); +} + + /** * virDomainCapsFeatureGICFormat: * @buf: target buffer @@ -688,6 +700,7 @@ virDomainCapsFormat(const virDomainCaps *caps) virDomainCapsDeviceFilesystemFormat(&buf, &caps->filesystem); virDomainCapsDeviceTPMFormat(&buf, &caps->tpm); virDomainCapsDeviceRedirdevFormat(&buf, &caps->redirdev); + virDomainCapsDeviceChannelFormat(&buf, &caps->channel); virBufferAdjustIndent(&buf, -2); virBufferAddLit(&buf, "</devices>\n"); diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h index ba7c2a5e42..e0cfa75531 100644 --- a/src/conf/domain_capabilities.h +++ b/src/conf/domain_capabilities.h @@ -137,6 +137,13 @@ struct _virDomainCapsDeviceRedirdev { virDomainCapsEnum bus; /* virDomainRedirdevBus */ }; +STATIC_ASSERT_ENUM(VIR_DOMAIN_CHR_TYPE_LAST); +typedef struct _virDomainCapsDeviceChannel virDomainCapsDeviceChannel; +struct _virDomainCapsDeviceChannel { + virTristateBool supported; + virDomainCapsEnum type; /* virDomainChrType */ +}; + STATIC_ASSERT_ENUM(VIR_DOMAIN_FS_DRIVER_TYPE_LAST); typedef struct _virDomainCapsDeviceFilesystem virDomainCapsDeviceFilesystem; struct _virDomainCapsDeviceFilesystem { @@ -234,6 +241,7 @@ struct _virDomainCaps { virDomainCapsDeviceFilesystem filesystem; virDomainCapsDeviceTPM tpm; virDomainCapsDeviceRedirdev redirdev; + virDomainCapsDeviceChannel channel; /* add new domain devices here */ virDomainCapsFeatureGIC gic; diff --git a/src/conf/schemas/domaincaps.rng b/src/conf/schemas/domaincaps.rng index cf7a1d1d89..a6747b20ef 100644 --- a/src/conf/schemas/domaincaps.rng +++ b/src/conf/schemas/domaincaps.rng @@ -201,6 +201,9 @@ <optional> <ref name="redirdev"/> </optional> + <optional> + <ref name="channel"/> + </optional> </element> </define> @@ -260,6 +263,13 @@ </element> </define> + <define name="channel"> + <element name="channel"> + <ref name="supported"/> + <ref name="enum"/> + </element> + </define> + <define name="features"> <element name="features"> <optional> diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 5a664ec628..98849daf4c 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1392,6 +1392,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { { "s390-pv-guest", QEMU_CAPS_S390_PV_GUEST }, { "virtio-mem-pci", QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI }, { "virtio-iommu-pci", QEMU_CAPS_DEVICE_VIRTIO_IOMMU_PCI }, + { "chardev-spicevmc", X_QEMU_CAPS_CHARDEV_SPICEVMC },
The X_ prefix means that the capability was retired beause we are sure QEMU has it, always. Or another capability reflects the same. In this specific case I'd say QEMU_CAPS_SPICE is sufficient.
If you mean s/X_QEMU_CAPS_CHARDEV_SPICEVMC/QEMU_CAPS_SPICE/, it doesn't work. 'spicevmc' is not shown as a supported channel type in domcapabilities.
I thought more like: diff --git i/src/qemu/qemu_capabilities.c w/src/qemu/qemu_capabilities.c index 98849daf4c..c2f6de9363 100644 --- i/src/qemu/qemu_capabilities.c +++ w/src/qemu/qemu_capabilities.c @@ -1392,7 +1392,6 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { { "s390-pv-guest", QEMU_CAPS_S390_PV_GUEST }, { "virtio-mem-pci", QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI }, { "virtio-iommu-pci", QEMU_CAPS_DEVICE_VIRTIO_IOMMU_PCI }, - { "chardev-spicevmc", X_QEMU_CAPS_CHARDEV_SPICEVMC }, }; @@ -6357,7 +6356,7 @@ virQEMUCapsFillDomainDeviceChannelCaps(virQEMUCaps *qemuCaps, VIR_DOMAIN_CAPS_ENUM_SET(channel->type, VIR_DOMAIN_CHR_TYPE_PTY, VIR_DOMAIN_CHR_TYPE_UNIX); - if (virQEMUCapsGet(qemuCaps, X_QEMU_CAPS_CHARDEV_SPICEVMC)) + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_SPICE)) VIR_DOMAIN_CAPS_ENUM_SET(channel->type, VIR_DOMAIN_CHR_TYPE_SPICEVMC); } (diff against this patch, minus qemucapabilitiessdata/ modifications) This renders the same result as your patch. At least according to our test suite.
I thought it was safe to use the X_ variant since it is already included in CapsFlags
https://gitlab.com/libvirt/libvirt/-/blob/master/src/qemu/qemu_capabilities....
Well, define safe :-) It is safe in a sense that we can introduce capabilities as we please, because we have this cache mechanism that makes libvirt requery caps when needed. And let's leave migration aside for a moment. But, it's not desirable when we already have a capability that reflects the same information. In other words, the commit that retired QEMU_CAPS_CHARDEV_SPICEVMC (v4.3.0-rc1~322) claims, that qemu-1.2.0 and newer do support -chardev spicevmc. What's not written in the commit message (and probably should), is that it's enough for us to rely on QEMU_CAPS_SPICE. But this can be seen in the code (if you know where to look, which I admit is not developer friendly): 1) qemuValidateDomainChrSourceDef() makes sure that if there's VIR_DOMAIN_CHR_TYPE_SPICEVMC in the domain XML there's also <graphics type='spice'/>, then 2) qemuValidateDomainDeviceDefGraphics() makes sure that if there's spice graphics in the domain XML, QEMU has QEMU_CAPS_SPICE. Let me break down step 2 a bit more, because it's obfuscated a bit (in pursuit of code deduplication). The virQEMUCapsFillDomainDeviceGraphicsCaps() is called, which fills a portion of domaincaps with supported graphics types (by looking at qemuCaps), and then VIR_DOMAIN_CAPS_ENUM_IS_SET() checks whether VIR_DOMAIN_GRAPHICS_TYPE_SPICE was set in the domaincaps. And indeed, looking into qemu's code base (chardev/meson.build): if spice.found() module_ss = ss.source_set() module_ss.add(when: [spice], if_true: files('spice.c')) chardev_modules += { 'spice': module_ss } endif So it seems that spicevmc can't be compiled out and is available whenever spice is. The reason we had that capability was that as qemu/spice gained new features, there was a time when spice was available in qemu but spicevmc wasn't. But no qemu we support now (4.2.0 and newer - see QEMU_MIN_MAJOR and friends in qemu_capabilities.c) allows such situation. I hope this helps. Michal

On 10/14/22 01:05, Michal Prívozník wrote:
On 10/13/22 22:18, Jim Fehlig wrote:
On 10/13/22 09:46, Michal Prívozník wrote:
On 10/13/22 01:24, Jim Fehlig wrote:
As qemu becomes more modularized, it is important for libvirt to advertise availability of the modularized functionality through capabilities. This change adds channel devices to domain capabilities, allowing clients such as virt-install to avoid using spicevmc channel devices when not supported by the target qemu.
Signed-off-by: Jim Fehlig <jfehlig@suse.com> --- docs/formatdomaincaps.rst | 24 +++++++++++++++++++ src/conf/domain_capabilities.c | 13 ++++++++++ src/conf/domain_capabilities.h | 8 +++++++ src/conf/schemas/domaincaps.rng | 10 ++++++++ src/qemu/qemu_capabilities.c | 16 +++++++++++++ src/qemu/qemu_capabilities.h | 3 +++ .../domaincapsdata/qemu_4.2.0-q35.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_4.2.0-tcg.x86_64.xml | 7 ++++++ .../qemu_4.2.0-virt.aarch64.xml | 6 +++++ tests/domaincapsdata/qemu_4.2.0.aarch64.xml | 6 +++++ tests/domaincapsdata/qemu_4.2.0.ppc64.xml | 6 +++++ tests/domaincapsdata/qemu_4.2.0.s390x.xml | 6 +++++ tests/domaincapsdata/qemu_4.2.0.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_5.0.0-q35.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_5.0.0-tcg.x86_64.xml | 7 ++++++ .../qemu_5.0.0-virt.aarch64.xml | 6 +++++ tests/domaincapsdata/qemu_5.0.0.aarch64.xml | 6 +++++ tests/domaincapsdata/qemu_5.0.0.ppc64.xml | 6 +++++ tests/domaincapsdata/qemu_5.0.0.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_5.1.0-q35.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_5.1.0-tcg.x86_64.xml | 7 ++++++ tests/domaincapsdata/qemu_5.1.0.sparc.xml | 7 ++++++ tests/domaincapsdata/qemu_5.1.0.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_5.2.0-q35.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_5.2.0-tcg.x86_64.xml | 7 ++++++ .../qemu_5.2.0-virt.aarch64.xml | 6 +++++ tests/domaincapsdata/qemu_5.2.0.aarch64.xml | 6 +++++ tests/domaincapsdata/qemu_5.2.0.ppc64.xml | 6 +++++ tests/domaincapsdata/qemu_5.2.0.s390x.xml | 6 +++++ tests/domaincapsdata/qemu_5.2.0.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_6.0.0-q35.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_6.0.0-tcg.x86_64.xml | 7 ++++++ .../qemu_6.0.0-virt.aarch64.xml | 6 +++++ tests/domaincapsdata/qemu_6.0.0.aarch64.xml | 6 +++++ tests/domaincapsdata/qemu_6.0.0.s390x.xml | 6 +++++ tests/domaincapsdata/qemu_6.0.0.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_6.1.0-q35.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_6.1.0-tcg.x86_64.xml | 7 ++++++ tests/domaincapsdata/qemu_6.1.0.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_6.2.0-q35.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_6.2.0-tcg.x86_64.xml | 7 ++++++ .../qemu_6.2.0-virt.aarch64.xml | 7 ++++++ tests/domaincapsdata/qemu_6.2.0.aarch64.xml | 7 ++++++ tests/domaincapsdata/qemu_6.2.0.ppc64.xml | 6 +++++ tests/domaincapsdata/qemu_6.2.0.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_7.0.0-q35.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_7.0.0-tcg.x86_64.xml | 7 ++++++ .../qemu_7.0.0-virt.aarch64.xml | 7 ++++++ tests/domaincapsdata/qemu_7.0.0.aarch64.xml | 7 ++++++ tests/domaincapsdata/qemu_7.0.0.ppc64.xml | 6 +++++ tests/domaincapsdata/qemu_7.0.0.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_7.1.0-q35.x86_64.xml | 7 ++++++ .../domaincapsdata/qemu_7.1.0-tcg.x86_64.xml | 7 ++++++ tests/domaincapsdata/qemu_7.1.0.x86_64.xml | 7 ++++++ .../caps_4.2.0.x86_64.xml | 1 + .../caps_5.0.0.riscv64.xml | 1 + .../caps_5.0.0.x86_64.xml | 1 + .../qemucapabilitiesdata/caps_5.1.0.sparc.xml | 1 + .../caps_5.1.0.x86_64.xml | 1 + .../caps_5.2.0.riscv64.xml | 1 + .../caps_5.2.0.x86_64.xml | 1 + .../caps_6.0.0.x86_64.xml | 1 + .../caps_6.1.0.x86_64.xml | 1 + .../caps_6.2.0.aarch64.xml | 1 + .../caps_6.2.0.x86_64.xml | 1 + .../caps_7.0.0.aarch64.xml | 1 + .../caps_7.0.0.x86_64.xml | 1 + .../caps_7.1.0.x86_64.xml | 1 + 68 files changed, 408 insertions(+)
diff --git a/docs/formatdomaincaps.rst b/docs/formatdomaincaps.rst index 93d36f2702..f95d3a7083 100644 --- a/docs/formatdomaincaps.rst +++ b/docs/formatdomaincaps.rst @@ -565,6 +565,30 @@ USB redirdev device capabilities are exposed under the ``redirdev`` element. For ``bus`` Options for the ``bus`` attribute of the ``<redirdev/>`` element. +Channel device +^^^^^^^^^^^^^^ + +Channel device capabilities are exposed under the ``channel`` element. For instance: + +:: + + <domainCapabilities> + ... + <devices> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + <value>spicevmc</value> + </enum> + </channel + ... + </devices> + </domainCapabilities> + +``type`` + Options for the ``type`` attribute of the ``<channel/>`` element. + Features ~~~~~~~~ diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index f8b2f88376..a7f256e4ec 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -574,6 +574,18 @@ virDomainCapsDeviceRedirdevFormat(virBuffer *buf, } +static void +virDomainCapsDeviceChannelFormat(virBuffer *buf, + const virDomainCapsDeviceChannel *channel) +{ + FORMAT_PROLOGUE(channel); + + ENUM_PROCESS(channel, type, virDomainChrTypeToString); + + FORMAT_EPILOGUE(channel); +} + + /** * virDomainCapsFeatureGICFormat: * @buf: target buffer @@ -688,6 +700,7 @@ virDomainCapsFormat(const virDomainCaps *caps) virDomainCapsDeviceFilesystemFormat(&buf, &caps->filesystem); virDomainCapsDeviceTPMFormat(&buf, &caps->tpm); virDomainCapsDeviceRedirdevFormat(&buf, &caps->redirdev); + virDomainCapsDeviceChannelFormat(&buf, &caps->channel); virBufferAdjustIndent(&buf, -2); virBufferAddLit(&buf, "</devices>\n"); diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h index ba7c2a5e42..e0cfa75531 100644 --- a/src/conf/domain_capabilities.h +++ b/src/conf/domain_capabilities.h @@ -137,6 +137,13 @@ struct _virDomainCapsDeviceRedirdev { virDomainCapsEnum bus; /* virDomainRedirdevBus */ }; +STATIC_ASSERT_ENUM(VIR_DOMAIN_CHR_TYPE_LAST); +typedef struct _virDomainCapsDeviceChannel virDomainCapsDeviceChannel; +struct _virDomainCapsDeviceChannel { + virTristateBool supported; + virDomainCapsEnum type; /* virDomainChrType */ +}; + STATIC_ASSERT_ENUM(VIR_DOMAIN_FS_DRIVER_TYPE_LAST); typedef struct _virDomainCapsDeviceFilesystem virDomainCapsDeviceFilesystem; struct _virDomainCapsDeviceFilesystem { @@ -234,6 +241,7 @@ struct _virDomainCaps { virDomainCapsDeviceFilesystem filesystem; virDomainCapsDeviceTPM tpm; virDomainCapsDeviceRedirdev redirdev; + virDomainCapsDeviceChannel channel; /* add new domain devices here */ virDomainCapsFeatureGIC gic; diff --git a/src/conf/schemas/domaincaps.rng b/src/conf/schemas/domaincaps.rng index cf7a1d1d89..a6747b20ef 100644 --- a/src/conf/schemas/domaincaps.rng +++ b/src/conf/schemas/domaincaps.rng @@ -201,6 +201,9 @@ <optional> <ref name="redirdev"/> </optional> + <optional> + <ref name="channel"/> + </optional> </element> </define> @@ -260,6 +263,13 @@ </element> </define> + <define name="channel"> + <element name="channel"> + <ref name="supported"/> + <ref name="enum"/> + </element> + </define> + <define name="features"> <element name="features"> <optional> diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 5a664ec628..98849daf4c 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1392,6 +1392,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { { "s390-pv-guest", QEMU_CAPS_S390_PV_GUEST }, { "virtio-mem-pci", QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI }, { "virtio-iommu-pci", QEMU_CAPS_DEVICE_VIRTIO_IOMMU_PCI }, + { "chardev-spicevmc", X_QEMU_CAPS_CHARDEV_SPICEVMC },
The X_ prefix means that the capability was retired beause we are sure QEMU has it, always. Or another capability reflects the same. In this specific case I'd say QEMU_CAPS_SPICE is sufficient.
If you mean s/X_QEMU_CAPS_CHARDEV_SPICEVMC/QEMU_CAPS_SPICE/, it doesn't work. 'spicevmc' is not shown as a supported channel type in domcapabilities.
I thought more like:
diff --git i/src/qemu/qemu_capabilities.c w/src/qemu/qemu_capabilities.c index 98849daf4c..c2f6de9363 100644 --- i/src/qemu/qemu_capabilities.c +++ w/src/qemu/qemu_capabilities.c @@ -1392,7 +1392,6 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { { "s390-pv-guest", QEMU_CAPS_S390_PV_GUEST }, { "virtio-mem-pci", QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI }, { "virtio-iommu-pci", QEMU_CAPS_DEVICE_VIRTIO_IOMMU_PCI }, - { "chardev-spicevmc", X_QEMU_CAPS_CHARDEV_SPICEVMC }, };
@@ -6357,7 +6356,7 @@ virQEMUCapsFillDomainDeviceChannelCaps(virQEMUCaps *qemuCaps, VIR_DOMAIN_CAPS_ENUM_SET(channel->type, VIR_DOMAIN_CHR_TYPE_PTY, VIR_DOMAIN_CHR_TYPE_UNIX);
- if (virQEMUCapsGet(qemuCaps, X_QEMU_CAPS_CHARDEV_SPICEVMC)) + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_SPICE)) VIR_DOMAIN_CAPS_ENUM_SET(channel->type, VIR_DOMAIN_CHR_TYPE_SPICEVMC); }
(diff against this patch, minus qemucapabilitiessdata/ modifications)
This renders the same result as your patch. At least according to our test suite.
Yes, it works, but still reports a spicevmc channel device even when chardev-spice.so is not installed :-).
I thought it was safe to use the X_ variant since it is already included in CapsFlags
https://gitlab.com/libvirt/libvirt/-/blob/master/src/qemu/qemu_capabilities....
Well, define safe :-) It is safe in a sense that we can introduce capabilities as we please, because we have this cache mechanism that makes libvirt requery caps when needed. And let's leave migration aside for a moment. But, it's not desirable when we already have a capability that reflects the same information. In other words, the commit that retired QEMU_CAPS_CHARDEV_SPICEVMC (v4.3.0-rc1~322) claims, that qemu-1.2.0 and newer do support -chardev spicevmc. What's not written in the commit message (and probably should), is that it's enough for us to rely on QEMU_CAPS_SPICE. But this can be seen in the code (if you know where to look, which I admit is not developer friendly):
1) qemuValidateDomainChrSourceDef() makes sure that if there's VIR_DOMAIN_CHR_TYPE_SPICEVMC in the domain XML there's also <graphics type='spice'/>, then 2) qemuValidateDomainDeviceDefGraphics() makes sure that if there's spice graphics in the domain XML, QEMU has QEMU_CAPS_SPICE.
Let me break down step 2 a bit more, because it's obfuscated a bit (in pursuit of code deduplication). The virQEMUCapsFillDomainDeviceGraphicsCaps() is called, which fills a portion of domaincaps with supported graphics types (by looking at qemuCaps), and then VIR_DOMAIN_CAPS_ENUM_IS_SET() checks whether VIR_DOMAIN_GRAPHICS_TYPE_SPICE was set in the domaincaps.
And indeed, looking into qemu's code base (chardev/meson.build):
if spice.found() module_ss = ss.source_set() module_ss.add(when: [spice], if_true: files('spice.c')) chardev_modules += { 'spice': module_ss } endif
So it seems that spicevmc can't be compiled out and is available whenever spice is. The reason we had that capability was that as qemu/spice gained new features, there was a time when spice was available in qemu but spicevmc wasn't. But no qemu we support now (4.2.0 and newer - see QEMU_MIN_MAJOR and friends in qemu_capabilities.c) allows such situation.
I hope this helps.
Yes, it does. Thanks for the detailed response! I suppose we'll need to rethink the dependencies in our downstream packages. E.g. currently it's possible to install qemu-ui-spice-core (which contains ui-spice-core.so), but not qemu-chardev-spice (which contains chardev-spice.so). That seems to fly in the face of the upstream logic. Jim

On 10/14/22 23:34, Jim Fehlig wrote:
Yes, it does. Thanks for the detailed response! I suppose we'll need to rethink the dependencies in our downstream packages. E.g. currently it's possible to install qemu-ui-spice-core (which contains ui-spice-core.so), but not qemu-chardev-spice (which contains chardev-spice.so). That seems to fly in the face of the upstream logic.
Ah, so this kind of warrants resurrection of the old capability, because the assumption the commit which retired the capabilty made is not correct anymore (thanks to qemu dynamically loading modules). BUT, if we want to do so, we must remove the X_ prefix first because that prefix is reserved for retired capabilities [1]. But yeah, breaking down qemu too much, into many separate packages looks like overkill. And I see you already posted v3 so let me review that. Michal 1: Why we don't just remove the capability from virQEMUCaps enum? Because in the domain status XML we store the set of qemu capabilities the domain was started with. And then, when libvirtd restarts we use that str2enum helper (declared at the beginning of qemu_capabilities.c) to reconstruct the capabilities bitmap. QEMU and Libvirt might have been upgraded after the domain was started. And if we were to remove a capability, the str2enum helper would simply fail and we wouldn't be able to reconstruct the caps.

domcapabilities reports spice graphics support even against a minimal qemu installation without spice modules. Checking for 'query-spice' in the list of qmp commands supported by qemu is not sufficient to determine spice support. Checking the command line produces acurrate results. Signed-off-by: Jim Fehlig <jfehlig@suse.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 98849daf4c..e40b5c6c00 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1205,7 +1205,6 @@ struct virQEMUCapsStringFlags { struct virQEMUCapsStringFlags virQEMUCapsCommands[] = { - { "query-spice", QEMU_CAPS_SPICE }, { "query-vnc", QEMU_CAPS_VNC }, { "rtc-reset-reinjection", QEMU_CAPS_RTC_RESET_REINJECTION }, { "query-hotpluggable-cpus", QEMU_CAPS_QUERY_HOTPLUGGABLE_CPUS }, @@ -3265,6 +3264,7 @@ struct virQEMUCapsCommandLineProps { static struct virQEMUCapsCommandLineProps virQEMUCapsCommandLine[] = { { "fsdev", "multidevs", QEMU_CAPS_FSDEV_MULTIDEVS }, { "sandbox", NULL, QEMU_CAPS_SECCOMP_SANDBOX }, + { "spice", NULL, QEMU_CAPS_SPICE }, { "spice", "gl", QEMU_CAPS_SPICE_GL }, { "spice", "rendernode", QEMU_CAPS_SPICE_RENDERNODE }, { "vnc", "power-control", QEMU_CAPS_VNC_POWER_CONTROL }, -- 2.37.3

On 10/13/22 01:24, Jim Fehlig wrote:
domcapabilities reports spice graphics support even against a minimal qemu installation without spice modules. Checking for 'query-spice' in the list of qmp commands supported by qemu is not sufficient to determine spice support. Checking the command line produces acurrate results.
Signed-off-by: Jim Fehlig <jfehlig@suse.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 98849daf4c..e40b5c6c00 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1205,7 +1205,6 @@ struct virQEMUCapsStringFlags {
struct virQEMUCapsStringFlags virQEMUCapsCommands[] = { - { "query-spice", QEMU_CAPS_SPICE }, { "query-vnc", QEMU_CAPS_VNC }, { "rtc-reset-reinjection", QEMU_CAPS_RTC_RESET_REINJECTION }, { "query-hotpluggable-cpus", QEMU_CAPS_QUERY_HOTPLUGGABLE_CPUS }, @@ -3265,6 +3264,7 @@ struct virQEMUCapsCommandLineProps { static struct virQEMUCapsCommandLineProps virQEMUCapsCommandLine[] = { { "fsdev", "multidevs", QEMU_CAPS_FSDEV_MULTIDEVS }, { "sandbox", NULL, QEMU_CAPS_SECCOMP_SANDBOX }, + { "spice", NULL, QEMU_CAPS_SPICE }, { "spice", "gl", QEMU_CAPS_SPICE_GL }, { "spice", "rendernode", QEMU_CAPS_SPICE_RENDERNODE }, { "vnc", "power-control", QEMU_CAPS_VNC_POWER_CONTROL },
How is the qemu compiled? Because I tried --disable-spice and libvirt correctly did NOT set this capability. Then I tried --disable-spice-protocol and either with or without your patch the capability was set. I'm using current git master though, so could this be why I don't see any difference? Michal

On 10/13/22 09:46, Michal Prívozník wrote:
On 10/13/22 01:24, Jim Fehlig wrote:
domcapabilities reports spice graphics support even against a minimal qemu installation without spice modules. Checking for 'query-spice' in the list of qmp commands supported by qemu is not sufficient to determine spice support. Checking the command line produces acurrate results.
Signed-off-by: Jim Fehlig <jfehlig@suse.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 98849daf4c..e40b5c6c00 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1205,7 +1205,6 @@ struct virQEMUCapsStringFlags {
struct virQEMUCapsStringFlags virQEMUCapsCommands[] = { - { "query-spice", QEMU_CAPS_SPICE }, { "query-vnc", QEMU_CAPS_VNC }, { "rtc-reset-reinjection", QEMU_CAPS_RTC_RESET_REINJECTION }, { "query-hotpluggable-cpus", QEMU_CAPS_QUERY_HOTPLUGGABLE_CPUS }, @@ -3265,6 +3264,7 @@ struct virQEMUCapsCommandLineProps { static struct virQEMUCapsCommandLineProps virQEMUCapsCommandLine[] = { { "fsdev", "multidevs", QEMU_CAPS_FSDEV_MULTIDEVS }, { "sandbox", NULL, QEMU_CAPS_SECCOMP_SANDBOX }, + { "spice", NULL, QEMU_CAPS_SPICE }, { "spice", "gl", QEMU_CAPS_SPICE_GL }, { "spice", "rendernode", QEMU_CAPS_SPICE_RENDERNODE }, { "vnc", "power-control", QEMU_CAPS_VNC_POWER_CONTROL },
How is the qemu compiled? Because I tried --disable-spice and libvirt correctly did NOT set this capability. Then I tried --disable-spice-protocol and either with or without your patch the capability was set. I'm using current git master though, so could this be why I don't see any difference?
It's compiled with spice enabled, but then the corresponding modules not "installed". E.g. no /usr/lib64/qemu/*spice*.so. Regards, Jim

On 10/13/22 19:36, Jim Fehlig wrote:
On 10/13/22 09:46, Michal Prívozník wrote:
On 10/13/22 01:24, Jim Fehlig wrote:
domcapabilities reports spice graphics support even against a minimal qemu installation without spice modules. Checking for 'query-spice' in the list of qmp commands supported by qemu is not sufficient to determine spice support. Checking the command line produces acurrate results.
Signed-off-by: Jim Fehlig <jfehlig@suse.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 98849daf4c..e40b5c6c00 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1205,7 +1205,6 @@ struct virQEMUCapsStringFlags { struct virQEMUCapsStringFlags virQEMUCapsCommands[] = { - { "query-spice", QEMU_CAPS_SPICE }, { "query-vnc", QEMU_CAPS_VNC }, { "rtc-reset-reinjection", QEMU_CAPS_RTC_RESET_REINJECTION }, { "query-hotpluggable-cpus", QEMU_CAPS_QUERY_HOTPLUGGABLE_CPUS }, @@ -3265,6 +3264,7 @@ struct virQEMUCapsCommandLineProps { static struct virQEMUCapsCommandLineProps virQEMUCapsCommandLine[] = { { "fsdev", "multidevs", QEMU_CAPS_FSDEV_MULTIDEVS }, { "sandbox", NULL, QEMU_CAPS_SECCOMP_SANDBOX }, + { "spice", NULL, QEMU_CAPS_SPICE }, { "spice", "gl", QEMU_CAPS_SPICE_GL }, { "spice", "rendernode", QEMU_CAPS_SPICE_RENDERNODE }, { "vnc", "power-control", QEMU_CAPS_VNC_POWER_CONTROL },
How is the qemu compiled? Because I tried --disable-spice and libvirt correctly did NOT set this capability. Then I tried --disable-spice-protocol and either with or without your patch the capability was set. I'm using current git master though, so could this be why I don't see any difference?
It's compiled with spice enabled, but then the corresponding modules not "installed". E.g. no /usr/lib64/qemu/*spice*.so.
AH! That's the missing part. That plus --enable-modules on the qemu configure cmd line. Yep, it all fits together now. Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Michal
participants (2)
-
Jim Fehlig
-
Michal Prívozník