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(a)redhat.com>
---
src/qemu/qemu_block.c | 4 +---
src/qemu/qemu_monitor.c | 7 ++-----
src/qemu/qemu_monitor.h | 3 +--
src/qemu/qemu_monitor_json.c | 12 +++++-------
src/qemu/qemu_monitor_json.h | 3 +--
5 files changed, 10 insertions(+), 19 deletions(-)
diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
index e98b5d4739..8a6f601b29 100644
--- a/src/qemu/qemu_block.c
+++ b/src/qemu/qemu_block.c
@@ -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);
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index dd394cd19b..cd9f43071e 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -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);
}
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index 5a84a4d095..62f1bc1299 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -712,8 +712,7 @@ struct _qemuBlockNamedNodeData {
};
GHashTable *
-qemuMonitorBlockGetNamedNodeData(qemuMonitor *mon,
- bool supports_flat);
+qemuMonitorBlockGetNamedNodeData(qemuMonitor *mon);
int qemuMonitorBlockResize(qemuMonitor *mon,
const char *device,
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 0e34cb55ad..74967afb24 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -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);
diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h
index c0abc9dd4f..4c65838b7e 100644
--- a/src/qemu/qemu_monitor_json.h
+++ b/src/qemu/qemu_monitor_json.h
@@ -105,8 +105,7 @@ GHashTable *
qemuMonitorJSONBlockGetNamedNodeDataJSON(virJSONValue *nodes);
GHashTable *
-qemuMonitorJSONBlockGetNamedNodeData(qemuMonitor *mon,
- bool supports_flat);
+qemuMonitorJSONBlockGetNamedNodeData(qemuMonitor *mon);
int
qemuMonitorJSONBlockResize(qemuMonitor *mon,
--
2.37.3