mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
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: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
fdb22e4e43
commit
7a185d2f6e
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user