[libvirt] [PATCH 2/3] qemu: block: Add support for file/block/dir storage to JSON disk src generator
Peter Krempa
pkrempa at redhat.com
Thu Oct 12 19:13:31 UTC 2017
qemuBlockStorageSourceGetBackendProps now is able to format the JSON
definition for regular storage too.
---
src/qemu/qemu_block.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
index 4c0f675ca..75a8d6200 100644
--- a/src/qemu/qemu_block.c
+++ b/src/qemu/qemu_block.c
@@ -577,6 +577,12 @@ qemuBlockStorageSourceGetBackendProps(virStorageSourcePtr src)
case VIR_STORAGE_TYPE_BLOCK:
case VIR_STORAGE_TYPE_FILE:
case VIR_STORAGE_TYPE_DIR:
+ if (virJSONValueObjectCreate(&fileprops,
+ "s:driver", "file",
+ "s:filename", src->path, NULL) < 0)
+ return NULL;
+ break;
+
case VIR_STORAGE_TYPE_VOLUME:
case VIR_STORAGE_TYPE_NONE:
case VIR_STORAGE_TYPE_LAST:
--
2.14.1
More information about the libvir-list
mailing list