[RFC PATCH 13/30] qemu: block: Format 'read-only' attribute for JSON disk protocol

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

 



This will be required when doing blockdev-add to conform with the
approach qemu would chose to create the disks.

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

diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
index eb246ebd60..44662a4603 100644
--- a/src/qemu/qemu_block.c
+++ b/src/qemu/qemu_block.c
@@ -1154,6 +1154,9 @@ qemuBlockStorageSourceGetBackendProps(virStorageSourcePtr src,
     if (!legacy) {
         if (qemuBlockStorageSourceGetBlockdevGetCacheProps(src, fileprops) < 0)
             goto cleanup;
+
+        if (virJSONValueObjectAdd(fileprops, "b:read-only", src->readonly, NULL) < 0)
+            goto cleanup;
     }

     VIR_STEAL_PTR(ret, fileprops);
-- 
2.14.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[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