On Wed, Jan 01, 2020 at 13:06:31 +0800, Han Han wrote:
It is used to check if qemu is capable of rng-builtin object:
-object rng-builtin,id=id
This object is added since qemu-4.2.0-rc0, commit 6c4e9d48.
Signed-off-by: Han Han <hhan(a)redhat.com>
---
src/qemu/qemu_capabilities.c | 4 ++++
src/qemu/qemu_capabilities.h | 1 +
2 files changed, 5 insertions(+)
[...]
static struct virQEMUCapsStringFlags
virQEMUCapsDevicePropsVirtioBalloon[] = {
@@ -5719,6 +5721,8 @@ virQEMUCapsFillDomainDeviceRNGCaps(virQEMUCapsPtr qemuCaps,
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);
+ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_RNG_BUILTIN))
+ VIR_DOMAIN_CAPS_ENUM_SET(rng->backendModel, VIR_DOMAIN_RNG_BACKEND_BUILTIN);
Fails to compile:
/home/pipo/libvirt/src/qemu/qemu_capabilities.c: In function
'virQEMUCapsFillDomainDeviceRNGCaps':
/home/pipo/libvirt/src/qemu/qemu_capabilities.c:5725:53: error:
'VIR_DOMAIN_RNG_BACKEND_BUILTIN' undeclared (first use in this function); did you
mean 'VIR_DOMAIN_RNG_BACKEND_LAST'?
5725 | VIR_DOMAIN_CAPS_ENUM_SET(rng->backendModel,
VIR_DOMAIN_RNG_BACKEND_BUILTIN);
|
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/pipo/libvirt/src/conf/domain_capabilities.h:219:36: note: in definition of macro
'VIR_DOMAIN_CAPS_ENUM_SET'
219 | unsigned int __values[] = {__VA_ARGS__}; \
| ^~~~~~~~~~~
/home/pipo/libvirt/src/qemu/qemu_capabilities.c:5725:53: note: each undeclared identifier
is reported only once for each function it appears in
5725 | VIR_DOMAIN_CAPS_ENUM_SET(rng->backendModel,
VIR_DOMAIN_RNG_BACKEND_BUILTIN);
|
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/pipo/libvirt/src/conf/domain_capabilities.h:219:36: note: in definition of macro
'VIR_DOMAIN_CAPS_ENUM_SET'
219 | unsigned int __values[] = {__VA_ARGS__}; \
| ^~~~~~~~~~~