[libvirt] [PATCH 0/8] domaincaps: Simplify adding of new domain capability features

As you might guess I plan to add a new one later on. Peter Krempa (8): conf: domaincaps: Replace FORMAT_SINGLE macro by a function conf: domaincaps: Extract formatting of the <features> subelement conf: domaincaps: Use virXMLFormatElement in virDomainCapsFormatFeatures conf: domaincaps: Add 'iothreads' to the features section domcaps: Add function for initializing domain caps as unsupported qemu: domcaps: Initialize all features domaincaps: Store domain capability features in an array qemu: domcaps: Simplify adding new domaincaps based on qemu caps docs/schemas/domaincaps.rng | 3 + src/bhyve/bhyve_capabilities.c | 4 +- src/conf/domain_capabilities.c | 80 ++++++++++++++----- src/conf/domain_capabilities.h | 15 +++- src/libvirt_private.syms | 1 + src/libxl/libxl_capabilities.c | 5 +- src/qemu/qemu_capabilities.c | 41 +++++++--- tests/domaincapsdata/libxl-xenfv.xml | 1 + tests/domaincapsdata/libxl-xenpv.xml | 1 + .../domaincapsdata/qemu_1.5.3-q35.x86_64.xml | 1 + .../domaincapsdata/qemu_1.5.3-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_1.5.3.x86_64.xml | 1 + .../domaincapsdata/qemu_1.6.0-q35.x86_64.xml | 1 + .../domaincapsdata/qemu_1.6.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_1.6.0.x86_64.xml | 1 + .../domaincapsdata/qemu_1.7.0-q35.x86_64.xml | 1 + .../domaincapsdata/qemu_1.7.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_1.7.0.x86_64.xml | 1 + .../domaincapsdata/qemu_2.1.1-q35.x86_64.xml | 1 + .../domaincapsdata/qemu_2.1.1-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_2.1.1.x86_64.xml | 1 + .../domaincapsdata/qemu_2.10.0-q35.x86_64.xml | 1 + .../domaincapsdata/qemu_2.10.0-tcg.x86_64.xml | 1 + .../qemu_2.10.0-virt.aarch64.xml | 1 + tests/domaincapsdata/qemu_2.10.0.aarch64.xml | 1 + tests/domaincapsdata/qemu_2.10.0.ppc64.xml | 1 + tests/domaincapsdata/qemu_2.10.0.s390x.xml | 1 + tests/domaincapsdata/qemu_2.10.0.x86_64.xml | 1 + .../domaincapsdata/qemu_2.11.0-q35.x86_64.xml | 1 + .../domaincapsdata/qemu_2.11.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_2.11.0.s390x.xml | 1 + tests/domaincapsdata/qemu_2.11.0.x86_64.xml | 1 + .../domaincapsdata/qemu_2.12.0-q35.x86_64.xml | 1 + .../domaincapsdata/qemu_2.12.0-tcg.x86_64.xml | 1 + .../qemu_2.12.0-virt.aarch64.xml | 1 + tests/domaincapsdata/qemu_2.12.0.aarch64.xml | 1 + tests/domaincapsdata/qemu_2.12.0.ppc64.xml | 1 + tests/domaincapsdata/qemu_2.12.0.s390x.xml | 1 + tests/domaincapsdata/qemu_2.12.0.x86_64.xml | 1 + .../domaincapsdata/qemu_2.4.0-q35.x86_64.xml | 1 + .../domaincapsdata/qemu_2.4.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_2.4.0.x86_64.xml | 1 + .../domaincapsdata/qemu_2.5.0-q35.x86_64.xml | 1 + .../domaincapsdata/qemu_2.5.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_2.5.0.x86_64.xml | 1 + .../domaincapsdata/qemu_2.6.0-q35.x86_64.xml | 1 + .../domaincapsdata/qemu_2.6.0-tcg.x86_64.xml | 1 + .../qemu_2.6.0-virt.aarch64.xml | 1 + tests/domaincapsdata/qemu_2.6.0.aarch64.xml | 1 + tests/domaincapsdata/qemu_2.6.0.ppc64.xml | 1 + tests/domaincapsdata/qemu_2.6.0.x86_64.xml | 1 + .../domaincapsdata/qemu_2.7.0-q35.x86_64.xml | 1 + .../domaincapsdata/qemu_2.7.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_2.7.0.s390x.xml | 1 + tests/domaincapsdata/qemu_2.7.0.x86_64.xml | 1 + .../domaincapsdata/qemu_2.8.0-q35.x86_64.xml | 1 + .../domaincapsdata/qemu_2.8.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_2.8.0.s390x.xml | 1 + tests/domaincapsdata/qemu_2.8.0.x86_64.xml | 1 + .../domaincapsdata/qemu_2.9.0-q35.x86_64.xml | 1 + .../domaincapsdata/qemu_2.9.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_2.9.0.ppc64.xml | 1 + tests/domaincapsdata/qemu_2.9.0.s390x.xml | 1 + tests/domaincapsdata/qemu_2.9.0.x86_64.xml | 1 + .../domaincapsdata/qemu_3.0.0-q35.x86_64.xml | 1 + .../domaincapsdata/qemu_3.0.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_3.0.0.ppc64.xml | 1 + tests/domaincapsdata/qemu_3.0.0.s390x.xml | 1 + tests/domaincapsdata/qemu_3.0.0.x86_64.xml | 1 + .../domaincapsdata/qemu_3.1.0-q35.x86_64.xml | 1 + .../domaincapsdata/qemu_3.1.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_3.1.0.ppc64.xml | 1 + tests/domaincapsdata/qemu_3.1.0.x86_64.xml | 1 + .../domaincapsdata/qemu_4.0.0-q35.x86_64.xml | 1 + .../domaincapsdata/qemu_4.0.0-tcg.x86_64.xml | 1 + .../qemu_4.0.0-virt.aarch64.xml | 1 + tests/domaincapsdata/qemu_4.0.0.aarch64.xml | 1 + tests/domaincapsdata/qemu_4.0.0.ppc64.xml | 1 + tests/domaincapsdata/qemu_4.0.0.s390x.xml | 1 + tests/domaincapsdata/qemu_4.0.0.x86_64.xml | 1 + .../domaincapsdata/qemu_4.1.0-q35.x86_64.xml | 1 + .../domaincapsdata/qemu_4.1.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_4.1.0.x86_64.xml | 1 + .../domaincapsdata/qemu_4.2.0-q35.x86_64.xml | 1 + .../domaincapsdata/qemu_4.2.0-tcg.x86_64.xml | 1 + .../qemu_4.2.0-virt.aarch64.xml | 1 + tests/domaincapsdata/qemu_4.2.0.aarch64.xml | 1 + tests/domaincapsdata/qemu_4.2.0.ppc64.xml | 1 + tests/domaincapsdata/qemu_4.2.0.x86_64.xml | 1 + 89 files changed, 192 insertions(+), 39 deletions(-) -- 2.23.0

Introduce qemuDomainCapsFeatureFormatSimple which does exactly the same thing but it's a function. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/conf/domain_capabilities.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index f922cb9055..099963dc6a 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -380,14 +380,6 @@ virDomainCapsStringValuesFormat(virBufferPtr buf, virBufferAddLit(buf, "</" #item ">\n"); \ } while (0) -#define FORMAT_SINGLE(name, supported) \ - do { \ - if (supported != VIR_TRISTATE_BOOL_ABSENT) { \ - virBufferAsprintf(&buf, "<%s supported='%s'/>\n", name, \ - (supported == VIR_TRISTATE_BOOL_YES) ? "yes" : "no"); \ - } \ - } while (0) - #define ENUM_PROCESS(master, capsEnum, valToStr) \ do { \ virDomainCapsEnumFormat(buf, &master->capsEnum, \ @@ -395,6 +387,19 @@ virDomainCapsStringValuesFormat(virBufferPtr buf, } while (0) +static void +qemuDomainCapsFeatureFormatSimple(virBufferPtr buf, + const char *featurename, + virTristateBool supported) +{ + if (supported == VIR_TRISTATE_BOOL_ABSENT) + return; + + virBufferAsprintf(buf, "<%s supported='%s'/>\n", featurename, + virTristateBoolTypeToString(supported)); +} + + static void virDomainCapsLoaderFormat(virBufferPtr buf, const virDomainCapsLoader *loader) @@ -614,7 +619,7 @@ virDomainCapsFormat(const virDomainCaps *caps) if (caps->maxvcpus) virBufferAsprintf(&buf, "<vcpu max='%d'/>\n", caps->maxvcpus); - FORMAT_SINGLE("iothreads", caps->iothreads); + qemuDomainCapsFeatureFormatSimple(&buf, "iothreads", caps->iothreads); virDomainCapsOSFormat(&buf, &caps->os); virDomainCapsCPUFormat(&buf, &caps->cpu); @@ -635,8 +640,8 @@ virDomainCapsFormat(const virDomainCaps *caps) virBufferAdjustIndent(&buf, 2); virDomainCapsFeatureGICFormat(&buf, &caps->gic); - FORMAT_SINGLE("vmcoreinfo", caps->vmcoreinfo); - FORMAT_SINGLE("genid", caps->genid); + qemuDomainCapsFeatureFormatSimple(&buf, "vmcoreinfo", caps->vmcoreinfo); + qemuDomainCapsFeatureFormatSimple(&buf, "genid", caps->genid); virDomainCapsFeatureSEVFormat(&buf, caps->sev); virBufferAdjustIndent(&buf, -2); -- 2.23.0

On Wed, Nov 13, 2019 at 05:05:19PM +0100, Peter Krempa wrote:
Introduce qemuDomainCapsFeatureFormatSimple which does exactly the same thing but it's a function.
Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/conf/domain_capabilities.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

