提交 855211bb 编写于 作者: P Peter Krempa

qemu: monitor: Add 'flat' parameter for qemuMonitorJSONQueryNamedBlockNodes

Modern qemu allows to skip the nested redundant data in the output of
query-named-block-nodes. Plumb in the support for the argument that
enables it.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 63610bd5
......@@ -4247,7 +4247,7 @@ qemuMonitorQueryNamedBlockNodes(qemuMonitorPtr mon)
{
QEMU_CHECK_MONITOR_NULL(mon);
return qemuMonitorJSONQueryNamedBlockNodes(mon);
return qemuMonitorJSONQueryNamedBlockNodes(mon, false);
}
......
......@@ -2862,7 +2862,7 @@ qemuMonitorJSONBlockStatsUpdateCapacityBlockdev(qemuMonitorPtr mon,
virJSONValuePtr nodes;
int ret = -1;
if (!(nodes = qemuMonitorJSONQueryNamedBlockNodes(mon)))
if (!(nodes = qemuMonitorJSONQueryNamedBlockNodes(mon, false)))
return -1;
if (virJSONValueArrayForeachSteal(nodes,
......@@ -3018,7 +3018,7 @@ qemuMonitorJSONBlockGetNamedNodeData(qemuMonitorPtr mon)
{
g_autoptr(virJSONValue) nodes = NULL;
if (!(nodes = qemuMonitorJSONQueryNamedBlockNodes(mon)))
if (!(nodes = qemuMonitorJSONQueryNamedBlockNodes(mon, false)))
return NULL;
return qemuMonitorJSONBlockGetNamedNodeDataJSON(nodes);
......@@ -8740,12 +8740,15 @@ qemuMonitorJSONSetBlockThreshold(qemuMonitorPtr mon,
virJSONValuePtr
qemuMonitorJSONQueryNamedBlockNodes(qemuMonitorPtr mon)
qemuMonitorJSONQueryNamedBlockNodes(qemuMonitorPtr mon,
bool flat)
{
g_autoptr(virJSONValue) cmd = NULL;
g_autoptr(virJSONValue) reply = NULL;
if (!(cmd = qemuMonitorJSONMakeCommand("query-named-block-nodes", NULL)))
if (!(cmd = qemuMonitorJSONMakeCommand("query-named-block-nodes",
"B:flat", flat,
NULL)))
return NULL;
if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
......
......@@ -584,7 +584,8 @@ int qemuMonitorJSONSetBlockThreshold(qemuMonitorPtr mon,
unsigned long long threshold)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
virJSONValuePtr qemuMonitorJSONQueryNamedBlockNodes(qemuMonitorPtr mon)
virJSONValuePtr qemuMonitorJSONQueryNamedBlockNodes(qemuMonitorPtr mon,
bool flat)
ATTRIBUTE_NONNULL(1);
int qemuMonitorJSONSetWatchdogAction(qemuMonitorPtr mon,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册