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 <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
Peter Krempa 2018-04-06 06:40:23 +02:00
parent de5a15bc3d
commit b51016c73c

View File

@ -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);