Extract it to virDomainCapsFormatFeatures so that the main function does not get so bloated over time. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/conf/domain_capabilities.c | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index 099963dc6a..2c1c5fc9e8 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -600,6 +600,23 @@ virDomainCapsFeatureSEVFormat(virBufferPtr buf, } +static void +virDomainCapsFormatFeatures(const virDomainCaps *caps, + virBufferPtr buf) +{ + virBufferAddLit(buf, "<features>\n"); + virBufferAdjustIndent(buf, 2); + + virDomainCapsFeatureGICFormat(buf, &caps->gic); + qemuDomainCapsFeatureFormatSimple(buf, "vmcoreinfo", caps->vmcoreinfo); + qemuDomainCapsFeatureFormatSimple(buf, "genid", caps->genid); + virDomainCapsFeatureSEVFormat(buf, caps->sev); + + virBufferAdjustIndent(buf, -2); + virBufferAddLit(buf, "</features>\n"); +} + + char * virDomainCapsFormat(const virDomainCaps *caps) { @@ -636,16 +653,7 @@ virDomainCapsFormat(const virDomainCaps *caps) virBufferAdjustIndent(&buf, -2); virBufferAddLit(&buf, "</devices>\n"); - virBufferAddLit(&buf, "<features>\n"); - virBufferAdjustIndent(&buf, 2); - - virDomainCapsFeatureGICFormat(&buf, &caps->gic); - qemuDomainCapsFeatureFormatSimple(&buf, "vmcoreinfo", caps->vmcoreinfo); - qemuDomainCapsFeatureFormatSimple(&buf, "genid", caps->genid); - virDomainCapsFeatureSEVFormat(&buf, caps->sev); - - virBufferAdjustIndent(&buf, -2); - virBufferAddLit(&buf, "</features>\n"); + virDomainCapsFormatFeatures(caps, &buf); virBufferAdjustIndent(&buf, -2); virBufferAddLit(&buf, "</domainCapabilities>\n"); -- 2.23.0

On Wed, Nov 13, 2019 at 05:05:20PM +0100, Peter Krempa wrote:
Extract it to virDomainCapsFormatFeatures so that the main function does not get so bloated over time.
Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/conf/domain_capabilities.c | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/conf/domain_capabilities.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index 2c1c5fc9e8..d9a9093f89 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -604,16 +604,14 @@ static void virDomainCapsFormatFeatures(const virDomainCaps *caps, virBufferPtr buf) { - virBufferAddLit(buf, "<features>\n"); - virBufferAdjustIndent(buf, 2); + g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf); - virDomainCapsFeatureGICFormat(buf, &caps->gic); - qemuDomainCapsFeatureFormatSimple(buf, "vmcoreinfo", caps->vmcoreinfo); - qemuDomainCapsFeatureFormatSimple(buf, "genid", caps->genid); - virDomainCapsFeatureSEVFormat(buf, caps->sev); + virDomainCapsFeatureGICFormat(&childBuf, &caps->gic); + qemuDomainCapsFeatureFormatSimple(&childBuf, "vmcoreinfo", caps->vmcoreinfo); + qemuDomainCapsFeatureFormatSimple(&childBuf, "genid", caps->genid); + virDomainCapsFeatureSEVFormat(&childBuf, caps->sev); - virBufferAdjustIndent(buf, -2); - virBufferAddLit(buf, "</features>\n"); + virXMLFormatElement(buf, "features", NULL, &childBuf); } -- 2.23.0

On Wed, Nov 13, 2019 at 05:05:21PM +0100, Peter Krempa wrote:
Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/conf/domain_capabilities.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

Historically iothreads were the first feature and thus didn't have it's own section. Add them to <features> for consistency with other features. Unfortunately we must keep the original one in place. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/schemas/domaincaps.rng | 3 +++ src/conf/domain_capabilities.c | 1 + tests/domaincapsdata/libxl-xenfv.xml | 1 + tests/domaincapsdata/libxl-xenpv.xml | 1 + tests/domaincapsdata/qemu_1.5.3-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_1.5.3-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_1.5.3.x86_64.xml | 1 + tests/domaincapsdata/qemu_1.6.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_1.6.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_1.6.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_1.7.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_1.7.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_1.7.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_2.1.1-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_2.1.1-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_2.1.1.x86_64.xml | 1 + tests/domaincapsdata/qemu_2.10.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_2.10.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_2.10.0-virt.aarch64.xml | 1 + tests/domaincapsdata/qemu_2.10.0.aarch64.xml | 1 + tests/domaincapsdata/qemu_2.10.0.ppc64.xml | 1 + tests/domaincapsdata/qemu_2.10.0.s390x.xml | 1 + tests/domaincapsdata/qemu_2.10.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_2.11.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_2.11.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_2.11.0.s390x.xml | 1 + tests/domaincapsdata/qemu_2.11.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_2.12.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_2.12.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_2.12.0-virt.aarch64.xml | 1 + tests/domaincapsdata/qemu_2.12.0.aarch64.xml | 1 + tests/domaincapsdata/qemu_2.12.0.ppc64.xml | 1 + tests/domaincapsdata/qemu_2.12.0.s390x.xml | 1 + tests/domaincapsdata/qemu_2.12.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_2.4.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_2.4.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_2.4.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_2.5.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_2.5.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_2.5.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_2.6.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_2.6.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_2.6.0-virt.aarch64.xml | 1 + tests/domaincapsdata/qemu_2.6.0.aarch64.xml | 1 + tests/domaincapsdata/qemu_2.6.0.ppc64.xml | 1 + tests/domaincapsdata/qemu_2.6.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_2.7.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_2.7.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_2.7.0.s390x.xml | 1 + tests/domaincapsdata/qemu_2.7.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_2.8.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_2.8.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_2.8.0.s390x.xml | 1 + tests/domaincapsdata/qemu_2.8.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_2.9.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_2.9.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_2.9.0.ppc64.xml | 1 + tests/domaincapsdata/qemu_2.9.0.s390x.xml | 1 + tests/domaincapsdata/qemu_2.9.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_3.0.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_3.0.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_3.0.0.ppc64.xml | 1 + tests/domaincapsdata/qemu_3.0.0.s390x.xml | 1 + tests/domaincapsdata/qemu_3.0.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_3.1.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_3.1.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_3.1.0.ppc64.xml | 1 + tests/domaincapsdata/qemu_3.1.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_4.0.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_4.0.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_4.0.0-virt.aarch64.xml | 1 + tests/domaincapsdata/qemu_4.0.0.aarch64.xml | 1 + tests/domaincapsdata/qemu_4.0.0.ppc64.xml | 1 + tests/domaincapsdata/qemu_4.0.0.s390x.xml | 1 + tests/domaincapsdata/qemu_4.0.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_4.1.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_4.1.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_4.1.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_4.2.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_4.2.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/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.x86_64.xml | 1 + 84 files changed, 86 insertions(+) diff --git a/docs/schemas/domaincaps.rng b/docs/schemas/domaincaps.rng index 3525c0eeef..1072483092 100644 --- a/docs/schemas/domaincaps.rng +++ b/docs/schemas/domaincaps.rng @@ -201,6 +201,9 @@ <optional> <ref name='gic'/> </optional> + <optional> + <ref name='iothreads'/> + </optional> <optional> <ref name='vmcoreinfo'/> </optional> diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index d9a9093f89..8d0a0c121c 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -607,6 +607,7 @@ virDomainCapsFormatFeatures(const virDomainCaps *caps, g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf); virDomainCapsFeatureGICFormat(&childBuf, &caps->gic); + qemuDomainCapsFeatureFormatSimple(&childBuf, "iothreads", caps->iothreads); qemuDomainCapsFeatureFormatSimple(&childBuf, "vmcoreinfo", caps->vmcoreinfo); qemuDomainCapsFeatureFormatSimple(&childBuf, "genid", caps->genid); virDomainCapsFeatureSEVFormat(&childBuf, caps->sev); diff --git a/tests/domaincapsdata/libxl-xenfv.xml b/tests/domaincapsdata/libxl-xenfv.xml index 4efc137c97..867817538c 100644 --- a/tests/domaincapsdata/libxl-xenfv.xml +++ b/tests/domaincapsdata/libxl-xenfv.xml @@ -72,6 +72,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='no'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/libxl-xenpv.xml b/tests/domaincapsdata/libxl-xenpv.xml index 70e598fe9e..699a78e097 100644 --- a/tests/domaincapsdata/libxl-xenpv.xml +++ b/tests/domaincapsdata/libxl-xenpv.xml @@ -62,6 +62,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='no'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_1.5.3-q35.x86_64.xml b/tests/domaincapsdata/qemu_1.5.3-q35.x86_64.xml index c6b090ed06..3fb8babfce 100644 --- a/tests/domaincapsdata/qemu_1.5.3-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_1.5.3-q35.x86_64.xml @@ -127,6 +127,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='no'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_1.5.3-tcg.x86_64.xml b/tests/domaincapsdata/qemu_1.5.3-tcg.x86_64.xml index a1112c8011..2365b70725 100644 --- a/tests/domaincapsdata/qemu_1.5.3-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_1.5.3-tcg.x86_64.xml @@ -127,6 +127,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='no'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_1.5.3.x86_64.xml b/tests/domaincapsdata/qemu_1.5.3.x86_64.xml index 905593616a..a9575e76ae 100644 --- a/tests/domaincapsdata/qemu_1.5.3.x86_64.xml +++ b/tests/domaincapsdata/qemu_1.5.3.x86_64.xml @@ -127,6 +127,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='no'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_1.6.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_1.6.0-q35.x86_64.xml index 866e627287..e4b3bc76b6 100644 --- a/tests/domaincapsdata/qemu_1.6.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_1.6.0-q35.x86_64.xml @@ -127,6 +127,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='no'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_1.6.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_1.6.0-tcg.x86_64.xml index 5b06cb8895..14562e587f 100644 --- a/tests/domaincapsdata/qemu_1.6.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_1.6.0-tcg.x86_64.xml @@ -127,6 +127,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='no'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_1.6.0.x86_64.xml b/tests/domaincapsdata/qemu_1.6.0.x86_64.xml index 788f8ac36b..f1921fc427 100644 --- a/tests/domaincapsdata/qemu_1.6.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_1.6.0.x86_64.xml @@ -127,6 +127,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='no'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_1.7.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_1.7.0-q35.x86_64.xml index 79b753fa09..7fc2e8c792 100644 --- a/tests/domaincapsdata/qemu_1.7.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_1.7.0-q35.x86_64.xml @@ -127,6 +127,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='no'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_1.7.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_1.7.0-tcg.x86_64.xml index 5b61c5ba4f..d1ba43f3df 100644 --- a/tests/domaincapsdata/qemu_1.7.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_1.7.0-tcg.x86_64.xml @@ -127,6 +127,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='no'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_1.7.0.x86_64.xml b/tests/domaincapsdata/qemu_1.7.0.x86_64.xml index a2df336833..c622a3dbe2 100644 --- a/tests/domaincapsdata/qemu_1.7.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_1.7.0.x86_64.xml @@ -127,6 +127,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='no'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_2.1.1-q35.x86_64.xml b/tests/domaincapsdata/qemu_2.1.1-q35.x86_64.xml index 901eb71442..b60e0be208 100644 --- a/tests/domaincapsdata/qemu_2.1.1-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.1.1-q35.x86_64.xml @@ -128,6 +128,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_2.1.1-tcg.x86_64.xml b/tests/domaincapsdata/qemu_2.1.1-tcg.x86_64.xml index 2524e2fb4d..a28a53ce15 100644 --- a/tests/domaincapsdata/qemu_2.1.1-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.1.1-tcg.x86_64.xml @@ -128,6 +128,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_2.1.1.x86_64.xml b/tests/domaincapsdata/qemu_2.1.1.x86_64.xml index 6ad05cb6df..506142c37e 100644 --- a/tests/domaincapsdata/qemu_2.1.1.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.1.1.x86_64.xml @@ -128,6 +128,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_2.10.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_2.10.0-q35.x86_64.xml index 60d565bcb5..c8c4996575 100644 --- a/tests/domaincapsdata/qemu_2.10.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.10.0-q35.x86_64.xml @@ -151,6 +151,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='no'/> <genid supported='yes'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_2.10.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_2.10.0-tcg.x86_64.xml index c6c7ee3adb..c52e76e0f2 100644 --- a/tests/domaincapsdata/qemu_2.10.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.10.0-tcg.x86_64.xml @@ -170,6 +170,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='no'/> <genid supported='yes'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_2.10.0-virt.aarch64.xml b/tests/domaincapsdata/qemu_2.10.0-virt.aarch64.xml index a73d3ed413..425667c427 100644 --- a/tests/domaincapsdata/qemu_2.10.0-virt.aarch64.xml +++ b/tests/domaincapsdata/qemu_2.10.0-virt.aarch64.xml @@ -135,6 +135,7 @@ <value>2</value> </enum> </gic> + <iothreads supported='yes'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_2.10.0.aarch64.xml b/tests/domaincapsdata/qemu_2.10.0.aarch64.xml index 9523ff0088..3d5ab3046f 100644 --- a/tests/domaincapsdata/qemu_2.10.0.aarch64.xml +++ b/tests/domaincapsdata/qemu_2.10.0.aarch64.xml @@ -129,6 +129,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_2.10.0.ppc64.xml b/tests/domaincapsdata/qemu_2.10.0.ppc64.xml index 4341b7506e..71aeda7745 100644 --- a/tests/domaincapsdata/qemu_2.10.0.ppc64.xml +++ b/tests/domaincapsdata/qemu_2.10.0.ppc64.xml @@ -101,6 +101,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_2.10.0.s390x.xml b/tests/domaincapsdata/qemu_2.10.0.s390x.xml index a3c934fb94..82fa12b249 100644 --- a/tests/domaincapsdata/qemu_2.10.0.s390x.xml +++ b/tests/domaincapsdata/qemu_2.10.0.s390x.xml @@ -191,6 +191,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_2.10.0.x86_64.xml b/tests/domaincapsdata/qemu_2.10.0.x86_64.xml index 6bc4f5b15a..e771bfec9d 100644 --- a/tests/domaincapsdata/qemu_2.10.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.10.0.x86_64.xml @@ -151,6 +151,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='no'/> <genid supported='yes'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_2.11.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_2.11.0-q35.x86_64.xml index 008471bf7f..bb1ae91d18 100644 --- a/tests/domaincapsdata/qemu_2.11.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.11.0-q35.x86_64.xml @@ -149,6 +149,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='yes'/> <genid supported='yes'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_2.11.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_2.11.0-tcg.x86_64.xml index 7030638338..83fa35ec5b 100644 --- a/tests/domaincapsdata/qemu_2.11.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.11.0-tcg.x86_64.xml @@ -165,6 +165,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='yes'/> <genid supported='yes'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_2.11.0.s390x.xml b/tests/domaincapsdata/qemu_2.11.0.s390x.xml index df410ffc48..5d8a23d919 100644 --- a/tests/domaincapsdata/qemu_2.11.0.s390x.xml +++ b/tests/domaincapsdata/qemu_2.11.0.s390x.xml @@ -190,6 +190,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_2.11.0.x86_64.xml b/tests/domaincapsdata/qemu_2.11.0.x86_64.xml index 590825fa77..995a32b80c 100644 --- a/tests/domaincapsdata/qemu_2.11.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.11.0.x86_64.xml @@ -149,6 +149,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='yes'/> <genid supported='yes'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_2.12.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_2.12.0-q35.x86_64.xml index 584eaa0983..500ae42858 100644 --- a/tests/domaincapsdata/qemu_2.12.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.12.0-q35.x86_64.xml @@ -162,6 +162,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='yes'/> <genid supported='yes'/> <sev supported='yes'> diff --git a/tests/domaincapsdata/qemu_2.12.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_2.12.0-tcg.x86_64.xml index 2fbd83d04d..b9d86deed7 100644 --- a/tests/domaincapsdata/qemu_2.12.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.12.0-tcg.x86_64.xml @@ -176,6 +176,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='yes'/> <genid supported='yes'/> <sev supported='yes'> diff --git a/tests/domaincapsdata/qemu_2.12.0-virt.aarch64.xml b/tests/domaincapsdata/qemu_2.12.0-virt.aarch64.xml index ed1af3224b..3e6a51db21 100644 --- a/tests/domaincapsdata/qemu_2.12.0-virt.aarch64.xml +++ b/tests/domaincapsdata/qemu_2.12.0-virt.aarch64.xml @@ -137,6 +137,7 @@ <value>3</value> </enum> </gic> + <iothreads supported='yes'/> <vmcoreinfo supported='yes'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_2.12.0.aarch64.xml b/tests/domaincapsdata/qemu_2.12.0.aarch64.xml index ebf499d4fa..22d4df2de4 100644 --- a/tests/domaincapsdata/qemu_2.12.0.aarch64.xml +++ b/tests/domaincapsdata/qemu_2.12.0.aarch64.xml @@ -131,6 +131,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='yes'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_2.12.0.ppc64.xml b/tests/domaincapsdata/qemu_2.12.0.ppc64.xml index e8d3c22337..1e87db5ca7 100644 --- a/tests/domaincapsdata/qemu_2.12.0.ppc64.xml +++ b/tests/domaincapsdata/qemu_2.12.0.ppc64.xml @@ -101,6 +101,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_2.12.0.s390x.xml b/tests/domaincapsdata/qemu_2.12.0.s390x.xml index 8d039f3514..70f486318f 100644 --- a/tests/domaincapsdata/qemu_2.12.0.s390x.xml +++ b/tests/domaincapsdata/qemu_2.12.0.s390x.xml @@ -189,6 +189,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_2.12.0.x86_64.xml b/tests/domaincapsdata/qemu_2.12.0.x86_64.xml index 109162ffd8..829a6aa5b9 100644 --- a/tests/domaincapsdata/qemu_2.12.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.12.0.x86_64.xml @@ -162,6 +162,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='yes'/> <genid supported='yes'/> <sev supported='yes'> diff --git a/tests/domaincapsdata/qemu_2.4.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_2.4.0-q35.x86_64.xml index b27c701794..333a2309e3 100644 --- a/tests/domaincapsdata/qemu_2.4.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.4.0-q35.x86_64.xml @@ -136,6 +136,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_2.4.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_2.4.0-tcg.x86_64.xml index aca986f1da..cbd3555b56 100644 --- a/tests/domaincapsdata/qemu_2.4.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.4.0-tcg.x86_64.xml @@ -136,6 +136,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_2.4.0.x86_64.xml b/tests/domaincapsdata/qemu_2.4.0.x86_64.xml index 3257b723d9..4cec54bae5 100644 --- a/tests/domaincapsdata/qemu_2.4.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.4.0.x86_64.xml @@ -136,6 +136,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_2.5.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_2.5.0-q35.x86_64.xml index 89b5a7e5a5..3910fdda6a 100644 --- a/tests/domaincapsdata/qemu_2.5.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.5.0-q35.x86_64.xml @@ -136,6 +136,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_2.5.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_2.5.0-tcg.x86_64.xml index 390cfc07e2..986055b5d7 100644 --- a/tests/domaincapsdata/qemu_2.5.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.5.0-tcg.x86_64.xml @@ -136,6 +136,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_2.5.0.x86_64.xml b/tests/domaincapsdata/qemu_2.5.0.x86_64.xml index a519cd8c03..de58a35456 100644 --- a/tests/domaincapsdata/qemu_2.5.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.5.0.x86_64.xml @@ -136,6 +136,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_2.6.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_2.6.0-q35.x86_64.xml index e2d734fd03..6351b32983 100644 --- a/tests/domaincapsdata/qemu_2.6.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.6.0-q35.x86_64.xml @@ -136,6 +136,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_2.6.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_2.6.0-tcg.x86_64.xml index d054bb0491..9b170ef53e 100644 --- a/tests/domaincapsdata/qemu_2.6.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.6.0-tcg.x86_64.xml @@ -136,6 +136,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_2.6.0-virt.aarch64.xml b/tests/domaincapsdata/qemu_2.6.0-virt.aarch64.xml index 13441b9923..537d17d153 100644 --- a/tests/domaincapsdata/qemu_2.6.0-virt.aarch64.xml +++ b/tests/domaincapsdata/qemu_2.6.0-virt.aarch64.xml @@ -134,6 +134,7 @@ <value>2</value> </enum> </gic> + <iothreads supported='yes'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_2.6.0.aarch64.xml b/tests/domaincapsdata/qemu_2.6.0.aarch64.xml index 974739c38e..ce57457769 100644 --- a/tests/domaincapsdata/qemu_2.6.0.aarch64.xml +++ b/tests/domaincapsdata/qemu_2.6.0.aarch64.xml @@ -128,6 +128,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_2.6.0.ppc64.xml b/tests/domaincapsdata/qemu_2.6.0.ppc64.xml index 9f628a3652..f37d9cf4d0 100644 --- a/tests/domaincapsdata/qemu_2.6.0.ppc64.xml +++ b/tests/domaincapsdata/qemu_2.6.0.ppc64.xml @@ -101,6 +101,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_2.6.0.x86_64.xml b/tests/domaincapsdata/qemu_2.6.0.x86_64.xml index bb1f784328..6c8442d7c4 100644 --- a/tests/domaincapsdata/qemu_2.6.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.6.0.x86_64.xml @@ -136,6 +136,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_2.7.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_2.7.0-q35.x86_64.xml index a04e7e23db..b1aad6357c 100644 --- a/tests/domaincapsdata/qemu_2.7.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.7.0-q35.x86_64.xml @@ -137,6 +137,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_2.7.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_2.7.0-tcg.x86_64.xml index e5bd79bff0..5e8ae81294 100644 --- a/tests/domaincapsdata/qemu_2.7.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.7.0-tcg.x86_64.xml @@ -137,6 +137,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_2.7.0.s390x.xml b/tests/domaincapsdata/qemu_2.7.0.s390x.xml index 322d12c719..87736d5a68 100644 --- a/tests/domaincapsdata/qemu_2.7.0.s390x.xml +++ b/tests/domaincapsdata/qemu_2.7.0.s390x.xml @@ -94,6 +94,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_2.7.0.x86_64.xml b/tests/domaincapsdata/qemu_2.7.0.x86_64.xml index 697bac48ac..2b7f7c5536 100644 --- a/tests/domaincapsdata/qemu_2.7.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.7.0.x86_64.xml @@ -137,6 +137,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_2.8.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_2.8.0-q35.x86_64.xml index e1f014d4a8..75b9612ef1 100644 --- a/tests/domaincapsdata/qemu_2.8.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.8.0-q35.x86_64.xml @@ -137,6 +137,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_2.8.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_2.8.0-tcg.x86_64.xml index b6679a6e64..8a27376cf5 100644 --- a/tests/domaincapsdata/qemu_2.8.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.8.0-tcg.x86_64.xml @@ -137,6 +137,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_2.8.0.s390x.xml b/tests/domaincapsdata/qemu_2.8.0.s390x.xml index c7a4578f61..bfaff118cd 100644 --- a/tests/domaincapsdata/qemu_2.8.0.s390x.xml +++ b/tests/domaincapsdata/qemu_2.8.0.s390x.xml @@ -175,6 +175,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_2.8.0.x86_64.xml b/tests/domaincapsdata/qemu_2.8.0.x86_64.xml index 3af3fcc4a9..3bb3f14527 100644 --- a/tests/domaincapsdata/qemu_2.8.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.8.0.x86_64.xml @@ -137,6 +137,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_2.9.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_2.9.0-q35.x86_64.xml index aac295a20d..b2b4cb0008 100644 --- a/tests/domaincapsdata/qemu_2.9.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.9.0-q35.x86_64.xml @@ -146,6 +146,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='no'/> <genid supported='yes'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_2.9.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_2.9.0-tcg.x86_64.xml index 12537c039b..3bb3ee334a 100644 --- a/tests/domaincapsdata/qemu_2.9.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.9.0-tcg.x86_64.xml @@ -169,6 +169,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='no'/> <genid supported='yes'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_2.9.0.ppc64.xml b/tests/domaincapsdata/qemu_2.9.0.ppc64.xml index 73ed4f4897..be83fe45ef 100644 --- a/tests/domaincapsdata/qemu_2.9.0.ppc64.xml +++ b/tests/domaincapsdata/qemu_2.9.0.ppc64.xml @@ -101,6 +101,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_2.9.0.s390x.xml b/tests/domaincapsdata/qemu_2.9.0.s390x.xml index eb7dfe6b67..9f30a4f711 100644 --- a/tests/domaincapsdata/qemu_2.9.0.s390x.xml +++ b/tests/domaincapsdata/qemu_2.9.0.s390x.xml @@ -176,6 +176,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_2.9.0.x86_64.xml b/tests/domaincapsdata/qemu_2.9.0.x86_64.xml index 80fc7e1657..ba01257a8d 100644 --- a/tests/domaincapsdata/qemu_2.9.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_2.9.0.x86_64.xml @@ -146,6 +146,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='no'/> <genid supported='yes'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_3.0.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_3.0.0-q35.x86_64.xml index 44dc5d44d2..e4d859f07b 100644 --- a/tests/domaincapsdata/qemu_3.0.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_3.0.0-q35.x86_64.xml @@ -162,6 +162,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='yes'/> <genid supported='yes'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_3.0.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_3.0.0-tcg.x86_64.xml index 489e4ae1f7..c957c3da4f 100644 --- a/tests/domaincapsdata/qemu_3.0.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_3.0.0-tcg.x86_64.xml @@ -177,6 +177,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='yes'/> <genid supported='yes'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_3.0.0.ppc64.xml b/tests/domaincapsdata/qemu_3.0.0.ppc64.xml index 1a7f12c615..c0e963160c 100644 --- a/tests/domaincapsdata/qemu_3.0.0.ppc64.xml +++ b/tests/domaincapsdata/qemu_3.0.0.ppc64.xml @@ -102,6 +102,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_3.0.0.s390x.xml b/tests/domaincapsdata/qemu_3.0.0.s390x.xml index 0e81e2ea33..993be87460 100644 --- a/tests/domaincapsdata/qemu_3.0.0.s390x.xml +++ b/tests/domaincapsdata/qemu_3.0.0.s390x.xml @@ -195,6 +195,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_3.0.0.x86_64.xml b/tests/domaincapsdata/qemu_3.0.0.x86_64.xml index 8e10a3eb0e..0eaf59c71b 100644 --- a/tests/domaincapsdata/qemu_3.0.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_3.0.0.x86_64.xml @@ -162,6 +162,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='yes'/> <genid supported='yes'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_3.1.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_3.1.0-q35.x86_64.xml index 595476b87b..f136c168d7 100644 --- a/tests/domaincapsdata/qemu_3.1.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_3.1.0-q35.x86_64.xml @@ -165,6 +165,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='yes'/> <genid supported='yes'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_3.1.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_3.1.0-tcg.x86_64.xml index 82d31b3ff6..f75b660b39 100644 --- a/tests/domaincapsdata/qemu_3.1.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_3.1.0-tcg.x86_64.xml @@ -180,6 +180,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='yes'/> <genid supported='yes'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_3.1.0.ppc64.xml b/tests/domaincapsdata/qemu_3.1.0.ppc64.xml index d6952076e9..9d81f324f1 100644 --- a/tests/domaincapsdata/qemu_3.1.0.ppc64.xml +++ b/tests/domaincapsdata/qemu_3.1.0.ppc64.xml @@ -103,6 +103,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_3.1.0.x86_64.xml b/tests/domaincapsdata/qemu_3.1.0.x86_64.xml index 059403cebc..6dfb88a7be 100644 --- a/tests/domaincapsdata/qemu_3.1.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_3.1.0.x86_64.xml @@ -165,6 +165,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='yes'/> <genid supported='yes'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_4.0.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_4.0.0-q35.x86_64.xml index aba5bdf871..cd1ac0e42d 100644 --- a/tests/domaincapsdata/qemu_4.0.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_4.0.0-q35.x86_64.xml @@ -165,6 +165,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='yes'/> <genid supported='yes'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_4.0.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_4.0.0-tcg.x86_64.xml index 3630653ac9..0402007ddc 100644 --- a/tests/domaincapsdata/qemu_4.0.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_4.0.0-tcg.x86_64.xml @@ -180,6 +180,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='yes'/> <genid supported='yes'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_4.0.0-virt.aarch64.xml b/tests/domaincapsdata/qemu_4.0.0-virt.aarch64.xml index 9f9cc376a3..c495662ca0 100644 --- a/tests/domaincapsdata/qemu_4.0.0-virt.aarch64.xml +++ b/tests/domaincapsdata/qemu_4.0.0-virt.aarch64.xml @@ -143,6 +143,7 @@ <value>3</value> </enum> </gic> + <iothreads supported='yes'/> <vmcoreinfo supported='yes'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_4.0.0.aarch64.xml b/tests/domaincapsdata/qemu_4.0.0.aarch64.xml index 577edf81d7..5c05f75b83 100644 --- a/tests/domaincapsdata/qemu_4.0.0.aarch64.xml +++ b/tests/domaincapsdata/qemu_4.0.0.aarch64.xml @@ -137,6 +137,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='yes'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_4.0.0.ppc64.xml b/tests/domaincapsdata/qemu_4.0.0.ppc64.xml index 5422b3ddd8..00f107a06e 100644 --- a/tests/domaincapsdata/qemu_4.0.0.ppc64.xml +++ b/tests/domaincapsdata/qemu_4.0.0.ppc64.xml @@ -104,6 +104,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_4.0.0.s390x.xml b/tests/domaincapsdata/qemu_4.0.0.s390x.xml index e68f8e8d9a..a682b83203 100644 --- a/tests/domaincapsdata/qemu_4.0.0.s390x.xml +++ b/tests/domaincapsdata/qemu_4.0.0.s390x.xml @@ -201,6 +201,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_4.0.0.x86_64.xml b/tests/domaincapsdata/qemu_4.0.0.x86_64.xml index eb24b9a604..516761b259 100644 --- a/tests/domaincapsdata/qemu_4.0.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_4.0.0.x86_64.xml @@ -165,6 +165,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='yes'/> <genid supported='yes'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_4.1.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_4.1.0-q35.x86_64.xml index 481aba2c41..8c5eb8e0e5 100644 --- a/tests/domaincapsdata/qemu_4.1.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_4.1.0-q35.x86_64.xml @@ -169,6 +169,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='yes'/> <genid supported='yes'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_4.1.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_4.1.0-tcg.x86_64.xml index a7409505cb..e78a463f2c 100644 --- a/tests/domaincapsdata/qemu_4.1.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_4.1.0-tcg.x86_64.xml @@ -180,6 +180,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='yes'/> <genid supported='yes'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_4.1.0.x86_64.xml b/tests/domaincapsdata/qemu_4.1.0.x86_64.xml index f5685d2068..6e0dd633c8 100644 --- a/tests/domaincapsdata/qemu_4.1.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_4.1.0.x86_64.xml @@ -169,6 +169,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='yes'/> <genid supported='yes'/> <sev supported='no'/> 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 8f6c6d3da6..d6d25a909c 100644 --- a/tests/domaincapsdata/qemu_4.2.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_4.2.0-q35.x86_64.xml @@ -169,6 +169,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='yes'/> <genid supported='yes'/> <sev 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 520d4ff7f2..5b5b236761 100644 --- a/tests/domaincapsdata/qemu_4.2.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_4.2.0-tcg.x86_64.xml @@ -180,6 +180,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='yes'/> <genid supported='yes'/> <sev 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 85d9433f52..8ee9bfcd7f 100644 --- a/tests/domaincapsdata/qemu_4.2.0-virt.aarch64.xml +++ b/tests/domaincapsdata/qemu_4.2.0-virt.aarch64.xml @@ -143,6 +143,7 @@ <value>3</value> </enum> </gic> + <iothreads supported='yes'/> <vmcoreinfo supported='yes'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_4.2.0.aarch64.xml b/tests/domaincapsdata/qemu_4.2.0.aarch64.xml index 577edf81d7..5c05f75b83 100644 --- a/tests/domaincapsdata/qemu_4.2.0.aarch64.xml +++ b/tests/domaincapsdata/qemu_4.2.0.aarch64.xml @@ -137,6 +137,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='yes'/> <genid supported='no'/> <sev supported='no'/> diff --git a/tests/domaincapsdata/qemu_4.2.0.ppc64.xml b/tests/domaincapsdata/qemu_4.2.0.ppc64.xml index 78e141dfb2..a82e4f5997 100644 --- a/tests/domaincapsdata/qemu_4.2.0.ppc64.xml +++ b/tests/domaincapsdata/qemu_4.2.0.ppc64.xml @@ -104,6 +104,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='no'/> <genid supported='no'/> <sev 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 5bd376bb2e..1dbf7a91a1 100644 --- a/tests/domaincapsdata/qemu_4.2.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_4.2.0.x86_64.xml @@ -169,6 +169,7 @@ </devices> <features> <gic supported='no'/> + <iothreads supported='yes'/> <vmcoreinfo supported='yes'/> <genid supported='yes'/> <sev supported='no'/> -- 2.23.0

