提交 568200eb 编写于 作者: P Peter Krempa

virQEMUCapsProbeQMPDevices: Split up into logical chunks

The function was parsing 'qom-list-types' and then also calling function
which parses 'device-list-properties' and also 'qom-list-properties'.
Split it up into individual functions.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
上级 3bcbdc51
......@@ -2586,9 +2586,10 @@ virQEMUCapsProbeQMPGenericProps(virQEMUCapsPtr qemuCaps,
return 0;
}
static int
virQEMUCapsProbeQMPDevices(virQEMUCapsPtr qemuCaps,
qemuMonitorPtr mon)
virQEMUCapsProbeQMPObjectTypes(virQEMUCapsPtr qemuCaps,
qemuMonitorPtr mon)
{
int nvalues;
char **values;
......@@ -2601,22 +2602,34 @@ virQEMUCapsProbeQMPDevices(virQEMUCapsPtr qemuCaps,
nvalues, values);
virStringListFreeCount(values, nvalues);
if (virQEMUCapsProbeQMPGenericProps(qemuCaps,
mon,
virQEMUCapsDeviceProps,
G_N_ELEMENTS(virQEMUCapsDeviceProps),
qemuMonitorGetDeviceProps) < 0)
return -1;
return 0;
}
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_QOM_LIST_PROPERTIES) &&
virQEMUCapsProbeQMPGenericProps(qemuCaps,
mon,
virQEMUCapsObjectProps,
G_N_ELEMENTS(virQEMUCapsObjectProps),
qemuMonitorGetObjectProps) < 0)
return -1;
return 0;
static int
virQEMUCapsProbeQMPDeviceProperties(virQEMUCapsPtr qemuCaps,
qemuMonitorPtr mon)
{
return virQEMUCapsProbeQMPGenericProps(qemuCaps,
mon,
virQEMUCapsDeviceProps,
G_N_ELEMENTS(virQEMUCapsDeviceProps),
qemuMonitorGetDeviceProps);
}
static int
virQEMUCapsProbeQMPObjectProperties(virQEMUCapsPtr qemuCaps,
qemuMonitorPtr mon)
{
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_QOM_LIST_PROPERTIES))
return 0;
return virQEMUCapsProbeQMPGenericProps(qemuCaps,
mon,
virQEMUCapsObjectProps,
G_N_ELEMENTS(virQEMUCapsObjectProps),
qemuMonitorGetObjectProps);
}
......@@ -5061,7 +5074,11 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps,
if (virQEMUCapsProbeQMPEvents(qemuCaps, mon) < 0)
return -1;
if (virQEMUCapsProbeQMPDevices(qemuCaps, mon) < 0)
if (virQEMUCapsProbeQMPObjectTypes(qemuCaps, mon) < 0)
return -1;
if (virQEMUCapsProbeQMPDeviceProperties(qemuCaps, mon) < 0)
return -1;
if (virQEMUCapsProbeQMPObjectProperties(qemuCaps, mon) < 0)
return -1;
if (virQEMUCapsProbeQMPMachineTypes(qemuCaps, type, mon) < 0)
return -1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册