[libvirt] [PATCH 17/35] qemu: block: Format 'read-only' attribute for JSON disk protocol

Peter Krempa posted 35 patches 7 years, 7 months ago
[libvirt] [PATCH 17/35] qemu: block: Format 'read-only' attribute for JSON disk protocol
Posted by Peter Krempa 7 years, 7 months ago
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@redhat.com>
---
 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 3c04707618..b1f495b731 100644
--- a/src/qemu/qemu_block.c
+++ b/src/qemu/qemu_block.c
@@ -1162,6 +1162,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.16.2

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 17/35] qemu: block: Format 'read-only' attribute for JSON disk protocol
Posted by John Ferlan 7 years, 7 months ago

On 04/25/2018 11:15 AM, Peter Krempa wrote:
> This will be required when doing blockdev-add to conform with the
> approach qemu would chose to create the disks.

s/would chose/chooses/

If 'would' does stay, then it's still choose as chose would be past tense.

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

Reviewed-by: John Ferlan <jferlan@redhat.com>

John

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