提交 7a185d2f 编写于 作者: P Peter Krempa

qemu: monitor: Extract internals of qemuMonitorJSONBlockGetNamedNodeData

For testing purposes it will be beneficial to be able to parse the data
from JSON directly rather than trying to simulate the monitor. Extract
the worker bits and export them.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NEric Blake <eblake@redhat.com>
上级 fdb22e4e
......@@ -2988,14 +2988,10 @@ qemuMonitorJSONBlockGetNamedNodeDataWorker(size_t pos G_GNUC_UNUSED,
virHashTablePtr
qemuMonitorJSONBlockGetNamedNodeData(qemuMonitorPtr mon)
qemuMonitorJSONBlockGetNamedNodeDataJSON(virJSONValuePtr nodes)
{
g_autoptr(virJSONValue) nodes = NULL;
g_autoptr(virHashTable) ret = NULL;
if (!(nodes = qemuMonitorJSONQueryNamedBlockNodes(mon)))
return NULL;
if (!(ret = virHashNew((virHashDataFree) qemuMonitorJSONBlockNamedNodeDataFree)))
return NULL;
......@@ -3008,6 +3004,18 @@ qemuMonitorJSONBlockGetNamedNodeData(qemuMonitorPtr mon)
}
virHashTablePtr
qemuMonitorJSONBlockGetNamedNodeData(qemuMonitorPtr mon)
{
g_autoptr(virJSONValue) nodes = NULL;
if (!(nodes = qemuMonitorJSONQueryNamedBlockNodes(mon)))
return NULL;
return qemuMonitorJSONBlockGetNamedNodeDataJSON(nodes);
}
int qemuMonitorJSONBlockResize(qemuMonitorPtr mon,
const char *device,
const char *nodename,
......
......@@ -87,6 +87,9 @@ int qemuMonitorJSONBlockStatsUpdateCapacity(qemuMonitorPtr mon,
int qemuMonitorJSONBlockStatsUpdateCapacityBlockdev(qemuMonitorPtr mon,
virHashTablePtr stats);
virHashTablePtr
qemuMonitorJSONBlockGetNamedNodeDataJSON(virJSONValuePtr nodes);
virHashTablePtr
qemuMonitorJSONBlockGetNamedNodeData(qemuMonitorPtr mon);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册