On Wed, Nov 13, 2019 at 05:05:22PM +0100, Peter Krempa wrote:
Historically iothreads were the first feature and thus didn't have it's own section. Add them to <features> for consistency with other features.
I'm not convinced duplicating this is a good idea - apps looking into the <features> element for iothread support would only find it with libvirt new enough to have it there and miss out on iothread support with older libvirt. Jano
Unfortunately we must keep the original one in place.
Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/schemas/domaincaps.rng | 3 +++ src/conf/domain_capabilities.c | 1 + tests/domaincapsdata/libxl-xenfv.xml | 1 + tests/domaincapsdata/libxl-xenpv.xml | 1 +

On Thu, Nov 14, 2019 at 12:55:40 +0100, Ján Tomko wrote:
On Wed, Nov 13, 2019 at 05:05:22PM +0100, Peter Krempa wrote:
Historically iothreads were the first feature and thus didn't have it's own section. Add them to <features> for consistency with other features.
I'm not convinced duplicating this is a good idea - apps looking into the <features> element for iothread support would only find it with libvirt new enough to have it there and miss out on iothread support with older libvirt.
I certainly can keep 'iothreads' separate. I'm definitely not going to add an special case into the formatter to avoid formatting it there. Also to be fair I'm not sure whether it's worth caring about the outlined scenario. If an APP looks for iothreads in <features> it should not be used with older libvirt than the one where it was added. At any rate, I can drop this patch and keep the iothreads stuff separate.

On Thu, Nov 14, 2019 at 12:59:00 +0100, Peter Krempa wrote:
On Thu, Nov 14, 2019 at 12:55:40 +0100, Ján Tomko wrote:
On Wed, Nov 13, 2019 at 05:05:22PM +0100, Peter Krempa wrote:
Historically iothreads were the first feature and thus didn't have it's own section. Add them to <features> for consistency with other features.
I'm not convinced duplicating this is a good idea - apps looking into the <features> element for iothread support would only find it with libvirt new enough to have it there and miss out on iothread support with older libvirt.
I certainly can keep 'iothreads' separate. I'm definitely not going to add an special case into the formatter to avoid formatting it there.
Also to be fair I'm not sure whether it's worth caring about the outlined scenario. If an APP looks for iothreads in <features> it should not be used with older libvirt than the one where it was added.
At any rate, I can drop this patch and keep the iothreads stuff separate.
Also any new app will have to write two lookup XPaths to get all the data as it's now rather than having everything in one place.

For future extensions of the domain caps it's useful to have a single point that initializes all capabilities as unsupported by a driver. The driver then can enable specific ones. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/bhyve/bhyve_capabilities.c | 4 +--- src/conf/domain_capabilities.c | 14 ++++++++++++++ src/conf/domain_capabilities.h | 2 ++ src/libvirt_private.syms | 1 + src/libxl/libxl_capabilities.c | 5 ++--- 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/bhyve/bhyve_capabilities.c b/src/bhyve/bhyve_capabilities.c index c04a475375..f80cf7be62 100644 --- a/src/bhyve/bhyve_capabilities.c +++ b/src/bhyve/bhyve_capabilities.c @@ -116,9 +116,7 @@ virBhyveDomainCapsFill(virDomainCapsPtr caps, } caps->hostdev.supported = VIR_TRISTATE_BOOL_NO; - caps->iothreads = VIR_TRISTATE_BOOL_NO; - caps->vmcoreinfo = VIR_TRISTATE_BOOL_NO; - caps->genid = VIR_TRISTATE_BOOL_NO; + virDomainCapsFeaturesInitUnsupported(caps); caps->gic.supported = VIR_TRISTATE_BOOL_NO; return 0; diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index 8d0a0c121c..39acad00f1 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -316,6 +316,20 @@ virDomainCapsEnumClear(virDomainCapsEnumPtr capsEnum) } +/** + * @caps: domain caps + * + * Initializes all features in 'caps' as unsupported. + */ +void +virDomainCapsFeaturesInitUnsupported(virDomainCapsPtr caps) +{ + caps->iothreads = VIR_TRISTATE_BOOL_NO; + caps->vmcoreinfo = VIR_TRISTATE_BOOL_NO; + caps->genid = VIR_TRISTATE_BOOL_NO; +} + + static int virDomainCapsEnumFormat(virBufferPtr buf, const virDomainCapsEnum *capsEnum, diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h index 6b27eac11f..9baaea8f60 100644 --- a/src/conf/domain_capabilities.h +++ b/src/conf/domain_capabilities.h @@ -226,6 +226,8 @@ int virDomainCapsEnumSet(virDomainCapsEnumPtr capsEnum, unsigned int *values); void virDomainCapsEnumClear(virDomainCapsEnumPtr capsEnum); +void virDomainCapsFeaturesInitUnsupported(virDomainCapsPtr caps); + char * virDomainCapsFormat(const virDomainCaps *caps); int virDomainCapsDeviceDefValidate(const virDomainCaps *caps, diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 4d0d03c580..1432f1697a 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -202,6 +202,7 @@ virDomainCapsCPUUsableTypeToString; virDomainCapsDeviceDefValidate; virDomainCapsEnumClear; virDomainCapsEnumSet; +virDomainCapsFeaturesInitUnsupported; virDomainCapsFormat; virDomainCapsNew; virSEVCapabilitiesFree; diff --git a/src/libxl/libxl_capabilities.c b/src/libxl/libxl_capabilities.c index fe792e9a82..55f6b490ec 100644 --- a/src/libxl/libxl_capabilities.c +++ b/src/libxl/libxl_capabilities.c @@ -764,9 +764,8 @@ libxlMakeDomainCapabilities(virDomainCapsPtr domCaps, libxlMakeDomainDeviceHostdevCaps(hostdev) < 0) return -1; - domCaps->iothreads = VIR_TRISTATE_BOOL_NO; - domCaps->vmcoreinfo = VIR_TRISTATE_BOOL_NO; - domCaps->genid = VIR_TRISTATE_BOOL_NO; + virDomainCapsFeaturesInitUnsupported(domCaps); + domCaps->gic.supported = VIR_TRISTATE_BOOL_NO; return 0; -- 2.23.0

On Wed, Nov 13, 2019 at 05:05:23PM +0100, Peter Krempa wrote:
For future extensions of the domain caps it's useful to have a single point that initializes all capabilities as unsupported by a driver. The driver then can enable specific ones.
Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/bhyve/bhyve_capabilities.c | 4 +--- src/conf/domain_capabilities.c | 14 ++++++++++++++ src/conf/domain_capabilities.h | 2 ++ src/libvirt_private.syms | 1 + src/libxl/libxl_capabilities.c | 5 ++--- 5 files changed, 20 insertions(+), 6 deletions(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

On 11/13/19 11:05 AM, Peter Krempa wrote:
For future extensions of the domain caps it's useful to have a single point that initializes all capabilities as unsupported by a driver. The driver then can enable specific ones.
Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/bhyve/bhyve_capabilities.c | 4 +--- src/conf/domain_capabilities.c | 14 ++++++++++++++ src/conf/domain_capabilities.h | 2 ++ src/libvirt_private.syms | 1 + src/libxl/libxl_capabilities.c | 5 ++--- 5 files changed, 20 insertions(+), 6 deletions(-)
diff --git a/src/bhyve/bhyve_capabilities.c b/src/bhyve/bhyve_capabilities.c index c04a475375..f80cf7be62 100644 --- a/src/bhyve/bhyve_capabilities.c +++ b/src/bhyve/bhyve_capabilities.c @@ -116,9 +116,7 @@ virBhyveDomainCapsFill(virDomainCapsPtr caps, }
caps->hostdev.supported = VIR_TRISTATE_BOOL_NO; - caps->iothreads = VIR_TRISTATE_BOOL_NO; - caps->vmcoreinfo = VIR_TRISTATE_BOOL_NO; - caps->genid = VIR_TRISTATE_BOOL_NO; + virDomainCapsFeaturesInitUnsupported(caps); caps->gic.supported = VIR_TRISTATE_BOOL_NO;
return 0; diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index 8d0a0c121c..39acad00f1 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -316,6 +316,20 @@ virDomainCapsEnumClear(virDomainCapsEnumPtr capsEnum) }
+/** + * @caps: domain caps + * + * Initializes all features in 'caps' as unsupported. + */ +void +virDomainCapsFeaturesInitUnsupported(virDomainCapsPtr caps) +{ + caps->iothreads = VIR_TRISTATE_BOOL_NO; + caps->vmcoreinfo = VIR_TRISTATE_BOOL_NO; + caps->genid = VIR_TRISTATE_BOOL_NO; +} + +
This pattern is suboptimal IMO. Any time a new domcaps capability is added, say to serve the qemu/ driver, the developer now needs to consider how this shared function impacts libxl domcaps XML. Say hypothetically tomorrow I want to expose 'acpi' support in domcaps <features>. My main goal is to expose this in qemu domcaps. Naturally a starting point is to add 'caps->acpi = VIR_TRISTATE_BOOL_NO;' here. If I don't remember to check libxl code though, I've now potentially converted their driver to report blatantly incorrect domcaps output, as libxl does support ACPI. If I do remember to check their code, it's my responsibility to edit libxl code to ensure it's reporting accurate information, which makes my life harder. With the previous behavior, I could add a new domcap feature to central code, fill it in for qemu, and libxl output wouldn't change at all. Whether to report supported='no' or supported='yes' is left entirely up to libxl driver code. This makes it easier and safer to extend domcaps IMO. This was the goal of my series to use tristate bool earlier in the year, where there's more explanation: https://www.redhat.com/archives/libvir-list/2019-March/msg00365.html Thanks, Cole

