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:
Peter Krempa 2020-05-06 17:12:12 +02:00
parent 568200eb94
commit be9771a1d2
1 changed files with 21 additions and 5 deletions

View File

@ -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;
} }