mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
qemuMonitorJSONQueryNamedBlockNodes: Drop 'flat' argument
All callers pass the equivalent of looking up whether qemu supports QEMU_CAPS_QMP_QUERY_NAMED_BLOCK_NODES_FLAT. Use 'mon->queryNamedBlockNodesFlat' directly and refactor all callers. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
bbd4d48993
commit
2f6e858b3c
@ -2611,13 +2611,11 @@ qemuBlockGetNamedNodeData(virDomainObj *vm,
|
||||
{
|
||||
qemuDomainObjPrivate *priv = vm->privateData;
|
||||
GHashTable *blockNamedNodeData = NULL;
|
||||
bool supports_flat = virQEMUCapsGet(priv->qemuCaps,
|
||||
QEMU_CAPS_QMP_QUERY_NAMED_BLOCK_NODES_FLAT);
|
||||
|
||||
if (qemuDomainObjEnterMonitorAsync(vm, asyncJob) < 0)
|
||||
return NULL;
|
||||
|
||||
blockNamedNodeData = qemuMonitorBlockGetNamedNodeData(priv->mon, supports_flat);
|
||||
blockNamedNodeData = qemuMonitorBlockGetNamedNodeData(priv->mon);
|
||||
|
||||
qemuDomainObjExitMonitor(vm);
|
||||
|
||||
|
@ -1990,20 +1990,17 @@ qemuMonitorBlockStatsUpdateCapacityBlockdev(qemuMonitor *mon,
|
||||
/**
|
||||
* qemuMonitorBlockGetNamedNodeData:
|
||||
* @mon: monitor object
|
||||
* @supports_flat: don't query data for backing store
|
||||
*
|
||||
* Uses 'query-named-block-nodes' to retrieve information about individual
|
||||
* storage nodes and returns them in a hash table of qemuBlockNamedNodeData *s
|
||||
* filled with the data. The hash table keys are node names.
|
||||
*/
|
||||
GHashTable *
|
||||
qemuMonitorBlockGetNamedNodeData(qemuMonitor *mon,
|
||||
bool supports_flat)
|
||||
qemuMonitorBlockGetNamedNodeData(qemuMonitor *mon)
|
||||
{
|
||||
QEMU_CHECK_MONITOR_NULL(mon);
|
||||
VIR_DEBUG("supports_flat=%d", supports_flat);
|
||||
|
||||
return qemuMonitorJSONBlockGetNamedNodeData(mon, supports_flat);
|
||||
return qemuMonitorJSONBlockGetNamedNodeData(mon);
|
||||
}
|
||||
|
||||
|
||||
|
@ -712,8 +712,7 @@ struct _qemuBlockNamedNodeData {
|
||||
};
|
||||
|
||||
GHashTable *
|
||||
qemuMonitorBlockGetNamedNodeData(qemuMonitor *mon,
|
||||
bool supports_flat);
|
||||
qemuMonitorBlockGetNamedNodeData(qemuMonitor *mon);
|
||||
|
||||
int qemuMonitorBlockResize(qemuMonitor *mon,
|
||||
const char *device,
|
||||
|
@ -2037,14 +2037,13 @@ qemuMonitorJSONSetDBusVMStateIdList(qemuMonitor *mon,
|
||||
* Returns: NULL on error, reply on success
|
||||
*/
|
||||
static virJSONValue *
|
||||
qemuMonitorJSONQueryNamedBlockNodes(qemuMonitor *mon,
|
||||
bool flat)
|
||||
qemuMonitorJSONQueryNamedBlockNodes(qemuMonitor *mon)
|
||||
{
|
||||
g_autoptr(virJSONValue) cmd = NULL;
|
||||
g_autoptr(virJSONValue) reply = NULL;
|
||||
|
||||
if (!(cmd = qemuMonitorJSONMakeCommand("query-named-block-nodes",
|
||||
"B:flat", flat,
|
||||
"B:flat", mon->queryNamedBlockNodesFlat,
|
||||
NULL)))
|
||||
return NULL;
|
||||
|
||||
@ -2503,7 +2502,7 @@ qemuMonitorJSONBlockStatsUpdateCapacityBlockdev(qemuMonitor *mon,
|
||||
{
|
||||
g_autoptr(virJSONValue) nodes = NULL;
|
||||
|
||||
if (!(nodes = qemuMonitorJSONQueryNamedBlockNodes(mon, mon->queryNamedBlockNodesFlat)))
|
||||
if (!(nodes = qemuMonitorJSONQueryNamedBlockNodes(mon)))
|
||||
return -1;
|
||||
|
||||
if (virJSONValueArrayForeachSteal(nodes,
|
||||
@ -2669,12 +2668,11 @@ qemuMonitorJSONBlockGetNamedNodeDataJSON(virJSONValue *nodes)
|
||||
|
||||
|
||||
GHashTable *
|
||||
qemuMonitorJSONBlockGetNamedNodeData(qemuMonitor *mon,
|
||||
bool supports_flat)
|
||||
qemuMonitorJSONBlockGetNamedNodeData(qemuMonitor *mon)
|
||||
{
|
||||
g_autoptr(virJSONValue) nodes = NULL;
|
||||
|
||||
if (!(nodes = qemuMonitorJSONQueryNamedBlockNodes(mon, supports_flat)))
|
||||
if (!(nodes = qemuMonitorJSONQueryNamedBlockNodes(mon)))
|
||||
return NULL;
|
||||
|
||||
return qemuMonitorJSONBlockGetNamedNodeDataJSON(nodes);
|
||||
|
@ -105,8 +105,7 @@ GHashTable *
|
||||
qemuMonitorJSONBlockGetNamedNodeDataJSON(virJSONValue *nodes);
|
||||
|
||||
GHashTable *
|
||||
qemuMonitorJSONBlockGetNamedNodeData(qemuMonitor *mon,
|
||||
bool supports_flat);
|
||||
qemuMonitorJSONBlockGetNamedNodeData(qemuMonitor *mon);
|
||||
|
||||
int
|
||||
qemuMonitorJSONBlockResize(qemuMonitor *mon,
|
||||
|
Loading…
Reference in New Issue
Block a user