[PATCH 14/17] qemuBlockReopenAccess: prepare for removal of 'raw' format layer

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

 



Make the helper reopening a blockdev for access pick the correct layer
to reopen based on what is currently in use.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_block.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
index c62f8fe5f3..0d676f71b0 100644
--- a/src/qemu/qemu_block.c
+++ b/src/qemu/qemu_block.c
@@ -3192,8 +3192,19 @@ qemuBlockReopenAccess(virDomainObj *vm,
     src->readonly = readonly;
     /* from now on all error paths must use 'goto cleanup' */

-    if (!(srcprops = qemuBlockStorageSourceGetFormatProps(src, src->backingStore)))
-        return -1;
+    /* based on which is the current 'effecitve' layer we must reopen the
+     * appropriate blockdev */
+    if (qemuBlockStorageSourceGetFormatNodename(src)) {
+        if (!(srcprops = qemuBlockStorageSourceGetFormatProps(src, src->backingStore)))
+            return -1;
+    } else if (qemuBlockStorageSourceGetSliceNodename(src)) {
+        if (!(srcprops = qemuBlockStorageSourceGetBlockdevStorageSliceProps(src, true)))
+            return -1;
+    } else {
+        if (!(srcprops = qemuBlockStorageSourceGetBackendProps(src,
+                                                               QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_EFFECTIVE_NODE)))
+            return -1;
+    }

     if (virJSONValueArrayAppend(reopenoptions, &srcprops) < 0)
         return -1;
-- 
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