mirror of https://gitee.com/openkylin/libvirt.git
qemu: capabilities: fill in domcaps <rng>
The model logic is taken from qemuDomainRNGDefValidate Reviewed-by: Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
parent
9828b6e7fe
commit
928508f669
|
@ -5370,6 +5370,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
|
||||
|
@ -5512,6 +5540,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);
|
||||
|
@ -5542,6 +5571,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;
|
||||
|
|
|
@ -116,6 +116,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'/>
|
||||
|
|
|
@ -120,6 +120,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'>
|
||||
|
|
|
@ -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'/>
|
||||
|
|
|
@ -176,6 +176,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'/>
|
||||
|
|
|
@ -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'/>
|
||||
|
|
|
@ -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='yes'>
|
||||
|
|
|
@ -115,6 +115,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'/>
|
||||
|
|
|
@ -88,6 +88,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'/>
|
||||
|
|
|
@ -123,6 +123,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'/>
|
||||
|
|
|
@ -81,6 +81,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'/>
|
||||
|
|
|
@ -124,6 +124,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'/>
|
||||
|
|
|
@ -162,6 +162,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'/>
|
||||
|
|
|
@ -124,6 +124,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'/>
|
||||
|
|
|
@ -133,6 +133,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'/>
|
||||
|
|
|
@ -156,6 +156,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'/>
|
||||
|
|
|
@ -133,6 +133,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'/>
|
||||
|
|
|
@ -182,6 +182,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'/>
|
||||
|
|
|
@ -151,6 +151,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'/>
|
||||
|
|
|
@ -188,6 +188,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'/>
|
||||
|
|
|
@ -151,6 +151,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'/>
|
||||
|
|
|
@ -155,6 +155,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'/>
|
||||
|
|
Loading…
Reference in New Issue