On Fri, Jan 31, 2020 at 03:31:12PM +0100, Peter Krempa wrote:
Create a wrapper for qemuBlockGetNamedNodeData named
qemuBlockGetNamedNodeData. The purpose of the wrapper is to integrate
the monitor handling functionality and in the future possible
qemuCaps-based flags.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_backup.c | 5 +----
src/qemu/qemu_block.c | 20 ++++++++++++++++++++
src/qemu/qemu_block.h | 4 ++++
src/qemu/qemu_driver.c | 16 ++++------------
4 files changed, 29 insertions(+), 16 deletions(-)
diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
index 22f03da485..13e240fdac 100644
--- a/src/qemu/qemu_block.c
+++ b/src/qemu/qemu_block.c
@@ -2670,3 +2670,23 @@ qemuBlockNamedNodeDataGetBitmapByName(virHashTablePtr
blockNamedNodeData,
return NULL;
}
+
+
+virHashTablePtr
+qemuBlockGetNamedNodeData(virDomainObjPtr vm,
+ qemuDomainAsyncJob asyncJob)
+{
+ qemuDomainObjPrivatePtr priv = vm->privateData;
+ virQEMUDriverPtr driver = priv->driver;
+ g_autoptr(virHashTable) blockNamedNodeData = NULL;
+
+ if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
+ return NULL;
+
+ blockNamedNodeData = qemuMonitorBlockGetNamedNodeData(priv->mon);
+
+ if (qemuDomainObjExitMonitor(driver, vm) < 0 || !blockNamedNodeData)
The value of blockNamedNodeData is being returned, no need to check for
it here.
+ return NULL;
+
+ return g_steal_pointer(&blockNamedNodeData);
+}
Either way:
Reviewed-by: Ján Tomko <jtomko(a)redhat.com>
Jano