diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index ab476da7f0..ee125de2a7 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -4219,3 +4219,14 @@ qemuMonitorSetBlockThreshold(qemuMonitorPtr mon, return qemuMonitorJSONSetBlockThreshold(mon, nodename, threshold); } + + +virJSONValuePtr +qemuMonitorQueryNamedBlockNodes(qemuMonitorPtr mon) +{ + VIR_DEBUG("mon=%p", mon); + + QEMU_CHECK_MONITOR_JSON_NULL(mon); + + return qemuMonitorJSONQueryNamedBlockNodes(mon); +} diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 7fd83b620d..ee8bf42d14 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -1083,5 +1083,6 @@ int qemuMonitorSetBlockThreshold(qemuMonitorPtr mon, const char *nodename, unsigned long long threshold); +virJSONValuePtr qemuMonitorQueryNamedBlockNodes(qemuMonitorPtr mon); #endif /* QEMU_MONITOR_H */ diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 06bf84dd96..6c01fad4dd 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -7557,3 +7557,29 @@ qemuMonitorJSONSetBlockThreshold(qemuMonitorPtr mon, return ret; } + + +virJSONValuePtr +qemuMonitorJSONQueryNamedBlockNodes(qemuMonitorPtr mon) +{ + virJSONValuePtr cmd; + virJSONValuePtr reply = NULL; + virJSONValuePtr ret = NULL; + + if (!(cmd = qemuMonitorJSONMakeCommand("query-named-block-nodes", NULL))) + return NULL; + + if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) + goto cleanup; + + if (qemuMonitorJSONCheckError(cmd, reply) < 0) + goto cleanup; + + ret = virJSONValueObjectStealArray(reply, "return"); + + cleanup: + virJSONValueFree(cmd); + virJSONValueFree(reply); + + return ret; +} diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index 8bcd443333..9495efd034 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -518,4 +518,7 @@ int qemuMonitorJSONSetBlockThreshold(qemuMonitorPtr mon, unsigned long long threshold) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); +virJSONValuePtr qemuMonitorJSONQueryNamedBlockNodes(qemuMonitorPtr mon) + ATTRIBUTE_NONNULL(1); + #endif /* QEMU_MONITOR_JSON_H */