mirror of https://gitee.com/openkylin/libvirt.git
virQEMUCapsProbeQMPDeviceProperties: Switch to local implementation
Reimplement device property detection directly rather than using virQEMUCapsProbeQMPGenericProps in preparation for changes to the detection code. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
568200eb94
commit
be9771a1d2
|
@ -2610,11 +2610,27 @@ static int
|
||||||
virQEMUCapsProbeQMPDeviceProperties(virQEMUCapsPtr qemuCaps,
|
virQEMUCapsProbeQMPDeviceProperties(virQEMUCapsPtr qemuCaps,
|
||||||
qemuMonitorPtr mon)
|
qemuMonitorPtr mon)
|
||||||
{
|
{
|
||||||
return virQEMUCapsProbeQMPGenericProps(qemuCaps,
|
size_t i;
|
||||||
mon,
|
|
||||||
virQEMUCapsDeviceProps,
|
for (i = 0; i < G_N_ELEMENTS(virQEMUCapsDeviceProps); i++) {
|
||||||
G_N_ELEMENTS(virQEMUCapsDeviceProps),
|
virQEMUCapsObjectTypeProps *device = virQEMUCapsDeviceProps + i;
|
||||||
qemuMonitorGetDeviceProps);
|
VIR_AUTOSTRINGLIST values = NULL;
|
||||||
|
int nvalues;
|
||||||
|
|
||||||
|
if (device->capsCondition >= 0 &&
|
||||||
|
!virQEMUCapsGet(qemuCaps, device->capsCondition))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if ((nvalues = qemuMonitorGetDeviceProps(mon, device->type, &values)) < 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
virQEMUCapsProcessStringFlags(qemuCaps,
|
||||||
|
device->nprops,
|
||||||
|
device->props,
|
||||||
|
nvalues, values);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue