From: Peter Krempa Date: Fri, 6 Apr 2018 04:40:23 +0000 (+0200) Subject: qemu: block: Format 'read-only' attribute for JSON disk protocol X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=b51016c73c933650afa537df11466e8975a67892;p=libvirt.git qemu: block: Format 'read-only' attribute for JSON disk protocol This will be required when doing blockdev-add to conform with the approach qemu choses to create the disks. Signed-off-by: Peter Krempa Reviewed-by: John Ferlan --- diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 21b88fecd6..775c125467 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);