[PATCH 13/17] qemu: block: Absorb qemuBlockReopenFormatMon into qemuBlockReopenAccess

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Move all the code into the now only caller.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_block.c | 31 +++++++++----------------------
 src/qemu/qemu_block.h |  5 -----
 2 files changed, 9 insertions(+), 27 deletions(-)

diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
index 84d9ddd9ef..c62f8fe5f3 100644
--- a/src/qemu/qemu_block.c
+++ b/src/qemu/qemu_block.c
@@ -3155,26 +3155,6 @@ qemuBlockBitmapsHandleCommitFinish(virStorageSource *topsrc,
 }


-int
-qemuBlockReopenFormatMon(qemuMonitor *mon,
-                         virStorageSource *src)
-{
-    g_autoptr(virJSONValue) srcprops = NULL;
-    g_autoptr(virJSONValue) reopenoptions = virJSONValueNewArray();
-
-    if (!(srcprops = qemuBlockStorageSourceGetFormatProps(src, src->backingStore)))
-        return -1;
-
-    if (virJSONValueArrayAppend(reopenoptions, &srcprops) < 0)
-        return -1;
-
-    if (qemuMonitorBlockdevReopen(mon, &reopenoptions) < 0)
-        return -1;
-
-    return 0;
-}
-
-
 /**
  * qemuBlockReopenAccess:
  * @vm: domain object
@@ -3193,7 +3173,8 @@ qemuBlockReopenAccess(virDomainObj *vm,
                       bool readonly,
                       virDomainAsyncJob asyncJob)
 {
-    qemuDomainObjPrivate *priv = vm->privateData;
+    g_autoptr(virJSONValue) reopenoptions = virJSONValueNewArray();
+    g_autoptr(virJSONValue) srcprops = NULL;
     int rc;
     int ret = -1;

@@ -3211,10 +3192,16 @@ qemuBlockReopenAccess(virDomainObj *vm,
     src->readonly = readonly;
     /* from now on all error paths must use 'goto cleanup' */

+    if (!(srcprops = qemuBlockStorageSourceGetFormatProps(src, src->backingStore)))
+        return -1;
+
+    if (virJSONValueArrayAppend(reopenoptions, &srcprops) < 0)
+        return -1;
+
     if (qemuDomainObjEnterMonitorAsync(vm, asyncJob) < 0)
         goto cleanup;

-    rc = qemuBlockReopenFormatMon(priv->mon, src);
+    rc = qemuMonitorBlockdevReopen(qemuDomainGetMonitor(vm), &reopenoptions);

     qemuDomainObjExitMonitor(vm);
     if (rc < 0)
diff --git a/src/qemu/qemu_block.h b/src/qemu/qemu_block.h
index dcd8a6ed6c..f37e10216c 100644
--- a/src/qemu/qemu_block.h
+++ b/src/qemu/qemu_block.h
@@ -263,11 +263,6 @@ qemuBlockBitmapsHandleCommitFinish(virStorageSource *topsrc,
                                    GHashTable *blockNamedNodeData,
                                    virJSONValue **actions);

-/* only for use in qemumonitorjsontest */
-int
-qemuBlockReopenFormatMon(qemuMonitor *mon,
-                         virStorageSource *src);
-
 int
 qemuBlockReopenReadWrite(virDomainObj *vm,
                          virStorageSource *src,
-- 
2.42.0
_______________________________________________
Devel mailing list -- devel@xxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxx




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux