[PATCH 04/17] qemuBlockStorageSourceGetBlockdevStorageSliceProps: Allow turning the slice layer into effective blockdev layer

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

 



Allow using the slice layer as effective layer once we stop formatting
the unnecessary 'raw' driver.

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

diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
index 123e764e63..f7e912ece0 100644
--- a/src/qemu/qemu_block.c
+++ b/src/qemu/qemu_block.c
@@ -1448,8 +1448,18 @@ qemuBlockStorageSourceGetFormatProps(virStorageSource *src,
 }


+/**
+ * qemuBlockStorageSourceGetBlockdevStorageSliceProps:
+ * @src: storage source object
+ * @effective: Whether this blockdev will be the 'effective' layer of @src
+ *
+ * Formats the JSON object representing -blockdev configuration required to
+ * configure a 'slice' of @src. If @effective is true, the slice layer is the
+ * topmost/effective blockdev layer of @src.
+ */
 static virJSONValue *
-qemuBlockStorageSourceGetBlockdevStorageSliceProps(virStorageSource *src)
+qemuBlockStorageSourceGetBlockdevStorageSliceProps(virStorageSource *src,
+                                                   bool effective)
 {
     g_autoptr(virJSONValue) props = NULL;

@@ -1464,7 +1474,7 @@ qemuBlockStorageSourceGetBlockdevStorageSliceProps(virStorageSource *src)
     if (qemuBlockStorageSourceAddBlockdevCommonProps(&props,
                                                      src,
                                                      src->sliceStorage->nodename,
-                                                     false) < 0)
+                                                     effective) < 0)
         return NULL;

     return g_steal_pointer(&props);
@@ -1536,7 +1546,7 @@ qemuBlockStorageSourceAttachPrepareBlockdev(virStorageSource *src,
     data->formatNodeName = qemuBlockStorageSourceGetFormatNodename(src);

     if ((data->storageSliceNodeName = qemuBlockStorageSourceGetSliceNodename(src))) {
-        if (!(data->storageSliceProps = qemuBlockStorageSourceGetBlockdevStorageSliceProps(src)))
+        if (!(data->storageSliceProps = qemuBlockStorageSourceGetBlockdevStorageSliceProps(src, false)))
             return NULL;
     }

-- 
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