mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-18 10:35:20 +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;
|
qemuDomainObjPrivate *priv = vm->privateData;
|
||||||
GHashTable *blockNamedNodeData = NULL;
|
GHashTable *blockNamedNodeData = NULL;
|
||||||
bool supports_flat = virQEMUCapsGet(priv->qemuCaps,
|
|
||||||
QEMU_CAPS_QMP_QUERY_NAMED_BLOCK_NODES_FLAT);
|
|
||||||
|
|
||||||
if (qemuDomainObjEnterMonitorAsync(vm, asyncJob) < 0)
|
if (qemuDomainObjEnterMonitorAsync(vm, asyncJob) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
blockNamedNodeData = qemuMonitorBlockGetNamedNodeData(priv->mon, supports_flat);
|
blockNamedNodeData = qemuMonitorBlockGetNamedNodeData(priv->mon);
|
||||||
|
|
||||||
qemuDomainObjExitMonitor(vm);
|
qemuDomainObjExitMonitor(vm);
|
||||||
|
|
||||||
|
@ -1990,20 +1990,17 @@ qemuMonitorBlockStatsUpdateCapacityBlockdev(qemuMonitor *mon,
|
|||||||
/**
|
/**
|
||||||
* qemuMonitorBlockGetNamedNodeData:
|
* qemuMonitorBlockGetNamedNodeData:
|
||||||
* @mon: monitor object
|
* @mon: monitor object
|
||||||
* @supports_flat: don't query data for backing store
|
|
||||||
*
|
*
|
||||||
* Uses 'query-named-block-nodes' to retrieve information about individual
|
* Uses 'query-named-block-nodes' to retrieve information about individual
|
||||||
* storage nodes and returns them in a hash table of qemuBlockNamedNodeData *s
|
* storage nodes and returns them in a hash table of qemuBlockNamedNodeData *s
|
||||||
* filled with the data. The hash table keys are node names.
|
* filled with the data. The hash table keys are node names.
|
||||||
*/
|
*/
|
||||||
GHashTable *
|
GHashTable *
|
||||||
qemuMonitorBlockGetNamedNodeData(qemuMonitor *mon,
|
qemuMonitorBlockGetNamedNodeData(qemuMonitor *mon)
|
||||||
bool supports_flat)
|
|
||||||
{
|
{
|
||||||
QEMU_CHECK_MONITOR_NULL(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 *
|
GHashTable *
|
||||||
qemuMonitorBlockGetNamedNodeData(qemuMonitor *mon,
|
qemuMonitorBlockGetNamedNodeData(qemuMonitor *mon);
|
||||||
bool supports_flat);
|
|
||||||
|
|
||||||
int qemuMonitorBlockResize(qemuMonitor *mon,
|
int qemuMonitorBlockResize(qemuMonitor *mon,
|
||||||
const char *device,
|
const char *device,
|
||||||
|
@ -2037,14 +2037,13 @@ qemuMonitorJSONSetDBusVMStateIdList(qemuMonitor *mon,
|
|||||||
* Returns: NULL on error, reply on success
|
* Returns: NULL on error, reply on success
|
||||||
*/
|
*/
|
||||||
static virJSONValue *
|
static virJSONValue *
|
||||||
qemuMonitorJSONQueryNamedBlockNodes(qemuMonitor *mon,
|
qemuMonitorJSONQueryNamedBlockNodes(qemuMonitor *mon)
|
||||||
bool flat)
|
|
||||||
{
|
{
|
||||||
g_autoptr(virJSONValue) cmd = NULL;
|
g_autoptr(virJSONValue) cmd = NULL;
|
||||||
g_autoptr(virJSONValue) reply = NULL;
|
g_autoptr(virJSONValue) reply = NULL;
|
||||||
|
|
||||||
if (!(cmd = qemuMonitorJSONMakeCommand("query-named-block-nodes",
|
if (!(cmd = qemuMonitorJSONMakeCommand("query-named-block-nodes",
|
||||||
"B:flat", flat,
|
"B:flat", mon->queryNamedBlockNodesFlat,
|
||||||
NULL)))
|
NULL)))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
@ -2503,7 +2502,7 @@ qemuMonitorJSONBlockStatsUpdateCapacityBlockdev(qemuMonitor *mon,
|
|||||||
{
|
{
|
||||||
g_autoptr(virJSONValue) nodes = NULL;
|
g_autoptr(virJSONValue) nodes = NULL;
|
||||||
|
|
||||||
if (!(nodes = qemuMonitorJSONQueryNamedBlockNodes(mon, mon->queryNamedBlockNodesFlat)))
|
if (!(nodes = qemuMonitorJSONQueryNamedBlockNodes(mon)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (virJSONValueArrayForeachSteal(nodes,
|
if (virJSONValueArrayForeachSteal(nodes,
|
||||||
@ -2669,12 +2668,11 @@ qemuMonitorJSONBlockGetNamedNodeDataJSON(virJSONValue *nodes)
|
|||||||
|
|
||||||
|
|
||||||
GHashTable *
|
GHashTable *
|
||||||
qemuMonitorJSONBlockGetNamedNodeData(qemuMonitor *mon,
|
qemuMonitorJSONBlockGetNamedNodeData(qemuMonitor *mon)
|
||||||
bool supports_flat)
|
|
||||||
{
|
{
|
||||||
g_autoptr(virJSONValue) nodes = NULL;
|
g_autoptr(virJSONValue) nodes = NULL;
|
||||||
|
|
||||||
if (!(nodes = qemuMonitorJSONQueryNamedBlockNodes(mon, supports_flat)))
|
if (!(nodes = qemuMonitorJSONQueryNamedBlockNodes(mon)))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return qemuMonitorJSONBlockGetNamedNodeDataJSON(nodes);
|
return qemuMonitorJSONBlockGetNamedNodeDataJSON(nodes);
|
||||||
|
@ -105,8 +105,7 @@ GHashTable *
|
|||||||
qemuMonitorJSONBlockGetNamedNodeDataJSON(virJSONValue *nodes);
|
qemuMonitorJSONBlockGetNamedNodeDataJSON(virJSONValue *nodes);
|
||||||
|
|
||||||
GHashTable *
|
GHashTable *
|
||||||
qemuMonitorJSONBlockGetNamedNodeData(qemuMonitor *mon,
|
qemuMonitorJSONBlockGetNamedNodeData(qemuMonitor *mon);
|
||||||
bool supports_flat);
|
|
||||||
|
|
||||||
int
|
int
|
||||||
qemuMonitorJSONBlockResize(qemuMonitor *mon,
|
qemuMonitorJSONBlockResize(qemuMonitor *mon,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user