On Mon, Nov 18, 2019 at 14:43:08 -0500, Cole Robinson wrote:
On 11/13/19 11:05 AM, Peter Krempa wrote:
For future extensions of the domain caps it's useful to have a single point that initializes all capabilities as unsupported by a driver. The driver then can enable specific ones.
Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/bhyve/bhyve_capabilities.c | 4 +--- src/conf/domain_capabilities.c | 14 ++++++++++++++ src/conf/domain_capabilities.h | 2 ++ src/libvirt_private.syms | 1 + src/libxl/libxl_capabilities.c | 5 ++--- 5 files changed, 20 insertions(+), 6 deletions(-)
diff --git a/src/bhyve/bhyve_capabilities.c b/src/bhyve/bhyve_capabilities.c index c04a475375..f80cf7be62 100644 --- a/src/bhyve/bhyve_capabilities.c +++ b/src/bhyve/bhyve_capabilities.c @@ -116,9 +116,7 @@ virBhyveDomainCapsFill(virDomainCapsPtr caps, }
caps->hostdev.supported = VIR_TRISTATE_BOOL_NO; - caps->iothreads = VIR_TRISTATE_BOOL_NO; - caps->vmcoreinfo = VIR_TRISTATE_BOOL_NO; - caps->genid = VIR_TRISTATE_BOOL_NO; + virDomainCapsFeaturesInitUnsupported(caps); caps->gic.supported = VIR_TRISTATE_BOOL_NO;
return 0; diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index 8d0a0c121c..39acad00f1 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -316,6 +316,20 @@ virDomainCapsEnumClear(virDomainCapsEnumPtr capsEnum) }
+/** + * @caps: domain caps + * + * Initializes all features in 'caps' as unsupported. + */ +void +virDomainCapsFeaturesInitUnsupported(virDomainCapsPtr caps) +{ + caps->iothreads = VIR_TRISTATE_BOOL_NO; + caps->vmcoreinfo = VIR_TRISTATE_BOOL_NO; + caps->genid = VIR_TRISTATE_BOOL_NO; +} + +
This pattern is suboptimal IMO. Any time a new domcaps capability is added, say to serve the qemu/ driver, the developer now needs to consider how this shared function impacts libxl domcaps XML.
I see your point, but I think there's merit also towards the other approach. Here we explicitly mark everything as unsupported, but that does not prevent developers from resetting the caps to the missing state in case when it's ambiguous or they don't wish to deal with other hypervisors.
Say hypothetically tomorrow I want to expose 'acpi' support in domcaps <features>. My main goal is to expose this in qemu domcaps. Naturally a starting point is to add 'caps->acpi = VIR_TRISTATE_BOOL_NO;' here.
If I don't remember to check libxl code though, I've now potentially converted their driver to report blatantly incorrect domcaps output, as libxl does support ACPI. If I do remember to check their code, it's my responsibility to edit libxl code to ensure it's reporting accurate information, which makes my life harder.
In my opinion it's not wrong to ask developers to at least think whether the change does not influence other hypervisors as well or in case when it's trivially supported to more than the original intention. In the end they still can remove it in case it's out of the scope. Also we should take into account the usability of the caps themselves. If we by default promote bitrot of other hypervisor drivers we might miss out on stuff that is actually supported but nobody bothered to wire up the capability for it.
With the previous behavior, I could add a new domcap feature to central code, fill it in for qemu, and libxl output wouldn't change at all. Whether to report supported='no' or supported='yes' is left entirely up to libxl driver code. This makes it easier and safer to extend domcaps IMO.
This was the goal of my series to use tristate bool earlier in the year, where there's more explanation: https://www.redhat.com/archives/libvir-list/2019-March/msg00365.html
I fully agree that we should keep it tristate where possible but also the most common option will be that the capability is not supported by other hypervisors when implementing it. In the end neither approach will get rid of the necessity to do proper review, but keeping the caps hidden promotes ignorance because the tests don't catch the possible scope of change. In the end, we can revert this behaviour (well, it will require some tweaking now not a straight revert) if you disagree with my reasoning.

On 11/20/19 9:40 AM, Peter Krempa wrote:
On Mon, Nov 18, 2019 at 14:43:08 -0500, Cole Robinson wrote:
On 11/13/19 11:05 AM, Peter Krempa wrote:
For future extensions of the domain caps it's useful to have a single point that initializes all capabilities as unsupported by a driver. The driver then can enable specific ones.
Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/bhyve/bhyve_capabilities.c | 4 +--- src/conf/domain_capabilities.c | 14 ++++++++++++++ src/conf/domain_capabilities.h | 2 ++ src/libvirt_private.syms | 1 + src/libxl/libxl_capabilities.c | 5 ++--- 5 files changed, 20 insertions(+), 6 deletions(-)
diff --git a/src/bhyve/bhyve_capabilities.c b/src/bhyve/bhyve_capabilities.c index c04a475375..f80cf7be62 100644 --- a/src/bhyve/bhyve_capabilities.c +++ b/src/bhyve/bhyve_capabilities.c @@ -116,9 +116,7 @@ virBhyveDomainCapsFill(virDomainCapsPtr caps, }
caps->hostdev.supported = VIR_TRISTATE_BOOL_NO; - caps->iothreads = VIR_TRISTATE_BOOL_NO; - caps->vmcoreinfo = VIR_TRISTATE_BOOL_NO; - caps->genid = VIR_TRISTATE_BOOL_NO; + virDomainCapsFeaturesInitUnsupported(caps); caps->gic.supported = VIR_TRISTATE_BOOL_NO;
return 0; diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index 8d0a0c121c..39acad00f1 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -316,6 +316,20 @@ virDomainCapsEnumClear(virDomainCapsEnumPtr capsEnum) }
+/** + * @caps: domain caps + * + * Initializes all features in 'caps' as unsupported. + */ +void +virDomainCapsFeaturesInitUnsupported(virDomainCapsPtr caps) +{ + caps->iothreads = VIR_TRISTATE_BOOL_NO; + caps->vmcoreinfo = VIR_TRISTATE_BOOL_NO; + caps->genid = VIR_TRISTATE_BOOL_NO; +} + +
This pattern is suboptimal IMO. Any time a new domcaps capability is added, say to serve the qemu/ driver, the developer now needs to consider how this shared function impacts libxl domcaps XML.
I see your point, but I think there's merit also towards the other approach.
Here we explicitly mark everything as unsupported, but that does not prevent developers from resetting the caps to the missing state in case when it's ambiguous or they don't wish to deal with other hypervisors.
Say hypothetically tomorrow I want to expose 'acpi' support in domcaps <features>. My main goal is to expose this in qemu domcaps. Naturally a starting point is to add 'caps->acpi = VIR_TRISTATE_BOOL_NO;' here.
If I don't remember to check libxl code though, I've now potentially converted their driver to report blatantly incorrect domcaps output, as libxl does support ACPI. If I do remember to check their code, it's my responsibility to edit libxl code to ensure it's reporting accurate information, which makes my life harder.
In my opinion it's not wrong to ask developers to at least think whether the change does not influence other hypervisors as well or in case when it's trivially supported to more than the original intention.
I agree with that statement. Devs should be considering other drivers when extending domcaps schema. That doesn't change with the current way or the previous way. What changes is the default result if other drivers are not considered properly: * old way: ** libxl/bhyve driver is ignored: their XML output doesn't change at all. missed opportunity to improve their XML output coverage, but otherwise the status quo is maintained ** libxl/bhyve driver is considered: requires explicit changes in their code to support supported='no' or supported='yes' case. * git way: ** libxl/bhyve driver is ignored. *** 1) supported='no' is correct state. only likely result is CI breakage or review issues with bhyve caps needing regenerating *** 2) supported='no' is incorrect state. unless review catches this, libxl/bhyve now may be reporting blatantly incorrect info. ** libxl/bhyve driver is considered: supported='no' requires no code change, but supported='yes' requires some code change
From my perspective as an app developer, here's my order of worst to best cases for domcaps output:
1) domcaps output is present but incorrect 2) domcaps output is absent 3) domcaps output is present and correct And there's a giant distance between 1 and 2. #2 is basically the default domcaps state for a whole bunch of interesting information, apps already can't depend on it existing because it's not provided by any driver. The case we really should be optimizing for IMO is avoiding #1, and the current git code makes it easier to introduce errors like that. I admit, it's kind of a philosophical argument for the <features> XML. I expect most things that features are extended for will only count for the qemu driver. But if this pattern were to be extended to things like <devices>, essentially the old state the code was in before my patches earlier in the year, it becomes particularly dangerous. Take the <sound> example I gave in the cover letter of my series.
In the end they still can remove it in case it's out of the scope.
Also we should take into account the usability of the caps themselves. If we by default promote bitrot of other hypervisor drivers we might miss out on stuff that is actually supported but nobody bothered to wire up the capability for it.
With the previous behavior, I could add a new domcap feature to central code, fill it in for qemu, and libxl output wouldn't change at all. Whether to report supported='no' or supported='yes' is left entirely up to libxl driver code. This makes it easier and safer to extend domcaps IMO.
This was the goal of my series to use tristate bool earlier in the year, where there's more explanation: https://www.redhat.com/archives/libvir-list/2019-March/msg00365.html
I fully agree that we should keep it tristate where possible but also the most common option will be that the capability is not supported by other hypervisors when implementing it.
Yes for new capabilities this is true. But extending domcaps to expose existing XML support values (the acpi bit for example) is less clear
In the end neither approach will get rid of the necessity to do proper review, but keeping the caps hidden promotes ignorance because the tests don't catch the possible scope of change. In the end, we can revert this behaviour (well, it will require some tweaking now not a straight revert) if you disagree with my reasoning.
I see your points but I still favor the old way. There's no rush to change this IMO so maybe we can come up with consensus on whether it's optimal to put default supported=yes|no values in common code or not. CCing Jano and Michal for their opinions too. Thanks, Cole

On Wed, Nov 20, 2019 at 13:02:04 -0500, Cole Robinson wrote:
On 11/20/19 9:40 AM, Peter Krempa wrote:
On Mon, Nov 18, 2019 at 14:43:08 -0500, Cole Robinson wrote:
On 11/13/19 11:05 AM, Peter Krempa wrote:
For future extensions of the domain caps it's useful to have a single point that initializes all capabilities as unsupported by a driver. The driver then can enable specific ones.
Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/bhyve/bhyve_capabilities.c | 4 +--- src/conf/domain_capabilities.c | 14 ++++++++++++++ src/conf/domain_capabilities.h | 2 ++ src/libvirt_private.syms | 1 + src/libxl/libxl_capabilities.c | 5 ++--- 5 files changed, 20 insertions(+), 6 deletions(-)
diff --git a/src/bhyve/bhyve_capabilities.c b/src/bhyve/bhyve_capabilities.c index c04a475375..f80cf7be62 100644 --- a/src/bhyve/bhyve_capabilities.c +++ b/src/bhyve/bhyve_capabilities.c @@ -116,9 +116,7 @@ virBhyveDomainCapsFill(virDomainCapsPtr caps, }
caps->hostdev.supported = VIR_TRISTATE_BOOL_NO; - caps->iothreads = VIR_TRISTATE_BOOL_NO; - caps->vmcoreinfo = VIR_TRISTATE_BOOL_NO; - caps->genid = VIR_TRISTATE_BOOL_NO; + virDomainCapsFeaturesInitUnsupported(caps); caps->gic.supported = VIR_TRISTATE_BOOL_NO;
return 0; diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index 8d0a0c121c..39acad00f1 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -316,6 +316,20 @@ virDomainCapsEnumClear(virDomainCapsEnumPtr capsEnum) }
+/** + * @caps: domain caps + * + * Initializes all features in 'caps' as unsupported. + */ +void +virDomainCapsFeaturesInitUnsupported(virDomainCapsPtr caps) +{ + caps->iothreads = VIR_TRISTATE_BOOL_NO; + caps->vmcoreinfo = VIR_TRISTATE_BOOL_NO; + caps->genid = VIR_TRISTATE_BOOL_NO; +} + +
This pattern is suboptimal IMO. Any time a new domcaps capability is added, say to serve the qemu/ driver, the developer now needs to consider how this shared function impacts libxl domcaps XML.
I see your point, but I think there's merit also towards the other approach.
Here we explicitly mark everything as unsupported, but that does not prevent developers from resetting the caps to the missing state in case when it's ambiguous or they don't wish to deal with other hypervisors.
Say hypothetically tomorrow I want to expose 'acpi' support in domcaps <features>. My main goal is to expose this in qemu domcaps. Naturally a starting point is to add 'caps->acpi = VIR_TRISTATE_BOOL_NO;' here.
If I don't remember to check libxl code though, I've now potentially converted their driver to report blatantly incorrect domcaps output, as libxl does support ACPI. If I do remember to check their code, it's my responsibility to edit libxl code to ensure it's reporting accurate information, which makes my life harder.
In my opinion it's not wrong to ask developers to at least think whether the change does not influence other hypervisors as well or in case when it's trivially supported to more than the original intention.
I agree with that statement. Devs should be considering other drivers when extending domcaps schema. That doesn't change with the current way or the previous way. What changes is the default result if other drivers are not considered properly:
* old way: ** libxl/bhyve driver is ignored: their XML output doesn't change at all. missed opportunity to improve their XML output coverage, but otherwise the status quo is maintained ** libxl/bhyve driver is considered: requires explicit changes in their code to support supported='no' or supported='yes' case.
* git way: ** libxl/bhyve driver is ignored. *** 1) supported='no' is correct state. only likely result is CI breakage or review issues with bhyve caps needing regenerating *** 2) supported='no' is incorrect state. unless review catches this, libxl/bhyve now may be reporting blatantly incorrect info. ** libxl/bhyve driver is considered: supported='no' requires no code change, but supported='yes' requires some code change
From my perspective as an app developer, here's my order of worst to best cases for domcaps output:
1) domcaps output is present but incorrect 2) domcaps output is absent 3) domcaps output is present and correct
And there's a giant distance between 1 and 2. #2 is basically the default domcaps state for a whole bunch of interesting information, apps already can't depend on it existing because it's not provided by any driver.
The case we really should be optimizing for IMO is avoiding #1, and the current git code makes it easier to introduce errors like that.
You can't prevent any of the case by pure code. You need to have review. As a reviewer you are far more likely to notice something that is added by a patch is wrong rather than something which is omitted in a patch but should be there. In my opinion the tradeoff between missing a wrong value reported in the caps during review and missing that we could do better in other areas as well was of comparable value despite the distance between #1 and #2. Unfortunately I don't see any better way ensuring that other drivers are considered beyond this. Adding a hacks to force a compile time check as we did in far more important cases [1] definitely is not worth in this scenario. [1] commit 5e3c3447857faeada02702d5b186a6c805858a74
I admit, it's kind of a philosophical argument for the <features> XML. I expect most things that features are extended for will only count for the qemu driver. But if this pattern were to be extended to things like <devices>, essentially the old state the code was in before my patches earlier in the year, it becomes particularly dangerous. Take the <sound> example I gave in the cover letter of my series.
In the end they still can remove it in case it's out of the scope.
Also we should take into account the usability of the caps themselves. If we by default promote bitrot of other hypervisor drivers we might miss out on stuff that is actually supported but nobody bothered to wire up the capability for it.
With the previous behavior, I could add a new domcap feature to central code, fill it in for qemu, and libxl output wouldn't change at all. Whether to report supported='no' or supported='yes' is left entirely up to libxl driver code. This makes it easier and safer to extend domcaps IMO.
This was the goal of my series to use tristate bool earlier in the year, where there's more explanation: https://www.redhat.com/archives/libvir-list/2019-March/msg00365.html
I fully agree that we should keep it tristate where possible but also the most common option will be that the capability is not supported by other hypervisors when implementing it.
Yes for new capabilities this is true. But extending domcaps to expose existing XML support values (the acpi bit for example) is less clear
I still think it's always worth considering all drivers even when adding capabilities for existing XML bits. Also gradually adding caps for existing XML will become less and less prominent as APPs already assume many supported bits from other places since our caps are far from complete and actually we should promote adding detectability more and more. We do a terrible job with it currently. Ideally we would do it implicitly as qemu does because any non-implicit way will be forgotten. Even in qemu if a patch requires to be detected it requires manual addition to the schema which is not done by default.
In the end neither approach will get rid of the necessity to do proper review, but keeping the caps hidden promotes ignorance because the tests don't catch the possible scope of change. In the end, we can revert this behaviour (well, it will require some tweaking now not a straight revert) if you disagree with my reasoning.
I see your points but I still favor the old way. There's no rush toa change this IMO so maybe we can come up with consensus on whether it's optimal to put default supported=yes|no values in common code or not. CCing Jano and Michal for their opinions too.
Fair enough. As I don't see a way to force developers considering other drivers which would be worth adding besides this one I'll prepare the patch and the conversation can be done there. Also honestly I'd not notice that bhyve would be changed with it and in the end changing this to the old way will probably result in me not adding the 'backingStoreInput' to bhyve as I don't feel like running freebsd to gather the results.

On 11/20/19 7:02 PM, Cole Robinson wrote:
I see your points but I still favor the old way. There's no rush to change this IMO so maybe we can come up with consensus on whether it's optimal to put default supported=yes|no values in common code or not. CCing Jano and Michal for their opinions too.
I prefer independent domcaps among drivers. It's easier to expose new capability just for one driver (just like Cole demonstrates in his hypothetical example). It would be nice to have rich and updated domcaps for other drivers too but looks like there is not enough interest/manpower/.. to do that. Michal

While the qemu driver currently implements all domain capability features, we should initialize all features using the helper similarly to how we do it in drivers which don't support any. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/qemu/qemu_capabilities.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index b03abcd0d3..23a358bf91 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -5571,6 +5571,8 @@ virQEMUCapsFillDomainCaps(virCapsPtr caps, virDomainCapsDeviceVideoPtr video = &domCaps->video; virDomainCapsDeviceRNGPtr rng = &domCaps->rng; + virDomainCapsFeaturesInitUnsupported(domCaps); + domCaps->maxvcpus = virQEMUCapsGetMachineMaxCpus(qemuCaps, domCaps->machine); if (domCaps->virttype == VIR_DOMAIN_VIRT_KVM) { -- 2.23.0

On Wed, Nov 13, 2019 at 05:05:24PM +0100, Peter Krempa wrote:
While the qemu driver currently implements all domain capability features, we should initialize all features using the helper similarly to how we do it in drivers which don't support any.
Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/qemu/qemu_capabilities.c | 2 ++ 1 file changed, 2 insertions(+)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

Declare the capabilities as enum values and store them in an array. This makes adding new features more straightforward and simplifies the formatter which now doesn't require changing. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/conf/domain_capabilities.c | 30 +++++++++++++++++++++++------- src/conf/domain_capabilities.h | 13 ++++++++++--- src/qemu/qemu_capabilities.c | 6 +++--- 3 files changed, 36 insertions(+), 13 deletions(-) diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index 39acad00f1..1993a22cc5 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -33,6 +33,15 @@ VIR_ENUM_IMPL(virDomainCapsCPUUsable, "unknown", "yes", "no", ); + +VIR_ENUM_DECL(virDomainCapsFeature); +VIR_ENUM_IMPL(virDomainCapsFeature, + VIR_DOMAIN_CAPS_FEATURE_LAST, + "iothreads", + "vmcoreinfo", + "genid", +); + static virClassPtr virDomainCapsClass; static virClassPtr virDomainCapsCPUModelsClass; @@ -324,9 +333,10 @@ virDomainCapsEnumClear(virDomainCapsEnumPtr capsEnum) void virDomainCapsFeaturesInitUnsupported(virDomainCapsPtr caps) { - caps->iothreads = VIR_TRISTATE_BOOL_NO; - caps->vmcoreinfo = VIR_TRISTATE_BOOL_NO; - caps->genid = VIR_TRISTATE_BOOL_NO; + size_t i; + + for (i = 0; i < VIR_DOMAIN_CAPS_FEATURE_LAST; i++) + caps->features[i] = VIR_TRISTATE_BOOL_NO; } @@ -619,11 +629,16 @@ virDomainCapsFormatFeatures(const virDomainCaps *caps, virBufferPtr buf) { g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf); + size_t i; virDomainCapsFeatureGICFormat(&childBuf, &caps->gic); - qemuDomainCapsFeatureFormatSimple(&childBuf, "iothreads", caps->iothreads); - qemuDomainCapsFeatureFormatSimple(&childBuf, "vmcoreinfo", caps->vmcoreinfo); - qemuDomainCapsFeatureFormatSimple(&childBuf, "genid", caps->genid); + + for (i = 0; i < VIR_DOMAIN_CAPS_FEATURE_LAST; i++) { + qemuDomainCapsFeatureFormatSimple(&childBuf, + virDomainCapsFeatureTypeToString(i), + caps->features[i]); + } + virDomainCapsFeatureSEVFormat(&childBuf, caps->sev); virXMLFormatElement(buf, "features", NULL, &childBuf); @@ -649,7 +664,8 @@ virDomainCapsFormat(const virDomainCaps *caps) if (caps->maxvcpus) virBufferAsprintf(&buf, "<vcpu max='%d'/>\n", caps->maxvcpus); - qemuDomainCapsFeatureFormatSimple(&buf, "iothreads", caps->iothreads); + qemuDomainCapsFeatureFormatSimple(&buf, "iothreads", + caps->features[VIR_DOMAIN_CAPS_FEATURE_IOTHREADS]); virDomainCapsOSFormat(&buf, &caps->os); virDomainCapsCPUFormat(&buf, &caps->cpu); diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h index 9baaea8f60..83a9713a8b 100644 --- a/src/conf/domain_capabilities.h +++ b/src/conf/domain_capabilities.h @@ -156,6 +156,14 @@ struct _virSEVCapability { unsigned int reduced_phys_bits; }; +typedef enum { + VIR_DOMAIN_CAPS_FEATURE_IOTHREADS = 0, + VIR_DOMAIN_CAPS_FEATURE_VMCOREINFO, + VIR_DOMAIN_CAPS_FEATURE_GENID, + + VIR_DOMAIN_CAPS_FEATURE_LAST +} virDomainCapsFeature; + struct _virDomainCaps { virObjectLockable parent; @@ -166,7 +174,6 @@ struct _virDomainCaps { /* Some machine specific info */ int maxvcpus; - virTristateBool iothreads; /* Whether I/O threads are supported or not. */ virDomainCapsOS os; virDomainCapsCPU cpu; @@ -178,10 +185,10 @@ struct _virDomainCaps { /* add new domain devices here */ virDomainCapsFeatureGIC gic; - virTristateBool vmcoreinfo; - virTristateBool genid; virSEVCapabilityPtr sev; /* add new domain features here */ + + virTristateBool features[VIR_DOMAIN_CAPS_FEATURE_LAST]; }; G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainCaps, virObjectUnref); diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 23a358bf91..a1fbf0da34 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -5285,7 +5285,7 @@ static void virQEMUCapsFillDomainIOThreadCaps(virQEMUCapsPtr qemuCaps, virDomainCapsPtr domCaps) { - domCaps->iothreads = virTristateBoolFromBool( + domCaps->features[VIR_DOMAIN_CAPS_FEATURE_IOTHREADS] = virTristateBoolFromBool( virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_IOTHREAD)); } @@ -5584,10 +5584,10 @@ virQEMUCapsFillDomainCaps(virCapsPtr caps, domCaps->maxvcpus = MIN(domCaps->maxvcpus, hostmaxvcpus); } - domCaps->vmcoreinfo = virTristateBoolFromBool( + domCaps->features[VIR_DOMAIN_CAPS_FEATURE_VMCOREINFO] = virTristateBoolFromBool( virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VMCOREINFO)); - domCaps->genid = virTristateBoolFromBool( + domCaps->features[VIR_DOMAIN_CAPS_FEATURE_GENID] = virTristateBoolFromBool( virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VMGENID)); if (virQEMUCapsFillDomainOSCaps(os, -- 2.23.0

On Wed, Nov 13, 2019 at 05:05:25PM +0100, Peter Krempa wrote:
Declare the capabilities as enum values and store them in an array. This makes adding new features more straightforward and simplifies the formatter which now doesn't require changing.
Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/conf/domain_capabilities.c | 30 +++++++++++++++++++++++------- src/conf/domain_capabilities.h | 13 ++++++++++--- src/qemu/qemu_capabilities.c | 6 +++--- 3 files changed, 36 insertions(+), 13 deletions(-)
diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index 39acad00f1..1993a22cc5 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -33,6 +33,15 @@ VIR_ENUM_IMPL(virDomainCapsCPUUsable, "unknown", "yes", "no", );
+ +VIR_ENUM_DECL(virDomainCapsFeature); +VIR_ENUM_IMPL(virDomainCapsFeature, + VIR_DOMAIN_CAPS_FEATURE_LAST, + "iothreads", + "vmcoreinfo", + "genid", +); + static virClassPtr virDomainCapsClass; static virClassPtr virDomainCapsCPUModelsClass;
@@ -324,9 +333,10 @@ virDomainCapsEnumClear(virDomainCapsEnumPtr capsEnum) void virDomainCapsFeaturesInitUnsupported(virDomainCapsPtr caps) { - caps->iothreads = VIR_TRISTATE_BOOL_NO; - caps->vmcoreinfo = VIR_TRISTATE_BOOL_NO; - caps->genid = VIR_TRISTATE_BOOL_NO; + size_t i; + + for (i = 0; i < VIR_DOMAIN_CAPS_FEATURE_LAST; i++) + caps->features[i] = VIR_TRISTATE_BOOL_NO; }
@@ -619,11 +629,16 @@ virDomainCapsFormatFeatures(const virDomainCaps *caps, virBufferPtr buf) { g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf); + size_t i;
virDomainCapsFeatureGICFormat(&childBuf, &caps->gic); - qemuDomainCapsFeatureFormatSimple(&childBuf, "iothreads", caps->iothreads); - qemuDomainCapsFeatureFormatSimple(&childBuf, "vmcoreinfo", caps->vmcoreinfo); - qemuDomainCapsFeatureFormatSimple(&childBuf, "genid", caps->genid); + + for (i = 0; i < VIR_DOMAIN_CAPS_FEATURE_LAST; i++) {
if (i == VIR_DOMAIN_CAPS_FEATURE_IOTHREADS) continue; or leave the iothreads feature stored separately (unless it's really okay to output the feature in two places)
+ qemuDomainCapsFeatureFormatSimple(&childBuf, + virDomainCapsFeatureTypeToString(i), + caps->features[i]); + } + virDomainCapsFeatureSEVFormat(&childBuf, caps->sev);
virXMLFormatElement(buf, "features", NULL, &childBuf);
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

Add a helper which converts qemu emulator capabilities to the domain capability XML. This will simplify future additions of new features. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/qemu/qemu_capabilities.c | 39 ++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index a1fbf0da34..483c3fcf0f 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -5281,12 +5281,35 @@ virQEMUCapsFillDomainCPUCaps(virCapsPtr caps, } +struct virQEMUCapsDomainFeatureCapabilityTuple { + virDomainCapsFeature domcap; + virQEMUCapsFlags qemucap; +}; + +/** + * This maps the qemu features to the entries in <features> of the domain + * capability XML. Use QEMU_CAPS_LAST as qemucap to always enable the feature. + */ +static const struct virQEMUCapsDomainFeatureCapabilityTuple domCapsTuples[] = { + { VIR_DOMAIN_CAPS_FEATURE_IOTHREADS, QEMU_CAPS_OBJECT_IOTHREAD }, + { VIR_DOMAIN_CAPS_FEATURE_VMCOREINFO, QEMU_CAPS_DEVICE_VMCOREINFO }, + { VIR_DOMAIN_CAPS_FEATURE_GENID, QEMU_CAPS_DEVICE_VMGENID }, +}; + + static void -virQEMUCapsFillDomainIOThreadCaps(virQEMUCapsPtr qemuCaps, - virDomainCapsPtr domCaps) +virQEMUCapsFillDomainFeaturesFromQEMUCaps(virQEMUCapsPtr qemuCaps, + virDomainCapsPtr domCaps) { - domCaps->features[VIR_DOMAIN_CAPS_FEATURE_IOTHREADS] = virTristateBoolFromBool( - virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_IOTHREAD)); + size_t i; + + virDomainCapsFeaturesInitUnsupported(domCaps); + + for (i = 0; i < G_N_ELEMENTS(domCapsTuples); i++) { + if (domCapsTuples[i].qemucap == QEMU_CAPS_LAST || + virQEMUCapsGet(qemuCaps, domCapsTuples[i].qemucap)) + domCaps->features[domCapsTuples[i].domcap] = VIR_TRISTATE_BOOL_YES; + } } @@ -5572,6 +5595,7 @@ virQEMUCapsFillDomainCaps(virCapsPtr caps, virDomainCapsDeviceRNGPtr rng = &domCaps->rng; virDomainCapsFeaturesInitUnsupported(domCaps); + virQEMUCapsFillDomainFeaturesFromQEMUCaps(qemuCaps, domCaps); domCaps->maxvcpus = virQEMUCapsGetMachineMaxCpus(qemuCaps, domCaps->machine); @@ -5584,12 +5608,6 @@ virQEMUCapsFillDomainCaps(virCapsPtr caps, domCaps->maxvcpus = MIN(domCaps->maxvcpus, hostmaxvcpus); } - domCaps->features[VIR_DOMAIN_CAPS_FEATURE_VMCOREINFO] = virTristateBoolFromBool( - virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VMCOREINFO)); - - domCaps->features[VIR_DOMAIN_CAPS_FEATURE_GENID] = virTristateBoolFromBool( - virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VMGENID)); - if (virQEMUCapsFillDomainOSCaps(os, domCaps->machine, domCaps->arch, @@ -5598,7 +5616,6 @@ virQEMUCapsFillDomainCaps(virCapsPtr caps, return -1; virQEMUCapsFillDomainCPUCaps(caps, qemuCaps, domCaps); - virQEMUCapsFillDomainIOThreadCaps(qemuCaps, domCaps); virQEMUCapsFillDomainDeviceDiskCaps(qemuCaps, domCaps->machine, disk); virQEMUCapsFillDomainDeviceGraphicsCaps(qemuCaps, graphics); virQEMUCapsFillDomainDeviceVideoCaps(qemuCaps, video); -- 2.23.0

On Wed, Nov 13, 2019 at 05:05:26PM +0100, Peter Krempa wrote:
Add a helper which converts qemu emulator capabilities to the domain capability XML. This will simplify future additions of new features.
Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/qemu/qemu_capabilities.c | 39 ++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 11 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index a1fbf0da34..483c3fcf0f 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -5281,12 +5281,35 @@ virQEMUCapsFillDomainCPUCaps(virCapsPtr caps, }
+struct virQEMUCapsDomainFeatureCapabilityTuple { + virDomainCapsFeature domcap; + virQEMUCapsFlags qemucap; +}; + +/** + * This maps the qemu features to the entries in <features> of the domain + * capability XML. Use QEMU_CAPS_LAST as qemucap to always enable the feature. + */ +static const struct virQEMUCapsDomainFeatureCapabilityTuple domCapsTuples[] = { + { VIR_DOMAIN_CAPS_FEATURE_IOTHREADS, QEMU_CAPS_OBJECT_IOTHREAD }, + { VIR_DOMAIN_CAPS_FEATURE_VMCOREINFO, QEMU_CAPS_DEVICE_VMCOREINFO }, + { VIR_DOMAIN_CAPS_FEATURE_GENID, QEMU_CAPS_DEVICE_VMGENID }, +}; + + static void -virQEMUCapsFillDomainIOThreadCaps(virQEMUCapsPtr qemuCaps, - virDomainCapsPtr domCaps) +virQEMUCapsFillDomainFeaturesFromQEMUCaps(virQEMUCapsPtr qemuCaps, + virDomainCapsPtr domCaps) { - domCaps->features[VIR_DOMAIN_CAPS_FEATURE_IOTHREADS] = virTristateBoolFromBool( - virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_IOTHREAD)); + size_t i; + + virDomainCapsFeaturesInitUnsupported(domCaps); + + for (i = 0; i < G_N_ELEMENTS(domCapsTuples); i++) { + if (domCapsTuples[i].qemucap == QEMU_CAPS_LAST ||
Dropping this special value and using a separate array like domCapsAlwaysOn would be more readable. Especially since you don't mandate an entry for each existing DOMAIN_CAPS_FEATURE
+ virQEMUCapsGet(qemuCaps, domCapsTuples[i].qemucap)) + domCaps->features[domCapsTuples[i].domcap] = VIR_TRISTATE_BOOL_YES; + } }
@@ -5572,6 +5595,7 @@ virQEMUCapsFillDomainCaps(virCapsPtr caps, virDomainCapsDeviceRNGPtr rng = &domCaps->rng;
virDomainCapsFeaturesInitUnsupported(domCaps); + virQEMUCapsFillDomainFeaturesFromQEMUCaps(qemuCaps, domCaps);
domCaps->maxvcpus = virQEMUCapsGetMachineMaxCpus(qemuCaps, domCaps->machine); @@ -5584,12 +5608,6 @@ virQEMUCapsFillDomainCaps(virCapsPtr caps, domCaps->maxvcpus = MIN(domCaps->maxvcpus, hostmaxvcpus); }
- domCaps->features[VIR_DOMAIN_CAPS_FEATURE_VMCOREINFO] = virTristateBoolFromBool( - virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VMCOREINFO)); - - domCaps->features[VIR_DOMAIN_CAPS_FEATURE_GENID] = virTristateBoolFromBool( - virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VMGENID)); - if (virQEMUCapsFillDomainOSCaps(os, domCaps->machine, domCaps->arch,
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano
participants (4)
-
Cole Robinson
-
Ján Tomko
-
Michal Privoznik
-
Peter Krempa