]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: block: Add support for file/block/dir storage to JSON disk src generator
authorPeter Krempa <pkrempa@redhat.com>
Thu, 13 Jul 2017 07:48:14 +0000 (09:48 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 18 Oct 2017 07:43:49 +0000 (09:43 +0200)
qemuBlockStorageSourceGetBackendProps now is able to format the JSON
definition for regular storage too.

src/qemu/qemu_block.c

index 254075b2c4e0f8519490dfad9a34e093137eb53f..0761f89913e3ca3d89df52f0c78e839617b837ae 100644 (file)
@@ -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: