[libvirt] [PATCH 0/7] qemu: use domCaps for validation

I'm trying to remove some hurdles and pitfalls WRT extending domaincapabilities data. One issue is that it's too easy to add invalid data to it, or let the data become out of date. For example the first two patches of this series add <rng model=X> domcaps reporting. The logic to fill in the domcaps data from qemuCaps is nearly identical to the logic we use to validate rng->model in qemuDomainRNGDefValidate. If just those patches are added, and later a new qemu rng model was introduced, a future patch could easily miss updated domaincapabilities output. This series aims to set up a pattern to prevent these types of issues from sneaking in. A function virDomainCapsDeviceDefValidate is added which will use domcaps data to perform validation against a devicedef. The existing qemu <rng> model validation is moved there. This ensures that any future <rng> model additions, if they want to work in the qemu driver, effectively need to extend domaincapabilities as well. It's also theoretically useful for other drivers too. One issue is that at DomainDefValidate time we don't have domCaps handy, or any cache layer for domCaps assembling. Patch #4 adds a domCapsCache hashtable to the virQEMUCaps class for caching domCaps builds based on the full tuple of emulator+machine+arch+virttype. If qemuCaps need to be regenerated, the domCaps cache is wiped out for us so we don't need to worry about the data being stale, it's tied to the lifetime of a qemuCaps instance. Cole Robinson (7): conf: domcaps: Report device <rng> qemu: capabilities: fill in domcaps <rng> qemu: conf: add virQEMUDriverGetDomainCapabilities qemu: conf: Cache domCaps in qemuCaps conf: domcaps: Add virDomainCapsDeviceDefValidate qemu: domain: Call virDomainCapsDeviceDefValidate qemu: Move rng model validation to domcaps docs/formatdomaincaps.html.in | 35 ++++++++ docs/schemas/domaincaps.rng | 10 +++ src/conf/domain_capabilities.c | 83 ++++++++++++++++++ src/conf/domain_capabilities.h | 14 ++++ src/libvirt_private.syms | 1 + src/qemu/qemu_capabilities.c | 41 +++++++++ src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_conf.c | 84 +++++++++++++++++++ src/qemu/qemu_conf.h | 7 ++ src/qemu/qemu_domain.c | 38 +++------ src/qemu/qemu_driver.c | 18 +--- .../qemu_1.7.0.x86_64.xml | 9 ++ .../qemu_2.12.0-virt.aarch64.xml | 11 +++ .../qemu_2.12.0.ppc64.xml | 11 +++ .../qemu_2.12.0.s390x.xml | 11 +++ .../qemu_2.12.0.x86_64.xml | 11 +++ .../qemu_2.6.0-virt.aarch64.xml | 11 +++ .../qemu_2.6.0.aarch64.xml | 11 +++ .../domaincapsschemadata/qemu_2.6.0.ppc64.xml | 11 +++ .../qemu_2.6.0.x86_64.xml | 11 +++ .../domaincapsschemadata/qemu_2.7.0.s390x.xml | 11 +++ .../qemu_2.8.0-tcg.x86_64.xml | 11 +++ .../domaincapsschemadata/qemu_2.8.0.s390x.xml | 11 +++ .../qemu_2.8.0.x86_64.xml | 11 +++ .../qemu_2.9.0-q35.x86_64.xml | 11 +++ .../qemu_2.9.0-tcg.x86_64.xml | 11 +++ .../qemu_2.9.0.x86_64.xml | 11 +++ .../domaincapsschemadata/qemu_3.0.0.s390x.xml | 11 +++ .../qemu_4.0.0.x86_64.xml | 11 +++ 29 files changed, 488 insertions(+), 40 deletions(-) -- 2.21.0

This adds device <rng> reporting. Example output: <rng supported='yes'> <enum name='model'> <value>virtio</value> <value>virtio-transitional</value> <value>virtio-non-transitional</value> </enum> <enum name='backendModel'> <value>random</value> <value>egd</value> </enum> </rng> Signed-off-by: Cole Robinson <crobinso@redhat.com> --- docs/formatdomaincaps.html.in | 35 ++++++++++++++++++++++++++++++++++ docs/schemas/domaincaps.rng | 10 ++++++++++ src/conf/domain_capabilities.c | 14 ++++++++++++++ src/conf/domain_capabilities.h | 9 +++++++++ 4 files changed, 68 insertions(+) diff --git a/docs/formatdomaincaps.html.in b/docs/formatdomaincaps.html.in index 2583f9bead..22ddab4301 100644 --- a/docs/formatdomaincaps.html.in +++ b/docs/formatdomaincaps.html.in @@ -427,6 +427,41 @@ element.</dd> </dl> + + <h4><a id="elementsRNG">RNG device</a></h4> + <p>RNG device capabilities are exposed under the + <code>rng</code> element. For instance:</p> + +<pre> +<domainCapabilities> + ... + <devices> + <rng supported='yes'> + <enum name='model'> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + </enum> + <enum name='backendModel'> + <value>random</value> + <value>egd</value> + </enum> + </rng> + ... + </devices> +</domainCapabilities> +</pre> + + <dl> + <dt><code>model</code></dt> + <dd>Options for the <code>model</code> attribute of the + <rng> element.</dd> + <dt><code>backendModel</code></dt> + <dd>Options for the <code>model</code> attribute of the + <rng><backend> element.</dd> + </dl> + + <h3><a id="elementsFeatures">Features</a></h3> <p>One more set of XML elements describe the supported features and diff --git a/docs/schemas/domaincaps.rng b/docs/schemas/domaincaps.rng index 3c42cb8075..d1b4d930d9 100644 --- a/docs/schemas/domaincaps.rng +++ b/docs/schemas/domaincaps.rng @@ -154,6 +154,9 @@ <optional> <ref name='hostdev'/> </optional> + <optional> + <ref name='rng'/> + </optional> </element> </define> @@ -185,6 +188,13 @@ </element> </define> + <define name='rng'> + <element name='rng'> + <ref name='supported'/> + <ref name='enum'/> + </element> + </define> + <define name='features'> <element name='features'> <optional> diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index 5a8f48da61..03757ba8cd 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -543,6 +543,19 @@ virDomainCapsDeviceHostdevFormat(virBufferPtr buf, } +static void +virDomainCapsDeviceRNGFormat(virBufferPtr buf, + virDomainCapsDeviceRNGPtr const rng) +{ + FORMAT_PROLOGUE(rng); + + ENUM_PROCESS(rng, model, virDomainRNGModelTypeToString); + ENUM_PROCESS(rng, backendModel, virDomainRNGBackendTypeToString); + + FORMAT_EPILOGUE(rng); +} + + /** * virDomainCapsFeatureGICFormat: * @buf: target buffer @@ -621,6 +634,7 @@ virDomainCapsFormat(virDomainCapsPtr const caps) virDomainCapsDeviceGraphicsFormat(&buf, &caps->graphics); virDomainCapsDeviceVideoFormat(&buf, &caps->video); virDomainCapsDeviceHostdevFormat(&buf, &caps->hostdev); + virDomainCapsDeviceRNGFormat(&buf, &caps->rng); virBufferAdjustIndent(&buf, -2); virBufferAddLit(&buf, "</devices>\n"); diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h index 26f4b8c394..052191d284 100644 --- a/src/conf/domain_capabilities.h +++ b/src/conf/domain_capabilities.h @@ -96,6 +96,14 @@ struct _virDomainCapsDeviceHostdev { /* add new fields here */ }; +typedef struct _virDomainCapsDeviceRNG virDomainCapsDeviceRNG; +typedef virDomainCapsDeviceRNG *virDomainCapsDeviceRNGPtr; +struct _virDomainCapsDeviceRNG { + virTristateBool supported; + virDomainCapsEnum model; /* virDomainRNGModel */ + virDomainCapsEnum backendModel; /* virDomainRNGBackend */ +}; + typedef struct _virDomainCapsFeatureGIC virDomainCapsFeatureGIC; typedef virDomainCapsFeatureGIC *virDomainCapsFeatureGICPtr; struct _virDomainCapsFeatureGIC { @@ -165,6 +173,7 @@ struct _virDomainCaps { virDomainCapsDeviceGraphics graphics; virDomainCapsDeviceVideo video; virDomainCapsDeviceHostdev hostdev; + virDomainCapsDeviceRNG rng; /* add new domain devices here */ virDomainCapsFeatureGIC gic; -- 2.21.0

The model logic is taken from qemuDomainRNGDefValidate Signed-off-by: Cole Robinson <crobinso@redhat.com> --- src/qemu/qemu_capabilities.c | 30 +++++++++++++++++++ .../qemu_1.7.0.x86_64.xml | 9 ++++++ .../qemu_2.12.0-virt.aarch64.xml | 11 +++++++ .../qemu_2.12.0.ppc64.xml | 11 +++++++ .../qemu_2.12.0.s390x.xml | 11 +++++++ .../qemu_2.12.0.x86_64.xml | 11 +++++++ .../qemu_2.6.0-virt.aarch64.xml | 11 +++++++ .../qemu_2.6.0.aarch64.xml | 11 +++++++ .../domaincapsschemadata/qemu_2.6.0.ppc64.xml | 11 +++++++ .../qemu_2.6.0.x86_64.xml | 11 +++++++ .../domaincapsschemadata/qemu_2.7.0.s390x.xml | 11 +++++++ .../qemu_2.8.0-tcg.x86_64.xml | 11 +++++++ .../domaincapsschemadata/qemu_2.8.0.s390x.xml | 11 +++++++ .../qemu_2.8.0.x86_64.xml | 11 +++++++ .../qemu_2.9.0-q35.x86_64.xml | 11 +++++++ .../qemu_2.9.0-tcg.x86_64.xml | 11 +++++++ .../qemu_2.9.0.x86_64.xml | 11 +++++++ .../domaincapsschemadata/qemu_3.0.0.s390x.xml | 11 +++++++ .../qemu_4.0.0.x86_64.xml | 11 +++++++ 19 files changed, 226 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 71d4c01296..46ba5e30b5 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -5165,6 +5165,34 @@ virQEMUCapsFillDomainDeviceHostdevCaps(virQEMUCapsPtr qemuCaps, } +static int +virQEMUCapsFillDomainDeviceRNGCaps(virQEMUCapsPtr qemuCaps, + virDomainCapsDeviceRNGPtr rng) +{ + rng->supported = VIR_TRISTATE_BOOL_YES; + rng->model.report = true; + rng->backendModel.report = true; + + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_RNG)) { + VIR_DOMAIN_CAPS_ENUM_SET(rng->model, VIR_DOMAIN_RNG_MODEL_VIRTIO); + + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_PCI_TRANSITIONAL) || + virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY)) { + VIR_DOMAIN_CAPS_ENUM_SET(rng->model, + VIR_DOMAIN_RNG_MODEL_VIRTIO_TRANSITIONAL, + VIR_DOMAIN_RNG_MODEL_VIRTIO_NON_TRANSITIONAL); + } + } + + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_RNG_EGD)) + VIR_DOMAIN_CAPS_ENUM_SET(rng->backendModel, VIR_DOMAIN_RNG_BACKEND_EGD); + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_RNG_RANDOM)) + VIR_DOMAIN_CAPS_ENUM_SET(rng->backendModel, VIR_DOMAIN_RNG_BACKEND_RANDOM); + + return 0; +} + + /** * virQEMUCapsSupportsGICVersion: * @qemuCaps: QEMU capabilities @@ -5306,6 +5334,7 @@ virQEMUCapsFillDomainCaps(virCapsPtr caps, virDomainCapsDeviceHostdevPtr hostdev = &domCaps->hostdev; virDomainCapsDeviceGraphicsPtr graphics = &domCaps->graphics; virDomainCapsDeviceVideoPtr video = &domCaps->video; + virDomainCapsDeviceRNGPtr rng = &domCaps->rng; domCaps->maxvcpus = virQEMUCapsGetMachineMaxCpus(qemuCaps, domCaps->machine); @@ -5332,6 +5361,7 @@ virQEMUCapsFillDomainCaps(virCapsPtr caps, virQEMUCapsFillDomainDeviceGraphicsCaps(qemuCaps, graphics) < 0 || virQEMUCapsFillDomainDeviceVideoCaps(qemuCaps, video) < 0 || virQEMUCapsFillDomainDeviceHostdevCaps(qemuCaps, hostdev) < 0 || + virQEMUCapsFillDomainDeviceRNGCaps(qemuCaps, rng) < 0 || virQEMUCapsFillDomainFeatureGICCaps(qemuCaps, domCaps) < 0 || virQEMUCapsFillDomainFeatureSEVCaps(qemuCaps, domCaps) < 0) return -1; diff --git a/tests/domaincapsschemadata/qemu_1.7.0.x86_64.xml b/tests/domaincapsschemadata/qemu_1.7.0.x86_64.xml index 497363bbe9..a9b0efdbdb 100644 --- a/tests/domaincapsschemadata/qemu_1.7.0.x86_64.xml +++ b/tests/domaincapsschemadata/qemu_1.7.0.x86_64.xml @@ -109,6 +109,15 @@ <value>vfio</value> </enum> </hostdev> + <rng supported='yes'> + <enum name='model'> + <value>virtio</value> + </enum> + <enum name='backendModel'> + <value>random</value> + <value>egd</value> + </enum> + </rng> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsschemadata/qemu_2.12.0-virt.aarch64.xml b/tests/domaincapsschemadata/qemu_2.12.0-virt.aarch64.xml index 7639df44c6..654ce1f538 100644 --- a/tests/domaincapsschemadata/qemu_2.12.0-virt.aarch64.xml +++ b/tests/domaincapsschemadata/qemu_2.12.0-virt.aarch64.xml @@ -114,6 +114,17 @@ <value>vfio</value> </enum> </hostdev> + <rng supported='yes'> + <enum name='model'> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + </enum> + <enum name='backendModel'> + <value>random</value> + <value>egd</value> + </enum> + </rng> </devices> <features> <gic supported='yes'> diff --git a/tests/domaincapsschemadata/qemu_2.12.0.ppc64.xml b/tests/domaincapsschemadata/qemu_2.12.0.ppc64.xml index f10d361359..2ac32fcb3b 100644 --- a/tests/domaincapsschemadata/qemu_2.12.0.ppc64.xml +++ b/tests/domaincapsschemadata/qemu_2.12.0.ppc64.xml @@ -80,6 +80,17 @@ <value>vfio</value> </enum> </hostdev> + <rng supported='yes'> + <enum name='model'> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + </enum> + <enum name='backendModel'> + <value>random</value> + <value>egd</value> + </enum> + </rng> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsschemadata/qemu_2.12.0.s390x.xml b/tests/domaincapsschemadata/qemu_2.12.0.s390x.xml index 41a81ff02f..fa377d33a0 100644 --- a/tests/domaincapsschemadata/qemu_2.12.0.s390x.xml +++ b/tests/domaincapsschemadata/qemu_2.12.0.s390x.xml @@ -172,6 +172,17 @@ <value>vfio</value> </enum> </hostdev> + <rng supported='yes'> + <enum name='model'> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + </enum> + <enum name='backendModel'> + <value>random</value> + <value>egd</value> + </enum> + </rng> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsschemadata/qemu_2.12.0.x86_64.xml b/tests/domaincapsschemadata/qemu_2.12.0.x86_64.xml index 5913e7fc63..712b83f443 100644 --- a/tests/domaincapsschemadata/qemu_2.12.0.x86_64.xml +++ b/tests/domaincapsschemadata/qemu_2.12.0.x86_64.xml @@ -142,6 +142,17 @@ <value>vfio</value> </enum> </hostdev> + <rng supported='yes'> + <enum name='model'> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + </enum> + <enum name='backendModel'> + <value>random</value> + <value>egd</value> + </enum> + </rng> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsschemadata/qemu_2.6.0-virt.aarch64.xml b/tests/domaincapsschemadata/qemu_2.6.0-virt.aarch64.xml index 9ee801092e..26bd16788a 100644 --- a/tests/domaincapsschemadata/qemu_2.6.0-virt.aarch64.xml +++ b/tests/domaincapsschemadata/qemu_2.6.0-virt.aarch64.xml @@ -111,6 +111,17 @@ <value>vfio</value> </enum> </hostdev> + <rng supported='yes'> + <enum name='model'> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + </enum> + <enum name='backendModel'> + <value>random</value> + <value>egd</value> + </enum> + </rng> </devices> <features> <gic supported='yes'> diff --git a/tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml b/tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml index 4dd0b52ed3..3aa5474e64 100644 --- a/tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml +++ b/tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml @@ -111,6 +111,17 @@ <value>vfio</value> </enum> </hostdev> + <rng supported='yes'> + <enum name='model'> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + </enum> + <enum name='backendModel'> + <value>random</value> + <value>egd</value> + </enum> + </rng> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsschemadata/qemu_2.6.0.ppc64.xml b/tests/domaincapsschemadata/qemu_2.6.0.ppc64.xml index aa982d237e..cb179b34af 100644 --- a/tests/domaincapsschemadata/qemu_2.6.0.ppc64.xml +++ b/tests/domaincapsschemadata/qemu_2.6.0.ppc64.xml @@ -84,6 +84,17 @@ <value>vfio</value> </enum> </hostdev> + <rng supported='yes'> + <enum name='model'> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + </enum> + <enum name='backendModel'> + <value>random</value> + <value>egd</value> + </enum> + </rng> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml b/tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml index 6aa3f52ee4..5a675e205f 100644 --- a/tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml +++ b/tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml @@ -116,6 +116,17 @@ <value>vfio</value> </enum> </hostdev> + <rng supported='yes'> + <enum name='model'> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + </enum> + <enum name='backendModel'> + <value>random</value> + <value>egd</value> + </enum> + </rng> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsschemadata/qemu_2.7.0.s390x.xml b/tests/domaincapsschemadata/qemu_2.7.0.s390x.xml index 8daa15ab9d..f601922d5e 100644 --- a/tests/domaincapsschemadata/qemu_2.7.0.s390x.xml +++ b/tests/domaincapsschemadata/qemu_2.7.0.s390x.xml @@ -77,6 +77,17 @@ <value>vfio</value> </enum> </hostdev> + <rng supported='yes'> + <enum name='model'> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + </enum> + <enum name='backendModel'> + <value>random</value> + <value>egd</value> + </enum> + </rng> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsschemadata/qemu_2.8.0-tcg.x86_64.xml b/tests/domaincapsschemadata/qemu_2.8.0-tcg.x86_64.xml index 081805aa4a..4d48e7d251 100644 --- a/tests/domaincapsschemadata/qemu_2.8.0-tcg.x86_64.xml +++ b/tests/domaincapsschemadata/qemu_2.8.0-tcg.x86_64.xml @@ -117,6 +117,17 @@ <value>vfio</value> </enum> </hostdev> + <rng supported='yes'> + <enum name='model'> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + </enum> + <enum name='backendModel'> + <value>random</value> + <value>egd</value> + </enum> + </rng> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml b/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml index 62c51e4087..f18dc262b4 100644 --- a/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml +++ b/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml @@ -158,6 +158,17 @@ <value>vfio</value> </enum> </hostdev> + <rng supported='yes'> + <enum name='model'> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + </enum> + <enum name='backendModel'> + <value>random</value> + <value>egd</value> + </enum> + </rng> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsschemadata/qemu_2.8.0.x86_64.xml b/tests/domaincapsschemadata/qemu_2.8.0.x86_64.xml index 1bb034aa4f..46d398949a 100644 --- a/tests/domaincapsschemadata/qemu_2.8.0.x86_64.xml +++ b/tests/domaincapsschemadata/qemu_2.8.0.x86_64.xml @@ -117,6 +117,17 @@ <value>vfio</value> </enum> </hostdev> + <rng supported='yes'> + <enum name='model'> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + </enum> + <enum name='backendModel'> + <value>random</value> + <value>egd</value> + </enum> + </rng> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsschemadata/qemu_2.9.0-q35.x86_64.xml b/tests/domaincapsschemadata/qemu_2.9.0-q35.x86_64.xml index 67c6d5e77e..a7392c0929 100644 --- a/tests/domaincapsschemadata/qemu_2.9.0-q35.x86_64.xml +++ b/tests/domaincapsschemadata/qemu_2.9.0-q35.x86_64.xml @@ -125,6 +125,17 @@ <value>vfio</value> </enum> </hostdev> + <rng supported='yes'> + <enum name='model'> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + </enum> + <enum name='backendModel'> + <value>random</value> + <value>egd</value> + </enum> + </rng> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsschemadata/qemu_2.9.0-tcg.x86_64.xml b/tests/domaincapsschemadata/qemu_2.9.0-tcg.x86_64.xml index 588ef08199..f94f805b81 100644 --- a/tests/domaincapsschemadata/qemu_2.9.0-tcg.x86_64.xml +++ b/tests/domaincapsschemadata/qemu_2.9.0-tcg.x86_64.xml @@ -149,6 +149,17 @@ <value>vfio</value> </enum> </hostdev> + <rng supported='yes'> + <enum name='model'> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + </enum> + <enum name='backendModel'> + <value>random</value> + <value>egd</value> + </enum> + </rng> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml b/tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml index 598937a971..b0039c8246 100644 --- a/tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml +++ b/tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml @@ -126,6 +126,17 @@ <value>vfio</value> </enum> </hostdev> + <rng supported='yes'> + <enum name='model'> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + </enum> + <enum name='backendModel'> + <value>random</value> + <value>egd</value> + </enum> + </rng> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsschemadata/qemu_3.0.0.s390x.xml b/tests/domaincapsschemadata/qemu_3.0.0.s390x.xml index 1d97f1f344..b33ff6a09d 100644 --- a/tests/domaincapsschemadata/qemu_3.0.0.s390x.xml +++ b/tests/domaincapsschemadata/qemu_3.0.0.s390x.xml @@ -178,6 +178,17 @@ <value>vfio</value> </enum> </hostdev> + <rng supported='yes'> + <enum name='model'> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + </enum> + <enum name='backendModel'> + <value>random</value> + <value>egd</value> + </enum> + </rng> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsschemadata/qemu_4.0.0.x86_64.xml b/tests/domaincapsschemadata/qemu_4.0.0.x86_64.xml index df66be9e29..7596e414d6 100644 --- a/tests/domaincapsschemadata/qemu_4.0.0.x86_64.xml +++ b/tests/domaincapsschemadata/qemu_4.0.0.x86_64.xml @@ -143,6 +143,17 @@ <value>vfio</value> </enum> </hostdev> + <rng supported='yes'> + <enum name='model'> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + </enum> + <enum name='backendModel'> + <value>random</value> + <value>egd</value> + </enum> + </rng> </devices> <features> <gic supported='no'/> -- 2.21.0

Running make check on the patch series, using the current master branch, I got the following error: TEST: domaincapstest ..................!. 20 FAIL FAIL domaincapstest (exit status: 255) Running it manually: In '/home/danielhb/kvm-project/libvirt/tests/domaincapsschemadata/qemu_3.1.0.x86_64.xml': Offset 5119 Expect [<] Actual [ <rng supported='yes'> <enum name='model'> <value>virtio</value> <value>virtio-transitional</value> <value>virtio-non-transitional</value> </enum> <enum name='backendModel'> <value>random</value> <value>egd</value> </enum> </rng> <] ... FAILED I believe that you'll need to update the file qemu_3.1.0.x86_64.xml as well. DHB On 4/4/19 8:37 PM, Cole Robinson wrote:
The model logic is taken from qemuDomainRNGDefValidate
Signed-off-by: Cole Robinson <crobinso@redhat.com> --- src/qemu/qemu_capabilities.c | 30 +++++++++++++++++++ .../qemu_1.7.0.x86_64.xml | 9 ++++++ .../qemu_2.12.0-virt.aarch64.xml | 11 +++++++ .../qemu_2.12.0.ppc64.xml | 11 +++++++ .../qemu_2.12.0.s390x.xml | 11 +++++++ .../qemu_2.12.0.x86_64.xml | 11 +++++++ .../qemu_2.6.0-virt.aarch64.xml | 11 +++++++ .../qemu_2.6.0.aarch64.xml | 11 +++++++ .../domaincapsschemadata/qemu_2.6.0.ppc64.xml | 11 +++++++ .../qemu_2.6.0.x86_64.xml | 11 +++++++ .../domaincapsschemadata/qemu_2.7.0.s390x.xml | 11 +++++++ .../qemu_2.8.0-tcg.x86_64.xml | 11 +++++++ .../domaincapsschemadata/qemu_2.8.0.s390x.xml | 11 +++++++ .../qemu_2.8.0.x86_64.xml | 11 +++++++ .../qemu_2.9.0-q35.x86_64.xml | 11 +++++++ .../qemu_2.9.0-tcg.x86_64.xml | 11 +++++++ .../qemu_2.9.0.x86_64.xml | 11 +++++++ .../domaincapsschemadata/qemu_3.0.0.s390x.xml | 11 +++++++ .../qemu_4.0.0.x86_64.xml | 11 +++++++ 19 files changed, 226 insertions(+)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 71d4c01296..46ba5e30b5 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -5165,6 +5165,34 @@ virQEMUCapsFillDomainDeviceHostdevCaps(virQEMUCapsPtr qemuCaps, }
+static int +virQEMUCapsFillDomainDeviceRNGCaps(virQEMUCapsPtr qemuCaps, + virDomainCapsDeviceRNGPtr rng) +{ + rng->supported = VIR_TRISTATE_BOOL_YES; + rng->model.report = true; + rng->backendModel.report = true; + + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_RNG)) { + VIR_DOMAIN_CAPS_ENUM_SET(rng->model, VIR_DOMAIN_RNG_MODEL_VIRTIO); + + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_PCI_TRANSITIONAL) || + virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY)) { + VIR_DOMAIN_CAPS_ENUM_SET(rng->model, + VIR_DOMAIN_RNG_MODEL_VIRTIO_TRANSITIONAL, + VIR_DOMAIN_RNG_MODEL_VIRTIO_NON_TRANSITIONAL); + } + } + + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_RNG_EGD)) + VIR_DOMAIN_CAPS_ENUM_SET(rng->backendModel, VIR_DOMAIN_RNG_BACKEND_EGD); + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_RNG_RANDOM)) + VIR_DOMAIN_CAPS_ENUM_SET(rng->backendModel, VIR_DOMAIN_RNG_BACKEND_RANDOM); + + return 0; +} + + /** * virQEMUCapsSupportsGICVersion: * @qemuCaps: QEMU capabilities @@ -5306,6 +5334,7 @@ virQEMUCapsFillDomainCaps(virCapsPtr caps, virDomainCapsDeviceHostdevPtr hostdev = &domCaps->hostdev; virDomainCapsDeviceGraphicsPtr graphics = &domCaps->graphics; virDomainCapsDeviceVideoPtr video = &domCaps->video; + virDomainCapsDeviceRNGPtr rng = &domCaps->rng;
domCaps->maxvcpus = virQEMUCapsGetMachineMaxCpus(qemuCaps, domCaps->machine); @@ -5332,6 +5361,7 @@ virQEMUCapsFillDomainCaps(virCapsPtr caps, virQEMUCapsFillDomainDeviceGraphicsCaps(qemuCaps, graphics) < 0 || virQEMUCapsFillDomainDeviceVideoCaps(qemuCaps, video) < 0 || virQEMUCapsFillDomainDeviceHostdevCaps(qemuCaps, hostdev) < 0 || + virQEMUCapsFillDomainDeviceRNGCaps(qemuCaps, rng) < 0 || virQEMUCapsFillDomainFeatureGICCaps(qemuCaps, domCaps) < 0 || virQEMUCapsFillDomainFeatureSEVCaps(qemuCaps, domCaps) < 0) return -1; diff --git a/tests/domaincapsschemadata/qemu_1.7.0.x86_64.xml b/tests/domaincapsschemadata/qemu_1.7.0.x86_64.xml index 497363bbe9..a9b0efdbdb 100644 --- a/tests/domaincapsschemadata/qemu_1.7.0.x86_64.xml +++ b/tests/domaincapsschemadata/qemu_1.7.0.x86_64.xml @@ -109,6 +109,15 @@ <value>vfio</value> </enum> </hostdev> + <rng supported='yes'> + <enum name='model'> + <value>virtio</value> + </enum> + <enum name='backendModel'> + <value>random</value> + <value>egd</value> + </enum> + </rng> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsschemadata/qemu_2.12.0-virt.aarch64.xml b/tests/domaincapsschemadata/qemu_2.12.0-virt.aarch64.xml index 7639df44c6..654ce1f538 100644 --- a/tests/domaincapsschemadata/qemu_2.12.0-virt.aarch64.xml +++ b/tests/domaincapsschemadata/qemu_2.12.0-virt.aarch64.xml @@ -114,6 +114,17 @@ <value>vfio</value> </enum> </hostdev> + <rng supported='yes'> + <enum name='model'> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + </enum> + <enum name='backendModel'> + <value>random</value> + <value>egd</value> + </enum> + </rng> </devices> <features> <gic supported='yes'> diff --git a/tests/domaincapsschemadata/qemu_2.12.0.ppc64.xml b/tests/domaincapsschemadata/qemu_2.12.0.ppc64.xml index f10d361359..2ac32fcb3b 100644 --- a/tests/domaincapsschemadata/qemu_2.12.0.ppc64.xml +++ b/tests/domaincapsschemadata/qemu_2.12.0.ppc64.xml @@ -80,6 +80,17 @@ <value>vfio</value> </enum> </hostdev> + <rng supported='yes'> + <enum name='model'> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + </enum> + <enum name='backendModel'> + <value>random</value> + <value>egd</value> + </enum> + </rng> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsschemadata/qemu_2.12.0.s390x.xml b/tests/domaincapsschemadata/qemu_2.12.0.s390x.xml index 41a81ff02f..fa377d33a0 100644 --- a/tests/domaincapsschemadata/qemu_2.12.0.s390x.xml +++ b/tests/domaincapsschemadata/qemu_2.12.0.s390x.xml @@ -172,6 +172,17 @@ <value>vfio</value> </enum> </hostdev> + <rng supported='yes'> + <enum name='model'> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + </enum> + <enum name='backendModel'> + <value>random</value> + <value>egd</value> + </enum> + </rng> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsschemadata/qemu_2.12.0.x86_64.xml b/tests/domaincapsschemadata/qemu_2.12.0.x86_64.xml index 5913e7fc63..712b83f443 100644 --- a/tests/domaincapsschemadata/qemu_2.12.0.x86_64.xml +++ b/tests/domaincapsschemadata/qemu_2.12.0.x86_64.xml @@ -142,6 +142,17 @@ <value>vfio</value> </enum> </hostdev> + <rng supported='yes'> + <enum name='model'> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + </enum> + <enum name='backendModel'> + <value>random</value> + <value>egd</value> + </enum> + </rng> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsschemadata/qemu_2.6.0-virt.aarch64.xml b/tests/domaincapsschemadata/qemu_2.6.0-virt.aarch64.xml index 9ee801092e..26bd16788a 100644 --- a/tests/domaincapsschemadata/qemu_2.6.0-virt.aarch64.xml +++ b/tests/domaincapsschemadata/qemu_2.6.0-virt.aarch64.xml @@ -111,6 +111,17 @@ <value>vfio</value> </enum> </hostdev> + <rng supported='yes'> + <enum name='model'> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + </enum> + <enum name='backendModel'> + <value>random</value> + <value>egd</value> + </enum> + </rng> </devices> <features> <gic supported='yes'> diff --git a/tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml b/tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml index 4dd0b52ed3..3aa5474e64 100644 --- a/tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml +++ b/tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml @@ -111,6 +111,17 @@ <value>vfio</value> </enum> </hostdev> + <rng supported='yes'> + <enum name='model'> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + </enum> + <enum name='backendModel'> + <value>random</value> + <value>egd</value> + </enum> + </rng> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsschemadata/qemu_2.6.0.ppc64.xml b/tests/domaincapsschemadata/qemu_2.6.0.ppc64.xml index aa982d237e..cb179b34af 100644 --- a/tests/domaincapsschemadata/qemu_2.6.0.ppc64.xml +++ b/tests/domaincapsschemadata/qemu_2.6.0.ppc64.xml @@ -84,6 +84,17 @@ <value>vfio</value> </enum> </hostdev> + <rng supported='yes'> + <enum name='model'> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + </enum> + <enum name='backendModel'> + <value>random</value> + <value>egd</value> + </enum> + </rng> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml b/tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml index 6aa3f52ee4..5a675e205f 100644 --- a/tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml +++ b/tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml @@ -116,6 +116,17 @@ <value>vfio</value> </enum> </hostdev> + <rng supported='yes'> + <enum name='model'> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + </enum> + <enum name='backendModel'> + <value>random</value> + <value>egd</value> + </enum> + </rng> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsschemadata/qemu_2.7.0.s390x.xml b/tests/domaincapsschemadata/qemu_2.7.0.s390x.xml index 8daa15ab9d..f601922d5e 100644 --- a/tests/domaincapsschemadata/qemu_2.7.0.s390x.xml +++ b/tests/domaincapsschemadata/qemu_2.7.0.s390x.xml @@ -77,6 +77,17 @@ <value>vfio</value> </enum> </hostdev> + <rng supported='yes'> + <enum name='model'> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + </enum> + <enum name='backendModel'> + <value>random</value> + <value>egd</value> + </enum> + </rng> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsschemadata/qemu_2.8.0-tcg.x86_64.xml b/tests/domaincapsschemadata/qemu_2.8.0-tcg.x86_64.xml index 081805aa4a..4d48e7d251 100644 --- a/tests/domaincapsschemadata/qemu_2.8.0-tcg.x86_64.xml +++ b/tests/domaincapsschemadata/qemu_2.8.0-tcg.x86_64.xml @@ -117,6 +117,17 @@ <value>vfio</value> </enum> </hostdev> + <rng supported='yes'> + <enum name='model'> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + </enum> + <enum name='backendModel'> + <value>random</value> + <value>egd</value> + </enum> + </rng> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml b/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml index 62c51e4087..f18dc262b4 100644 --- a/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml +++ b/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml @@ -158,6 +158,17 @@ <value>vfio</value> </enum> </hostdev> + <rng supported='yes'> + <enum name='model'> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + </enum> + <enum name='backendModel'> + <value>random</value> + <value>egd</value> + </enum> + </rng> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsschemadata/qemu_2.8.0.x86_64.xml b/tests/domaincapsschemadata/qemu_2.8.0.x86_64.xml index 1bb034aa4f..46d398949a 100644 --- a/tests/domaincapsschemadata/qemu_2.8.0.x86_64.xml +++ b/tests/domaincapsschemadata/qemu_2.8.0.x86_64.xml @@ -117,6 +117,17 @@ <value>vfio</value> </enum> </hostdev> + <rng supported='yes'> + <enum name='model'> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + </enum> + <enum name='backendModel'> + <value>random</value> + <value>egd</value> + </enum> + </rng> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsschemadata/qemu_2.9.0-q35.x86_64.xml b/tests/domaincapsschemadata/qemu_2.9.0-q35.x86_64.xml index 67c6d5e77e..a7392c0929 100644 --- a/tests/domaincapsschemadata/qemu_2.9.0-q35.x86_64.xml +++ b/tests/domaincapsschemadata/qemu_2.9.0-q35.x86_64.xml @@ -125,6 +125,17 @@ <value>vfio</value> </enum> </hostdev> + <rng supported='yes'> + <enum name='model'> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + </enum> + <enum name='backendModel'> + <value>random</value> + <value>egd</value> + </enum> + </rng> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsschemadata/qemu_2.9.0-tcg.x86_64.xml b/tests/domaincapsschemadata/qemu_2.9.0-tcg.x86_64.xml index 588ef08199..f94f805b81 100644 --- a/tests/domaincapsschemadata/qemu_2.9.0-tcg.x86_64.xml +++ b/tests/domaincapsschemadata/qemu_2.9.0-tcg.x86_64.xml @@ -149,6 +149,17 @@ <value>vfio</value> </enum> </hostdev> + <rng supported='yes'> + <enum name='model'> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + </enum> + <enum name='backendModel'> + <value>random</value> + <value>egd</value> + </enum> + </rng> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml b/tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml index 598937a971..b0039c8246 100644 --- a/tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml +++ b/tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml @@ -126,6 +126,17 @@ <value>vfio</value> </enum> </hostdev> + <rng supported='yes'> + <enum name='model'> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + </enum> + <enum name='backendModel'> + <value>random</value> + <value>egd</value> + </enum> + </rng> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsschemadata/qemu_3.0.0.s390x.xml b/tests/domaincapsschemadata/qemu_3.0.0.s390x.xml index 1d97f1f344..b33ff6a09d 100644 --- a/tests/domaincapsschemadata/qemu_3.0.0.s390x.xml +++ b/tests/domaincapsschemadata/qemu_3.0.0.s390x.xml @@ -178,6 +178,17 @@ <value>vfio</value> </enum> </hostdev> + <rng supported='yes'> + <enum name='model'> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + </enum> + <enum name='backendModel'> + <value>random</value> + <value>egd</value> + </enum> + </rng> </devices> <features> <gic supported='no'/> diff --git a/tests/domaincapsschemadata/qemu_4.0.0.x86_64.xml b/tests/domaincapsschemadata/qemu_4.0.0.x86_64.xml index df66be9e29..7596e414d6 100644 --- a/tests/domaincapsschemadata/qemu_4.0.0.x86_64.xml +++ b/tests/domaincapsschemadata/qemu_4.0.0.x86_64.xml @@ -143,6 +143,17 @@ <value>vfio</value> </enum> </hostdev> + <rng supported='yes'> + <enum name='model'> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + </enum> + <enum name='backendModel'> + <value>random</value> + <value>egd</value> + </enum> + </rng> </devices> <features> <gic supported='no'/>

For now it's just a helper for building a qemu virDomainCapsPtr. It will be used in upcoming patches Signed-off-by: Cole Robinson <crobinso@redhat.com> --- src/qemu/qemu_conf.c | 39 +++++++++++++++++++++++++++++++++++++++ src/qemu/qemu_conf.h | 7 +++++++ src/qemu/qemu_driver.c | 18 +++--------------- 3 files changed, 49 insertions(+), 15 deletions(-) diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index 41ce0a978d..635fdcc5a4 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -1357,6 +1357,45 @@ virCapsPtr virQEMUDriverGetCapabilities(virQEMUDriverPtr driver, return ret; } + +/** + * virQEMUDriverGetDomainCapabilities: + * + * Build a virDomainCapsPtr instance for the passed data. + * + * Returns: a reference to a virDomainCapsPtr instance or NULL + */ +virDomainCapsPtr +virQEMUDriverGetDomainCapabilities(virQEMUDriverPtr driver, + virQEMUCapsPtr qemuCaps, + const char *machine, + virArch arch, + virDomainVirtType virttype) +{ + virDomainCapsPtr ret = NULL, domCaps = NULL; + virCapsPtr caps = NULL; + virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); + + if (!(caps = virQEMUDriverGetCapabilities(driver, false))) + goto cleanup; + + if (!(domCaps = virDomainCapsNew(virQEMUCapsGetBinary(qemuCaps), machine, + arch, virttype))) + goto cleanup; + + if (virQEMUCapsFillDomainCaps(caps, domCaps, qemuCaps, + cfg->firmwares, cfg->nfirmwares) < 0) + goto cleanup; + + VIR_STEAL_PTR(ret, domCaps); + cleanup: + virObjectUnref(domCaps); + virObjectUnref(cfg); + virObjectUnref(caps); + return ret; +} + + struct _qemuSharedDeviceEntry { size_t ref; char **domains; /* array of domain names */ diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h index 14c9d15a72..ddf5ea4b8f 100644 --- a/src/qemu/qemu_conf.h +++ b/src/qemu/qemu_conf.h @@ -331,6 +331,13 @@ virCapsPtr virQEMUDriverCreateCapabilities(virQEMUDriverPtr driver); virCapsPtr virQEMUDriverGetCapabilities(virQEMUDriverPtr driver, bool refresh); +virDomainCapsPtr +virQEMUDriverGetDomainCapabilities(virQEMUDriverPtr driver, + virQEMUCapsPtr qemuCaps, + const char *machine, + virArch arch, + virDomainVirtType virttype); + typedef struct _qemuSharedDeviceEntry qemuSharedDeviceEntry; typedef qemuSharedDeviceEntry *qemuSharedDeviceEntryPtr; diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 7e5bbc3cc9..3e8ae8a4dc 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -19829,19 +19829,12 @@ qemuConnectGetDomainCapabilities(virConnectPtr conn, virArch arch; virDomainVirtType virttype; virDomainCapsPtr domCaps = NULL; - virQEMUDriverConfigPtr cfg = NULL; - virCapsPtr caps = NULL; virCheckFlags(0, ret); if (virConnectGetDomainCapabilitiesEnsureACL(conn) < 0) return ret; - cfg = virQEMUDriverGetConfig(driver); - - if (!(caps = virQEMUDriverGetCapabilities(driver, false))) - goto cleanup; - qemuCaps = virQEMUCapsCacheLookupDefault(driver->qemuCapsCache, emulatorbin, arch_str, @@ -19851,18 +19844,13 @@ qemuConnectGetDomainCapabilities(virConnectPtr conn, if (!qemuCaps) goto cleanup; - if (!(domCaps = virDomainCapsNew(virQEMUCapsGetBinary(qemuCaps), machine, - arch, virttype))) - goto cleanup; - - if (virQEMUCapsFillDomainCaps(caps, domCaps, qemuCaps, - cfg->firmwares, cfg->nfirmwares) < 0) + if (!(domCaps = virQEMUDriverGetDomainCapabilities(driver, + qemuCaps, machine, + arch, virttype))) goto cleanup; ret = virDomainCapsFormat(domCaps); cleanup: - virObjectUnref(cfg); - virObjectUnref(caps); virObjectUnref(domCaps); virObjectUnref(qemuCaps); return ret; -- 2.21.0

On 4/4/19 8:37 PM, Cole Robinson wrote:
For now it's just a helper for building a qemu virDomainCapsPtr. It will be used in upcoming patches
It is already being used at qemuConnectGetDomainCapabilities, making the flow easier to read. Perhaps something worth mentioning in the commit msg. Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com> --- src/qemu/qemu_conf.c | 39 +++++++++++++++++++++++++++++++++++++++ src/qemu/qemu_conf.h | 7 +++++++ src/qemu/qemu_driver.c | 18 +++--------------- 3 files changed, 49 insertions(+), 15 deletions(-)
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index 41ce0a978d..635fdcc5a4 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -1357,6 +1357,45 @@ virCapsPtr virQEMUDriverGetCapabilities(virQEMUDriverPtr driver, return ret; }
+ +/** + * virQEMUDriverGetDomainCapabilities: + * + * Build a virDomainCapsPtr instance for the passed data. + * + * Returns: a reference to a virDomainCapsPtr instance or NULL + */ +virDomainCapsPtr +virQEMUDriverGetDomainCapabilities(virQEMUDriverPtr driver, + virQEMUCapsPtr qemuCaps, + const char *machine, + virArch arch, + virDomainVirtType virttype) +{ + virDomainCapsPtr ret = NULL, domCaps = NULL; + virCapsPtr caps = NULL; + virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); + + if (!(caps = virQEMUDriverGetCapabilities(driver, false))) + goto cleanup; + + if (!(domCaps = virDomainCapsNew(virQEMUCapsGetBinary(qemuCaps), machine, + arch, virttype))) + goto cleanup; + + if (virQEMUCapsFillDomainCaps(caps, domCaps, qemuCaps, + cfg->firmwares, cfg->nfirmwares) < 0) + goto cleanup; + + VIR_STEAL_PTR(ret, domCaps); + cleanup: + virObjectUnref(domCaps); + virObjectUnref(cfg); + virObjectUnref(caps); + return ret; +} + + struct _qemuSharedDeviceEntry { size_t ref; char **domains; /* array of domain names */ diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h index 14c9d15a72..ddf5ea4b8f 100644 --- a/src/qemu/qemu_conf.h +++ b/src/qemu/qemu_conf.h @@ -331,6 +331,13 @@ virCapsPtr virQEMUDriverCreateCapabilities(virQEMUDriverPtr driver); virCapsPtr virQEMUDriverGetCapabilities(virQEMUDriverPtr driver, bool refresh);
+virDomainCapsPtr +virQEMUDriverGetDomainCapabilities(virQEMUDriverPtr driver, + virQEMUCapsPtr qemuCaps, + const char *machine, + virArch arch, + virDomainVirtType virttype); + typedef struct _qemuSharedDeviceEntry qemuSharedDeviceEntry; typedef qemuSharedDeviceEntry *qemuSharedDeviceEntryPtr;
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 7e5bbc3cc9..3e8ae8a4dc 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -19829,19 +19829,12 @@ qemuConnectGetDomainCapabilities(virConnectPtr conn, virArch arch; virDomainVirtType virttype; virDomainCapsPtr domCaps = NULL; - virQEMUDriverConfigPtr cfg = NULL; - virCapsPtr caps = NULL;
virCheckFlags(0, ret);
if (virConnectGetDomainCapabilitiesEnsureACL(conn) < 0) return ret;
- cfg = virQEMUDriverGetConfig(driver); - - if (!(caps = virQEMUDriverGetCapabilities(driver, false))) - goto cleanup; - qemuCaps = virQEMUCapsCacheLookupDefault(driver->qemuCapsCache, emulatorbin, arch_str, @@ -19851,18 +19844,13 @@ qemuConnectGetDomainCapabilities(virConnectPtr conn, if (!qemuCaps) goto cleanup;
- if (!(domCaps = virDomainCapsNew(virQEMUCapsGetBinary(qemuCaps), machine, - arch, virttype))) - goto cleanup; - - if (virQEMUCapsFillDomainCaps(caps, domCaps, qemuCaps, - cfg->firmwares, cfg->nfirmwares) < 0) + if (!(domCaps = virQEMUDriverGetDomainCapabilities(driver, + qemuCaps, machine, + arch, virttype))) goto cleanup;
ret = virDomainCapsFormat(domCaps); cleanup: - virObjectUnref(cfg); - virObjectUnref(caps); virObjectUnref(domCaps); virObjectUnref(qemuCaps); return ret;

On 4/5/19 1:37 AM, Cole Robinson wrote:
For now it's just a helper for building a qemu virDomainCapsPtr. It will be used in upcoming patches
Signed-off-by: Cole Robinson <crobinso@redhat.com> --- src/qemu/qemu_conf.c | 39 +++++++++++++++++++++++++++++++++++++++ src/qemu/qemu_conf.h | 7 +++++++ src/qemu/qemu_driver.c | 18 +++--------------- 3 files changed, 49 insertions(+), 15 deletions(-)
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index 41ce0a978d..635fdcc5a4 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -1357,6 +1357,45 @@ virCapsPtr virQEMUDriverGetCapabilities(virQEMUDriverPtr driver, return ret; }
+ +/** + * virQEMUDriverGetDomainCapabilities: + * + * Build a virDomainCapsPtr instance for the passed data. + * + * Returns: a reference to a virDomainCapsPtr instance or NULL + */ +virDomainCapsPtr +virQEMUDriverGetDomainCapabilities(virQEMUDriverPtr driver, + virQEMUCapsPtr qemuCaps, + const char *machine, + virArch arch, + virDomainVirtType virttype) +{ + virDomainCapsPtr ret = NULL, domCaps = NULL; + virCapsPtr caps = NULL; + virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); + + if (!(caps = virQEMUDriverGetCapabilities(driver, false))) + goto cleanup; + + if (!(domCaps = virDomainCapsNew(virQEMUCapsGetBinary(qemuCaps), machine, + arch, virttype))) + goto cleanup; + + if (virQEMUCapsFillDomainCaps(caps, domCaps, qemuCaps, + cfg->firmwares, cfg->nfirmwares) < 0)
You'll need to rebase this because after 5b9819eedc7 there's @privileged argument.
+ goto cleanup; + + VIR_STEAL_PTR(ret, domCaps); + cleanup: + virObjectUnref(domCaps); + virObjectUnref(cfg); + virObjectUnref(caps); + return ret; +} + +
Michal

qemuCaps is tied to a binary on disk. domCaps is tied to a combo of binary+machine+arch+virttype values. For the qemu driver this almost entirely translates to a permutation of qemuCaps though Upcoming patches want to use the domCaps data store at XML validate time, but we need to cache the data so we aren't repeatedly regenerating it. Add a domCapsCache hash table to qemuCaps. This ensures that the domCaps cache is blown away whenever qemuCaps needs to be regenerated. Adjust virQEMUDriverGetDomainCapabilities to search the cache and add to it if we don't find a hit. Signed-off-by: Cole Robinson <crobinso@redhat.com> --- src/qemu/qemu_capabilities.c | 11 +++++++ src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_conf.c | 59 +++++++++++++++++++++++++++++++----- 3 files changed, 64 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 46ba5e30b5..a3c1348157 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -582,6 +582,7 @@ struct _virQEMUCaps { virArch arch; + virHashTablePtr domCapsCache; virDomainCapsCPUModelsPtr kvmCPUModels; virDomainCapsCPUModelsPtr tcgCPUModels; @@ -1476,6 +1477,9 @@ virQEMUCapsNew(void) if (!(qemuCaps->flags = virBitmapNew(QEMU_CAPS_LAST))) goto error; + if (!(qemuCaps->domCapsCache = virHashCreate(5, virObjectFreeHashData))) + goto error; + return qemuCaps; error: @@ -1628,6 +1632,7 @@ void virQEMUCapsDispose(void *obj) } VIR_FREE(qemuCaps->machineTypes); + virHashFree(qemuCaps->domCapsCache); virObjectUnref(qemuCaps->kvmCPUModels); virObjectUnref(qemuCaps->tcgCPUModels); @@ -1790,6 +1795,12 @@ const char *virQEMUCapsGetPackage(virQEMUCapsPtr qemuCaps) } +virHashTablePtr virQEMUCapsGetDomainCapsCache(virQEMUCapsPtr qemuCaps) +{ + return qemuCaps->domCapsCache; +} + + int virQEMUCapsAddCPUDefinitions(virQEMUCapsPtr qemuCaps, virDomainVirtType type, diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index c6f6980684..2a37f0c2ff 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -538,6 +538,7 @@ const char *virQEMUCapsGetBinary(virQEMUCapsPtr qemuCaps); virArch virQEMUCapsGetArch(virQEMUCapsPtr qemuCaps); unsigned int virQEMUCapsGetVersion(virQEMUCapsPtr qemuCaps); const char *virQEMUCapsGetPackage(virQEMUCapsPtr qemuCaps); +virHashTablePtr virQEMUCapsGetDomainCapsCache(virQEMUCapsPtr qemuCaps); unsigned int virQEMUCapsGetKVMVersion(virQEMUCapsPtr qemuCaps); int virQEMUCapsAddCPUDefinitions(virQEMUCapsPtr qemuCaps, virDomainVirtType type, diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index 635fdcc5a4..6a7c183075 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -1358,10 +1358,39 @@ virCapsPtr virQEMUDriverGetCapabilities(virQEMUDriverPtr driver, } +struct virQEMUDriverSearchDomcapsData { + const char *path; + const char *machine; + virArch arch; + virDomainVirtType virttype; +}; + + +static int +virQEMUDriverSearchDomcaps(const void *payload, + const void *name ATTRIBUTE_UNUSED, + const void *opaque) +{ + virDomainCapsPtr domCaps = (virDomainCapsPtr) payload; + struct virQEMUDriverSearchDomcapsData *data = (struct virQEMUDriverSearchDomcapsData *) opaque; + + if (STREQ_NULLABLE(data->path, domCaps->path) && + STREQ_NULLABLE(data->machine, domCaps->machine) && + data->arch == domCaps->arch && + data->virttype == domCaps->virttype) + return 1; + + return 0; +} + /** * virQEMUDriverGetDomainCapabilities: * - * Build a virDomainCapsPtr instance for the passed data. + * Get a reference to the virDomainCapsPtr instance from the virQEMUCapsPtr + * domCapsCache. If there's no domcaps in the cache, create a new instance, + * add it to the cache, and return a reference. + * + * The caller must release the reference with virObjetUnref * * Returns: a reference to a virDomainCapsPtr instance or NULL */ @@ -1375,18 +1404,34 @@ virQEMUDriverGetDomainCapabilities(virQEMUDriverPtr driver, virDomainCapsPtr ret = NULL, domCaps = NULL; virCapsPtr caps = NULL; virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); + virHashTablePtr domCapsCache = virQEMUCapsGetDomainCapsCache(qemuCaps); + struct virQEMUDriverSearchDomcapsData data = { + .path = virQEMUCapsGetBinary(qemuCaps), + .machine = machine, + .arch = arch, + .virttype = virttype, + }; if (!(caps = virQEMUDriverGetCapabilities(driver, false))) goto cleanup; - if (!(domCaps = virDomainCapsNew(virQEMUCapsGetBinary(qemuCaps), machine, - arch, virttype))) - goto cleanup; + domCaps = virHashSearch(domCapsCache, + virQEMUDriverSearchDomcaps, &data, NULL); + if (!domCaps) { + /* hash miss, build new domcaps */ + if (!(domCaps = virDomainCapsNew(data.path, data.machine, + data.arch, data.virttype))) + goto cleanup; - if (virQEMUCapsFillDomainCaps(caps, domCaps, qemuCaps, - cfg->firmwares, cfg->nfirmwares) < 0) - goto cleanup; + if (virQEMUCapsFillDomainCaps(caps, domCaps, qemuCaps, + cfg->firmwares, cfg->nfirmwares) < 0) + goto cleanup; + + if (virHashAddEntry(domCapsCache, machine, domCaps) < 0) + goto cleanup; + } + virObjectRef(domCaps); VIR_STEAL_PTR(ret, domCaps); cleanup: virObjectUnref(domCaps); -- 2.21.0

On 4/4/19 8:37 PM, Cole Robinson wrote:
qemuCaps is tied to a binary on disk. domCaps is tied to a combo of binary+machine+arch+virttype values. For the qemu driver this almost entirely translates to a permutation of qemuCaps though
Upcoming patches want to use the domCaps data store at XML validate time, but we need to cache the data so we aren't repeatedly regenerating it.
Add a domCapsCache hash table to qemuCaps. This ensures that the domCaps cache is blown away whenever qemuCaps needs to be regenerated. Adjust virQEMUDriverGetDomainCapabilities to search the cache and add to it if we don't find a hit.
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Nit: there is a 80+ char line at the start of virQEMUDriverSearchDomcaps, but I'm not sure if this is more like a "nice to have" rule or if it's enforced like in QEMU. Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
--- src/qemu/qemu_capabilities.c | 11 +++++++ src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_conf.c | 59 +++++++++++++++++++++++++++++++----- 3 files changed, 64 insertions(+), 7 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 46ba5e30b5..a3c1348157 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -582,6 +582,7 @@ struct _virQEMUCaps {
virArch arch;
+ virHashTablePtr domCapsCache; virDomainCapsCPUModelsPtr kvmCPUModels; virDomainCapsCPUModelsPtr tcgCPUModels;
@@ -1476,6 +1477,9 @@ virQEMUCapsNew(void) if (!(qemuCaps->flags = virBitmapNew(QEMU_CAPS_LAST))) goto error;
+ if (!(qemuCaps->domCapsCache = virHashCreate(5, virObjectFreeHashData))) + goto error; + return qemuCaps;
error: @@ -1628,6 +1632,7 @@ void virQEMUCapsDispose(void *obj) } VIR_FREE(qemuCaps->machineTypes);
+ virHashFree(qemuCaps->domCapsCache); virObjectUnref(qemuCaps->kvmCPUModels); virObjectUnref(qemuCaps->tcgCPUModels);
@@ -1790,6 +1795,12 @@ const char *virQEMUCapsGetPackage(virQEMUCapsPtr qemuCaps) }
+virHashTablePtr virQEMUCapsGetDomainCapsCache(virQEMUCapsPtr qemuCaps) +{ + return qemuCaps->domCapsCache; +} + + int virQEMUCapsAddCPUDefinitions(virQEMUCapsPtr qemuCaps, virDomainVirtType type, diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index c6f6980684..2a37f0c2ff 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -538,6 +538,7 @@ const char *virQEMUCapsGetBinary(virQEMUCapsPtr qemuCaps); virArch virQEMUCapsGetArch(virQEMUCapsPtr qemuCaps); unsigned int virQEMUCapsGetVersion(virQEMUCapsPtr qemuCaps); const char *virQEMUCapsGetPackage(virQEMUCapsPtr qemuCaps); +virHashTablePtr virQEMUCapsGetDomainCapsCache(virQEMUCapsPtr qemuCaps); unsigned int virQEMUCapsGetKVMVersion(virQEMUCapsPtr qemuCaps); int virQEMUCapsAddCPUDefinitions(virQEMUCapsPtr qemuCaps, virDomainVirtType type, diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index 635fdcc5a4..6a7c183075 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -1358,10 +1358,39 @@ virCapsPtr virQEMUDriverGetCapabilities(virQEMUDriverPtr driver, }
+struct virQEMUDriverSearchDomcapsData { + const char *path; + const char *machine; + virArch arch; + virDomainVirtType virttype; +}; + + +static int +virQEMUDriverSearchDomcaps(const void *payload, + const void *name ATTRIBUTE_UNUSED, + const void *opaque) +{ + virDomainCapsPtr domCaps = (virDomainCapsPtr) payload; + struct virQEMUDriverSearchDomcapsData *data = (struct virQEMUDriverSearchDomcapsData *) opaque; + + if (STREQ_NULLABLE(data->path, domCaps->path) && + STREQ_NULLABLE(data->machine, domCaps->machine) && + data->arch == domCaps->arch && + data->virttype == domCaps->virttype) + return 1; + + return 0; +} + /** * virQEMUDriverGetDomainCapabilities: * - * Build a virDomainCapsPtr instance for the passed data. + * Get a reference to the virDomainCapsPtr instance from the virQEMUCapsPtr + * domCapsCache. If there's no domcaps in the cache, create a new instance, + * add it to the cache, and return a reference. + * + * The caller must release the reference with virObjetUnref * * Returns: a reference to a virDomainCapsPtr instance or NULL */ @@ -1375,18 +1404,34 @@ virQEMUDriverGetDomainCapabilities(virQEMUDriverPtr driver, virDomainCapsPtr ret = NULL, domCaps = NULL; virCapsPtr caps = NULL; virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); + virHashTablePtr domCapsCache = virQEMUCapsGetDomainCapsCache(qemuCaps); + struct virQEMUDriverSearchDomcapsData data = { + .path = virQEMUCapsGetBinary(qemuCaps), + .machine = machine, + .arch = arch, + .virttype = virttype, + };
if (!(caps = virQEMUDriverGetCapabilities(driver, false))) goto cleanup;
- if (!(domCaps = virDomainCapsNew(virQEMUCapsGetBinary(qemuCaps), machine, - arch, virttype))) - goto cleanup; + domCaps = virHashSearch(domCapsCache, + virQEMUDriverSearchDomcaps, &data, NULL); + if (!domCaps) { + /* hash miss, build new domcaps */ + if (!(domCaps = virDomainCapsNew(data.path, data.machine, + data.arch, data.virttype))) + goto cleanup;
- if (virQEMUCapsFillDomainCaps(caps, domCaps, qemuCaps, - cfg->firmwares, cfg->nfirmwares) < 0) - goto cleanup; + if (virQEMUCapsFillDomainCaps(caps, domCaps, qemuCaps, + cfg->firmwares, cfg->nfirmwares) < 0) + goto cleanup; + + if (virHashAddEntry(domCapsCache, machine, domCaps) < 0) + goto cleanup; + }
+ virObjectRef(domCaps); VIR_STEAL_PTR(ret, domCaps); cleanup: virObjectUnref(domCaps);

On 4/5/19 1:37 AM, Cole Robinson wrote:
qemuCaps is tied to a binary on disk. domCaps is tied to a combo of binary+machine+arch+virttype values. For the qemu driver this almost entirely translates to a permutation of qemuCaps though
Upcoming patches want to use the domCaps data store at XML validate time, but we need to cache the data so we aren't repeatedly regenerating it.
Add a domCapsCache hash table to qemuCaps. This ensures that the domCaps cache is blown away whenever qemuCaps needs to be regenerated. Adjust virQEMUDriverGetDomainCapabilities to search the cache and add to it if we don't find a hit.
Signed-off-by: Cole Robinson <crobinso@redhat.com> --- src/qemu/qemu_capabilities.c | 11 +++++++ src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_conf.c | 59 +++++++++++++++++++++++++++++++----- 3 files changed, 64 insertions(+), 7 deletions(-)
At first I was affraid, I was petrified, that we will need to invalidate this cache whenever corresponding qemuCaps is invalidated. But that should be done automatically, because virQEMUCapsCacheLookup() unrefs qemuCaps when if finds outdated capabilities. Might be worth mentioning in the commit message. Or not. Your call. Michal

This is an entrypoint to validate a virDomainDeviceDef against values filled into virDomainCaps. Currently it's just a stub Signed-off-by: Cole Robinson <crobinso@redhat.com> --- src/conf/domain_capabilities.c | 40 ++++++++++++++++++++++++++++++++++ src/conf/domain_capabilities.h | 4 ++++ src/libvirt_private.syms | 1 + 3 files changed, 45 insertions(+) diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index 03757ba8cd..aef5703df6 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -20,6 +20,7 @@ #include <config.h> +#include "device_conf.h" #include "domain_capabilities.h" #include "domain_conf.h" #include "viralloc.h" @@ -656,3 +657,42 @@ virDomainCapsFormat(virDomainCapsPtr const caps) virBufferCheckError(&buf); return virBufferContentAndReset(&buf); } + + +int +virDomainCapsDeviceDefValidate(virDomainCapsPtr const caps ATTRIBUTE_UNUSED, + const virDomainDeviceDef *dev, + const virDomainDef *def ATTRIBUTE_UNUSED) +{ + switch ((virDomainDeviceType) dev->type) { + case VIR_DOMAIN_DEVICE_DISK: + case VIR_DOMAIN_DEVICE_REDIRDEV: + case VIR_DOMAIN_DEVICE_NET: + case VIR_DOMAIN_DEVICE_CONTROLLER: + case VIR_DOMAIN_DEVICE_CHR: + case VIR_DOMAIN_DEVICE_SMARTCARD: + case VIR_DOMAIN_DEVICE_RNG: + case VIR_DOMAIN_DEVICE_HOSTDEV: + case VIR_DOMAIN_DEVICE_VIDEO: + case VIR_DOMAIN_DEVICE_MEMORY: + case VIR_DOMAIN_DEVICE_VSOCK: + case VIR_DOMAIN_DEVICE_INPUT: + case VIR_DOMAIN_DEVICE_SHMEM: + case VIR_DOMAIN_DEVICE_LEASE: + case VIR_DOMAIN_DEVICE_FS: + case VIR_DOMAIN_DEVICE_SOUND: + case VIR_DOMAIN_DEVICE_WATCHDOG: + case VIR_DOMAIN_DEVICE_GRAPHICS: + case VIR_DOMAIN_DEVICE_HUB: + case VIR_DOMAIN_DEVICE_MEMBALLOON: + case VIR_DOMAIN_DEVICE_NVRAM: + case VIR_DOMAIN_DEVICE_TPM: + case VIR_DOMAIN_DEVICE_PANIC: + case VIR_DOMAIN_DEVICE_IOMMU: + case VIR_DOMAIN_DEVICE_NONE: + case VIR_DOMAIN_DEVICE_LAST: + break; + } + + return 0; +} diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h index 052191d284..ffce2c2964 100644 --- a/src/conf/domain_capabilities.h +++ b/src/conf/domain_capabilities.h @@ -223,6 +223,10 @@ void virDomainCapsEnumClear(virDomainCapsEnumPtr capsEnum); char * virDomainCapsFormat(virDomainCapsPtr const caps); +int virDomainCapsDeviceDefValidate(virDomainCapsPtr const caps, + const virDomainDeviceDef *dev, + const virDomainDef *def); + void virSEVCapabilitiesFree(virSEVCapability *capabilities); diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 212adf53c1..231b487ab0 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -185,6 +185,7 @@ virDomainCapsCPUModelsGet; virDomainCapsCPUModelsNew; virDomainCapsCPUUsableTypeFromString; virDomainCapsCPUUsableTypeToString; +virDomainCapsDeviceDefValidate; virDomainCapsEnumClear; virDomainCapsEnumSet; virDomainCapsFormat; -- 2.21.0

Fill in virDomainCaps at Validate time and use it to call virDomainCapsDeviceDefValidate Signed-off-by: Cole Robinson <crobinso@redhat.com> --- src/qemu/qemu_domain.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index f0bf1aa4fe..6da27a79b0 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -41,6 +41,7 @@ #include "viruuid.h" #include "virfile.h" #include "domain_addr.h" +#include "domain_capabilities.h" #include "domain_event.h" #include "virtime.h" #include "virnetdevopenvswitch.h" @@ -6119,14 +6120,24 @@ qemuDomainDeviceDefValidate(const virDomainDeviceDef *dev, int ret = 0; virQEMUDriverPtr driver = opaque; virQEMUCapsPtr qemuCaps = NULL; + virDomainCapsPtr domCaps = NULL; if (!(qemuCaps = virQEMUCapsCacheLookup(driver->qemuCapsCache, def->emulator))) return -1; + if (!(domCaps = virQEMUDriverGetDomainCapabilities(driver, qemuCaps, + def->os.machine, + def->os.arch, + def->virtType))) + goto cleanup; + if ((ret = qemuDomainDeviceDefValidateAddress(dev, qemuCaps)) < 0) goto cleanup; + if (virDomainCapsDeviceDefValidate(domCaps, dev, def) < 0) + goto cleanup; + switch ((virDomainDeviceType)dev->type) { case VIR_DOMAIN_DEVICE_NET: ret = qemuDomainDeviceDefValidateNetwork(dev->data.net); @@ -6207,6 +6218,7 @@ qemuDomainDeviceDefValidate(const virDomainDeviceDef *dev, cleanup: virObjectUnref(qemuCaps); + virObjectUnref(domCaps); return ret; } -- 2.21.0

The qemu driver already does some <rng> model validation, based on qemuCaps. However, the logic for exposing <rng> model values in domcaps is basically identical. This drops the qemuCaps checking and compares against the domCaps data directly. This approach makes it basically impossible to add a new <rng> model to the qemu driver without extending domcaps. The validation can also be shared with other drivers eventually. Signed-off-by: Cole Robinson <crobinso@redhat.com> --- src/conf/domain_capabilities.c | 35 +++++++++++++++++++++++++++++++--- src/conf/domain_capabilities.h | 1 + src/qemu/qemu_domain.c | 26 +------------------------ 3 files changed, 34 insertions(+), 28 deletions(-) diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index aef5703df6..977f15b9ed 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -659,19 +659,48 @@ virDomainCapsFormat(virDomainCapsPtr const caps) } +#define ENUM_VALUE_MISSING(capsEnum, value) !(capsEnum.values & (1 << value)) + +#define ENUM_VALUE_ERROR(valueLabel, valueString) \ + do { \ + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, \ + _("domain configuration does not support '%s' value '%s'"), \ + valueLabel, valueString); \ + } while (0) + + +static int +virDomainCapsDeviceRNGDefValidate(virDomainCapsPtr const caps, + const virDomainRNGDef *dev) +{ + if (ENUM_VALUE_MISSING(caps->rng.model, dev->model)) { + ENUM_VALUE_ERROR("rng model", + virDomainRNGModelTypeToString(dev->model)); + return -1; + } + + return 0; +} + + int -virDomainCapsDeviceDefValidate(virDomainCapsPtr const caps ATTRIBUTE_UNUSED, +virDomainCapsDeviceDefValidate(virDomainCapsPtr const caps, const virDomainDeviceDef *dev, const virDomainDef *def ATTRIBUTE_UNUSED) { + int ret = 0; + switch ((virDomainDeviceType) dev->type) { + case VIR_DOMAIN_DEVICE_RNG: + ret = virDomainCapsDeviceRNGDefValidate(caps, dev->data.rng); + break; + case VIR_DOMAIN_DEVICE_DISK: case VIR_DOMAIN_DEVICE_REDIRDEV: case VIR_DOMAIN_DEVICE_NET: case VIR_DOMAIN_DEVICE_CONTROLLER: case VIR_DOMAIN_DEVICE_CHR: case VIR_DOMAIN_DEVICE_SMARTCARD: - case VIR_DOMAIN_DEVICE_RNG: case VIR_DOMAIN_DEVICE_HOSTDEV: case VIR_DOMAIN_DEVICE_VIDEO: case VIR_DOMAIN_DEVICE_MEMORY: @@ -694,5 +723,5 @@ virDomainCapsDeviceDefValidate(virDomainCapsPtr const caps ATTRIBUTE_UNUSED, break; } - return 0; + return ret; } diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h index ffce2c2964..997c7d9444 100644 --- a/src/conf/domain_capabilities.h +++ b/src/conf/domain_capabilities.h @@ -215,6 +215,7 @@ virDomainCapsCPUModelsGet(virDomainCapsCPUModelsPtr cpuModels, __nvalues, __values); \ } while (0) + int virDomainCapsEnumSet(virDomainCapsEnumPtr capsEnum, const char *capsEnumName, size_t nvalues, diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 6da27a79b0..cad08439b1 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4523,36 +4523,12 @@ qemuDomainSmartcardDefValidate(const virDomainSmartcardDef *def) static int qemuDomainRNGDefValidate(const virDomainRNGDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCapsPtr qemuCaps ATTRIBUTE_UNUSED) { - bool modelIsSupported = false; - if (def->backend == VIR_DOMAIN_RNG_BACKEND_EGD && qemuDomainChrSourceDefValidate(def->source.chardev) < 0) return -1; - switch ((virDomainRNGModel) def->model) { - case VIR_DOMAIN_RNG_MODEL_VIRTIO: - modelIsSupported = virQEMUCapsGet(qemuCaps, - QEMU_CAPS_DEVICE_VIRTIO_RNG); - break; - case VIR_DOMAIN_RNG_MODEL_VIRTIO_TRANSITIONAL: - case VIR_DOMAIN_RNG_MODEL_VIRTIO_NON_TRANSITIONAL: - modelIsSupported = (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_RNG) && - (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_PCI_TRANSITIONAL) || - virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY))); - break; - case VIR_DOMAIN_RNG_MODEL_LAST: - break; - } - - if (!modelIsSupported) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("this qemu doesn't support RNG device type '%s'"), - virDomainRNGModelTypeToString(def->model)); - return -1; - } - return 0; } -- 2.21.0

ping On 4/4/19 7:37 PM, Cole Robinson wrote:
I'm trying to remove some hurdles and pitfalls WRT extending domaincapabilities data. One issue is that it's too easy to add invalid data to it, or let the data become out of date.
For example the first two patches of this series add <rng model=X> domcaps reporting. The logic to fill in the domcaps data from qemuCaps is nearly identical to the logic we use to validate rng->model in qemuDomainRNGDefValidate. If just those patches are added, and later a new qemu rng model was introduced, a future patch could easily miss updated domaincapabilities output.
This series aims to set up a pattern to prevent these types of issues from sneaking in. A function virDomainCapsDeviceDefValidate is added which will use domcaps data to perform validation against a devicedef. The existing qemu <rng> model validation is moved there. This ensures that any future <rng> model additions, if they want to work in the qemu driver, effectively need to extend domaincapabilities as well. It's also theoretically useful for other drivers too.
One issue is that at DomainDefValidate time we don't have domCaps handy, or any cache layer for domCaps assembling. Patch #4 adds a domCapsCache hashtable to the virQEMUCaps class for caching domCaps builds based on the full tuple of emulator+machine+arch+virttype. If qemuCaps need to be regenerated, the domCaps cache is wiped out for us so we don't need to worry about the data being stale, it's tied to the lifetime of a qemuCaps instance.
Cole Robinson (7): conf: domcaps: Report device <rng> qemu: capabilities: fill in domcaps <rng> qemu: conf: add virQEMUDriverGetDomainCapabilities qemu: conf: Cache domCaps in qemuCaps conf: domcaps: Add virDomainCapsDeviceDefValidate qemu: domain: Call virDomainCapsDeviceDefValidate qemu: Move rng model validation to domcaps
docs/formatdomaincaps.html.in | 35 ++++++++ docs/schemas/domaincaps.rng | 10 +++ src/conf/domain_capabilities.c | 83 ++++++++++++++++++ src/conf/domain_capabilities.h | 14 ++++ src/libvirt_private.syms | 1 + src/qemu/qemu_capabilities.c | 41 +++++++++ src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_conf.c | 84 +++++++++++++++++++ src/qemu/qemu_conf.h | 7 ++ src/qemu/qemu_domain.c | 38 +++------ src/qemu/qemu_driver.c | 18 +--- .../qemu_1.7.0.x86_64.xml | 9 ++ .../qemu_2.12.0-virt.aarch64.xml | 11 +++ .../qemu_2.12.0.ppc64.xml | 11 +++ .../qemu_2.12.0.s390x.xml | 11 +++ .../qemu_2.12.0.x86_64.xml | 11 +++ .../qemu_2.6.0-virt.aarch64.xml | 11 +++ .../qemu_2.6.0.aarch64.xml | 11 +++ .../domaincapsschemadata/qemu_2.6.0.ppc64.xml | 11 +++ .../qemu_2.6.0.x86_64.xml | 11 +++ .../domaincapsschemadata/qemu_2.7.0.s390x.xml | 11 +++ .../qemu_2.8.0-tcg.x86_64.xml | 11 +++ .../domaincapsschemadata/qemu_2.8.0.s390x.xml | 11 +++ .../qemu_2.8.0.x86_64.xml | 11 +++ .../qemu_2.9.0-q35.x86_64.xml | 11 +++ .../qemu_2.9.0-tcg.x86_64.xml | 11 +++ .../qemu_2.9.0.x86_64.xml | 11 +++ .../domaincapsschemadata/qemu_3.0.0.s390x.xml | 11 +++ .../qemu_4.0.0.x86_64.xml | 11 +++ 29 files changed, 488 insertions(+), 40 deletions(-)
- Cole

Tried the patch series. Unfortunately I didn't get the <rng> element reported in virsh capabilities, however I am not sure if this hardware (Lenovo T480) has a hardware RNG device to report anyways. I'll check it later when I have the chance. It is worth noticing that patch 3 is conflicting with current master. Extra code in qemu_driver.c that shifted the lines that the patch is changing (trivial) and, in qemu_conf.c, I had to change the call to virQEMUCapsFillDomainCaps since it is now taking an extra argument (added by 5b9819eedc). This change was enough to get the patch rolling: +++ b/src/qemu/qemu_conf.c @@ -1424,6 +1424,7 @@ virQEMUDriverGetDomainCapabilities(virQEMUDriverPtr driver, goto cleanup; if (virQEMUCapsFillDomainCaps(caps, domCaps, qemuCaps, + driver->privileged, cfg->firmwares, cfg->nfirmwares) < 0) goto cleanup; Thanks, DHB On 4/4/19 8:37 PM, Cole Robinson wrote:
I'm trying to remove some hurdles and pitfalls WRT extending domaincapabilities data. One issue is that it's too easy to add invalid data to it, or let the data become out of date.
For example the first two patches of this series add <rng model=X> domcaps reporting. The logic to fill in the domcaps data from qemuCaps is nearly identical to the logic we use to validate rng->model in qemuDomainRNGDefValidate. If just those patches are added, and later a new qemu rng model was introduced, a future patch could easily miss updated domaincapabilities output.
This series aims to set up a pattern to prevent these types of issues from sneaking in. A function virDomainCapsDeviceDefValidate is added which will use domcaps data to perform validation against a devicedef. The existing qemu <rng> model validation is moved there. This ensures that any future <rng> model additions, if they want to work in the qemu driver, effectively need to extend domaincapabilities as well. It's also theoretically useful for other drivers too.
One issue is that at DomainDefValidate time we don't have domCaps handy, or any cache layer for domCaps assembling. Patch #4 adds a domCapsCache hashtable to the virQEMUCaps class for caching domCaps builds based on the full tuple of emulator+machine+arch+virttype. If qemuCaps need to be regenerated, the domCaps cache is wiped out for us so we don't need to worry about the data being stale, it's tied to the lifetime of a qemuCaps instance.
Cole Robinson (7): conf: domcaps: Report device <rng> qemu: capabilities: fill in domcaps <rng> qemu: conf: add virQEMUDriverGetDomainCapabilities qemu: conf: Cache domCaps in qemuCaps conf: domcaps: Add virDomainCapsDeviceDefValidate qemu: domain: Call virDomainCapsDeviceDefValidate qemu: Move rng model validation to domcaps
docs/formatdomaincaps.html.in | 35 ++++++++ docs/schemas/domaincaps.rng | 10 +++ src/conf/domain_capabilities.c | 83 ++++++++++++++++++ src/conf/domain_capabilities.h | 14 ++++ src/libvirt_private.syms | 1 + src/qemu/qemu_capabilities.c | 41 +++++++++ src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_conf.c | 84 +++++++++++++++++++ src/qemu/qemu_conf.h | 7 ++ src/qemu/qemu_domain.c | 38 +++------ src/qemu/qemu_driver.c | 18 +--- .../qemu_1.7.0.x86_64.xml | 9 ++ .../qemu_2.12.0-virt.aarch64.xml | 11 +++ .../qemu_2.12.0.ppc64.xml | 11 +++ .../qemu_2.12.0.s390x.xml | 11 +++ .../qemu_2.12.0.x86_64.xml | 11 +++ .../qemu_2.6.0-virt.aarch64.xml | 11 +++ .../qemu_2.6.0.aarch64.xml | 11 +++ .../domaincapsschemadata/qemu_2.6.0.ppc64.xml | 11 +++ .../qemu_2.6.0.x86_64.xml | 11 +++ .../domaincapsschemadata/qemu_2.7.0.s390x.xml | 11 +++ .../qemu_2.8.0-tcg.x86_64.xml | 11 +++ .../domaincapsschemadata/qemu_2.8.0.s390x.xml | 11 +++ .../qemu_2.8.0.x86_64.xml | 11 +++ .../qemu_2.9.0-q35.x86_64.xml | 11 +++ .../qemu_2.9.0-tcg.x86_64.xml | 11 +++ .../qemu_2.9.0.x86_64.xml | 11 +++ .../domaincapsschemadata/qemu_3.0.0.s390x.xml | 11 +++ .../qemu_4.0.0.x86_64.xml | 11 +++ 29 files changed, 488 insertions(+), 40 deletions(-)

On 4/5/19 1:37 AM, Cole Robinson wrote:
I'm trying to remove some hurdles and pitfalls WRT extending domaincapabilities data. One issue is that it's too easy to add invalid data to it, or let the data become out of date.
For example the first two patches of this series add <rng model=X> domcaps reporting. The logic to fill in the domcaps data from qemuCaps is nearly identical to the logic we use to validate rng->model in qemuDomainRNGDefValidate. If just those patches are added, and later a new qemu rng model was introduced, a future patch could easily miss updated domaincapabilities output.
This series aims to set up a pattern to prevent these types of issues from sneaking in. A function virDomainCapsDeviceDefValidate is added which will use domcaps data to perform validation against a devicedef. The existing qemu <rng> model validation is moved there. This ensures that any future <rng> model additions, if they want to work in the qemu driver, effectively need to extend domaincapabilities as well. It's also theoretically useful for other drivers too.
One issue is that at DomainDefValidate time we don't have domCaps handy, or any cache layer for domCaps assembling. Patch #4 adds a domCapsCache hashtable to the virQEMUCaps class for caching domCaps builds based on the full tuple of emulator+machine+arch+virttype. If qemuCaps need to be regenerated, the domCaps cache is wiped out for us so we don't need to worry about the data being stale, it's tied to the lifetime of a qemuCaps instance.
Cole Robinson (7): conf: domcaps: Report device <rng> qemu: capabilities: fill in domcaps <rng> qemu: conf: add virQEMUDriverGetDomainCapabilities qemu: conf: Cache domCaps in qemuCaps conf: domcaps: Add virDomainCapsDeviceDefValidate qemu: domain: Call virDomainCapsDeviceDefValidate qemu: Move rng model validation to domcaps
docs/formatdomaincaps.html.in | 35 ++++++++ docs/schemas/domaincaps.rng | 10 +++ src/conf/domain_capabilities.c | 83 ++++++++++++++++++ src/conf/domain_capabilities.h | 14 ++++ src/libvirt_private.syms | 1 + src/qemu/qemu_capabilities.c | 41 +++++++++ src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_conf.c | 84 +++++++++++++++++++ src/qemu/qemu_conf.h | 7 ++ src/qemu/qemu_domain.c | 38 +++------ src/qemu/qemu_driver.c | 18 +--- .../qemu_1.7.0.x86_64.xml | 9 ++ .../qemu_2.12.0-virt.aarch64.xml | 11 +++ .../qemu_2.12.0.ppc64.xml | 11 +++ .../qemu_2.12.0.s390x.xml | 11 +++ .../qemu_2.12.0.x86_64.xml | 11 +++ .../qemu_2.6.0-virt.aarch64.xml | 11 +++ .../qemu_2.6.0.aarch64.xml | 11 +++ .../domaincapsschemadata/qemu_2.6.0.ppc64.xml | 11 +++ .../qemu_2.6.0.x86_64.xml | 11 +++ .../domaincapsschemadata/qemu_2.7.0.s390x.xml | 11 +++ .../qemu_2.8.0-tcg.x86_64.xml | 11 +++ .../domaincapsschemadata/qemu_2.8.0.s390x.xml | 11 +++ .../qemu_2.8.0.x86_64.xml | 11 +++ .../qemu_2.9.0-q35.x86_64.xml | 11 +++ .../qemu_2.9.0-tcg.x86_64.xml | 11 +++ .../qemu_2.9.0.x86_64.xml | 11 +++ .../domaincapsschemadata/qemu_3.0.0.s390x.xml | 11 +++ .../qemu_4.0.0.x86_64.xml | 11 +++ 29 files changed, 488 insertions(+), 40 deletions(-)
ACK if you address Daniel's and mine findings. Sorry for delayed review. Michal

On 4/29/19 8:35 AM, Michal Privoznik wrote:
On 4/5/19 1:37 AM, Cole Robinson wrote:
I'm trying to remove some hurdles and pitfalls WRT extending domaincapabilities data. One issue is that it's too easy to add invalid data to it, or let the data become out of date.
For example the first two patches of this series add <rng model=X> domcaps reporting. The logic to fill in the domcaps data from qemuCaps is nearly identical to the logic we use to validate rng->model in qemuDomainRNGDefValidate. If just those patches are added, and later a new qemu rng model was introduced, a future patch could easily miss updated domaincapabilities output.
This series aims to set up a pattern to prevent these types of issues from sneaking in. A function virDomainCapsDeviceDefValidate is added which will use domcaps data to perform validation against a devicedef. The existing qemu <rng> model validation is moved there. This ensures that any future <rng> model additions, if they want to work in the qemu driver, effectively need to extend domaincapabilities as well. It's also theoretically useful for other drivers too.
One issue is that at DomainDefValidate time we don't have domCaps handy, or any cache layer for domCaps assembling. Patch #4 adds a domCapsCache hashtable to the virQEMUCaps class for caching domCaps builds based on the full tuple of emulator+machine+arch+virttype. If qemuCaps need to be regenerated, the domCaps cache is wiped out for us so we don't need to worry about the data being stale, it's tied to the lifetime of a qemuCaps instance.
Cole Robinson (7): conf: domcaps: Report device <rng> qemu: capabilities: fill in domcaps <rng> qemu: conf: add virQEMUDriverGetDomainCapabilities qemu: conf: Cache domCaps in qemuCaps conf: domcaps: Add virDomainCapsDeviceDefValidate qemu: domain: Call virDomainCapsDeviceDefValidate qemu: Move rng model validation to domcaps
docs/formatdomaincaps.html.in | 35 ++++++++ docs/schemas/domaincaps.rng | 10 +++ src/conf/domain_capabilities.c | 83 ++++++++++++++++++ src/conf/domain_capabilities.h | 14 ++++ src/libvirt_private.syms | 1 + src/qemu/qemu_capabilities.c | 41 +++++++++ src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_conf.c | 84 +++++++++++++++++++ src/qemu/qemu_conf.h | 7 ++ src/qemu/qemu_domain.c | 38 +++------ src/qemu/qemu_driver.c | 18 +--- .../qemu_1.7.0.x86_64.xml | 9 ++ .../qemu_2.12.0-virt.aarch64.xml | 11 +++ .../qemu_2.12.0.ppc64.xml | 11 +++ .../qemu_2.12.0.s390x.xml | 11 +++ .../qemu_2.12.0.x86_64.xml | 11 +++ .../qemu_2.6.0-virt.aarch64.xml | 11 +++ .../qemu_2.6.0.aarch64.xml | 11 +++ .../domaincapsschemadata/qemu_2.6.0.ppc64.xml | 11 +++ .../qemu_2.6.0.x86_64.xml | 11 +++ .../domaincapsschemadata/qemu_2.7.0.s390x.xml | 11 +++ .../qemu_2.8.0-tcg.x86_64.xml | 11 +++ .../domaincapsschemadata/qemu_2.8.0.s390x.xml | 11 +++ .../qemu_2.8.0.x86_64.xml | 11 +++ .../qemu_2.9.0-q35.x86_64.xml | 11 +++ .../qemu_2.9.0-tcg.x86_64.xml | 11 +++ .../qemu_2.9.0.x86_64.xml | 11 +++ .../domaincapsschemadata/qemu_3.0.0.s390x.xml | 11 +++ .../qemu_4.0.0.x86_64.xml | 11 +++ 29 files changed, 488 insertions(+), 40 deletions(-)
ACK if you address Daniel's and mine findings.
Sorry for delayed review.
So I completely forgot about this series and never even saw the ACKs! I rebased the patches and they applied cleanly besides the driver->privileged piece that was already mentioned. So I addressed all the original review comments, add RB tags for you and Daniel, and pushed now. So no worries on the review delay :) Thanks, Cole
participants (3)
-
Cole Robinson
-
Daniel Henrique Barboza
-
Michal Privoznik