Reference the storage via node name rather than inlining it. This is
the approach that will be used with -blockdev/blockdev-add since it
allows more control and is more future proof.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_block.c | 8 +-
tests/qemublocktest.c | 11 +-
.../xml2json/block-raw-noopts.json | 15 ++-
.../qemublocktestdata/xml2json/dir-fat-cache.json | 27 ++--
.../qemublocktestdata/xml2json/dir-fat-floppy.json | 19 +--
.../xml2json/dir-fat-readonly.json | 19 +--
.../xml2json/file-backing_basic-aio_threads.json | 82 +++++------
.../file-backing_basic-cache-directsync.json | 108 ++++++++-------
.../xml2json/file-backing_basic-cache-none.json | 108 ++++++++-------
.../xml2json/file-backing_basic-cache-unsafe.json | 108 ++++++++-------
.../file-backing_basic-cache-writeback.json | 108 ++++++++-------
.../file-backing_basic-cache-writethrough.json | 108 ++++++++-------
.../xml2json/file-backing_basic-detect.json | 76 ++++++-----
.../xml2json/file-backing_basic-noopts.json | 60 +++++----
.../xml2json/file-backing_basic-unmap-detect.json | 76 ++++++-----
.../xml2json/file-backing_basic-unmap-ignore.json | 76 ++++++-----
.../xml2json/file-backing_basic-unmap.json | 76 ++++++-----
.../xml2json/file-bochs-noopts.json | 15 ++-
.../xml2json/file-cloop-noopts.json | 15 ++-
.../xml2json/file-dmg-noopts.json | 15 ++-
.../xml2json/file-ploop-noopts.json | 15 ++-
.../file-qcow2-backing-chain-encryption.json | 30 +++--
.../xml2json/file-qcow2-backing-chain-noopts.json | 150 +++++++++++----------
.../file-qcow2-backing-chain-unterminated.json | 30 +++--
.../xml2json/file-raw-aio_native.json | 25 ++--
.../qemublocktestdata/xml2json/file-raw-luks.json | 15 ++-
.../xml2json/file-raw-noopts.json | 15 ++-
.../xml2json/file-vdi-noopts.json | 15 ++-
.../xml2json/file-vhd-noopts.json | 15 ++-
.../xml2json/file-vpc-noopts.json | 15 ++-
.../network-qcow2-backing-chain-cache-unsafe.json | 74 +++++-----
...etwork-qcow2-backing-chain-encryption_auth.json | 64 ++++-----
32 files changed, 834 insertions(+), 759 deletions(-)
diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
index 12f37cda01..a514e8a055 100644
--- a/src/qemu/qemu_block.c
+++ b/src/qemu/qemu_block.c
@@ -1432,7 +1432,6 @@ virJSONValuePtr
qemuBlockStorageSourceGetBlockdevProps(virStorageSourcePtr src)
{
bool backingSupported = src->format >= VIR_STORAGE_FILE_BACKING;
- virJSONValuePtr storage = NULL;
virJSONValuePtr props = NULL;
virJSONValuePtr ret = NULL;
@@ -1446,13 +1445,9 @@ qemuBlockStorageSourceGetBlockdevProps(virStorageSourcePtr src)
if (!(props = qemuBlockStorageSourceGetBlockdevFormatProps(src)))
goto cleanup;
- if (!(storage = qemuBlockStorageSourceGetBackendProps(src, false)))
+ if (virJSONValueObjectAppendString(props, "file", src->nodestorage) <
0)
goto cleanup;
- if (virJSONValueObjectAppend(props, "file", storage) < 0)
- goto cleanup;
- storage = NULL;
-
if (src->backingStore && backingSupported) {
if (virStorageSourceHasBacking(src)) {
if (virJSONValueObjectAppendString(props, "backing",
@@ -1469,7 +1464,6 @@ qemuBlockStorageSourceGetBlockdevProps(virStorageSourcePtr src)
VIR_STEAL_PTR(ret, props);
cleanup:
- virJSONValueFree(storage);
virJSONValueFree(props);
return ret;
}
diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c
index eae1ca8ee3..d671505969 100644
--- a/tests/qemublocktest.c
+++ b/tests/qemublocktest.c
@@ -191,7 +191,8 @@ testQemuDiskXMLToProps(const void *opaque)
struct testQemuDiskXMLToJSONData *data = (void *) opaque;
virDomainDiskDefPtr disk = NULL;
virStorageSourcePtr n;
- virJSONValuePtr props = NULL;
+ virJSONValuePtr formatProps = NULL;
+ virJSONValuePtr storageProps = NULL;
char *xmlpath = NULL;
char *xmlstr = NULL;
int ret = -1;
@@ -221,7 +222,8 @@ testQemuDiskXMLToProps(const void *opaque)
if (testQemuDiskXMLToJSONFakeSecrets(n) < 0)
goto cleanup;
- if (!(props = qemuBlockStorageSourceGetBlockdevProps(n))) {
+ if (!(formatProps = qemuBlockStorageSourceGetBlockdevProps(n)) ||
+ !(storageProps = qemuBlockStorageSourceGetBackendProps(n, false))) {
if (!data->fail) {
VIR_TEST_VERBOSE("failed to generate qemu blockdev props\n");
goto cleanup;
@@ -231,13 +233,16 @@ testQemuDiskXMLToProps(const void *opaque)
goto cleanup;
}
- if (VIR_APPEND_ELEMENT(data->props, data->nprops, props) < 0)
+ if (VIR_APPEND_ELEMENT(data->props, data->nprops, formatProps) < 0 ||
+ VIR_APPEND_ELEMENT(data->props, data->nprops, storageProps) < 0)
goto cleanup;
}
ret = 0;
cleanup:
+ virJSONValueFree(formatProps);
+ virJSONValueFree(storageProps);
virDomainDiskDefFree(disk);
VIR_FREE(xmlpath);
VIR_FREE(xmlstr);
diff --git a/tests/qemublocktestdata/xml2json/block-raw-noopts.json
b/tests/qemublocktestdata/xml2json/block-raw-noopts.json
index 25bf77d5aa..f223659c76 100644
--- a/tests/qemublocktestdata/xml2json/block-raw-noopts.json
+++ b/tests/qemublocktestdata/xml2json/block-raw-noopts.json
@@ -2,11 +2,12 @@
"node-name": "0123456789ABCDEF0123456789ABCDE",
"read-only": false,
"driver": "raw",
- "file": {
- "driver": "host_device",
- "filename": "/dev/blah",
- "node-name": "0123456789ABCDEF0123456789ABCDE",
- "read-only": false,
- "discard": "unmap"
- }
+ "file": "0123456789ABCDEF0123456789ABCDE"
+}
+{
+ "driver": "host_device",
+ "filename": "/dev/blah",
+ "node-name": "0123456789ABCDEF0123456789ABCDE",
+ "read-only": false,
+ "discard": "unmap"
}
diff --git a/tests/qemublocktestdata/xml2json/dir-fat-cache.json
b/tests/qemublocktestdata/xml2json/dir-fat-cache.json
index 8c0a045ed5..ef33add681 100644
--- a/tests/qemublocktestdata/xml2json/dir-fat-cache.json
+++ b/tests/qemublocktestdata/xml2json/dir-fat-cache.json
@@ -6,17 +6,18 @@
"no-flush": false
},
"driver": "raw",
- "file": {
- "driver": "vvfat",
- "dir": "/var/somefiles",
- "floppy": false,
- "rw": false,
- "node-name": "node-s",
- "cache": {
- "direct": true,
- "no-flush": false
- },
- "read-only": true,
- "discard": "unmap"
- }
+ "file": "node-s"
+}
+{
+ "driver": "vvfat",
+ "dir": "/var/somefiles",
+ "floppy": false,
+ "rw": false,
+ "node-name": "node-s",
+ "cache": {
+ "direct": true,
+ "no-flush": false
+ },
+ "read-only": true,
+ "discard": "unmap"
}
diff --git a/tests/qemublocktestdata/xml2json/dir-fat-floppy.json
b/tests/qemublocktestdata/xml2json/dir-fat-floppy.json
index 9685acaa8b..db7954a6bc 100644
--- a/tests/qemublocktestdata/xml2json/dir-fat-floppy.json
+++ b/tests/qemublocktestdata/xml2json/dir-fat-floppy.json
@@ -2,13 +2,14 @@
"node-name": "node-f",
"read-only": true,
"driver": "raw",
- "file": {
- "driver": "vvfat",
- "dir": "/var/somefiles",
- "floppy": true,
- "rw": false,
- "node-name": "node-s",
- "read-only": true,
- "discard": "unmap"
- }
+ "file": "node-s"
+}
+{
+ "driver": "vvfat",
+ "dir": "/var/somefiles",
+ "floppy": true,
+ "rw": false,
+ "node-name": "node-s",
+ "read-only": true,
+ "discard": "unmap"
}
diff --git a/tests/qemublocktestdata/xml2json/dir-fat-readonly.json
b/tests/qemublocktestdata/xml2json/dir-fat-readonly.json
index 7d35d255cc..a306fb4d47 100644
--- a/tests/qemublocktestdata/xml2json/dir-fat-readonly.json
+++ b/tests/qemublocktestdata/xml2json/dir-fat-readonly.json
@@ -2,13 +2,14 @@
"node-name": "node-f",
"read-only": true,
"driver": "raw",
- "file": {
- "driver": "vvfat",
- "dir": "/var/somefiles",
- "floppy": false,
- "rw": false,
- "node-name": "node-s",
- "read-only": true,
- "discard": "unmap"
- }
+ "file": "node-s"
+}
+{
+ "driver": "vvfat",
+ "dir": "/var/somefiles",
+ "floppy": false,
+ "rw": false,
+ "node-name": "node-s",
+ "read-only": true,
+ "discard": "unmap"
}
diff --git a/tests/qemublocktestdata/xml2json/file-backing_basic-aio_threads.json
b/tests/qemublocktestdata/xml2json/file-backing_basic-aio_threads.json
index dcaf905085..a9bdd1bcc2 100644
--- a/tests/qemublocktestdata/xml2json/file-backing_basic-aio_threads.json
+++ b/tests/qemublocktestdata/xml2json/file-backing_basic-aio_threads.json
@@ -2,61 +2,65 @@
"node-name": "node-a-f",
"read-only": false,
"driver": "qcow",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/a",
- "aio": "threads",
- "node-name": "node-a-s",
- "read-only": false,
- "discard": "unmap"
- },
+ "file": "node-a-s",
"backing": "node-b-f"
}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/a",
+ "aio": "threads",
+ "node-name": "node-a-s",
+ "read-only": false,
+ "discard": "unmap"
+}
{
"node-name": "node-b-f",
"read-only": true,
"driver": "qed",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/b",
- "aio": "threads",
- "node-name": "node-b-s",
- "read-only": true,
- "discard": "unmap"
- },
+ "file": "node-b-s",
"backing": "node-c-f"
}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/b",
+ "aio": "threads",
+ "node-name": "node-b-s",
+ "read-only": true,
+ "discard": "unmap"
+}
{
"node-name": "node-c-f",
"read-only": true,
"driver": "vmdk",
- "file": {
- "driver": "gluster",
- "volume": "images",
- "path": "c",
- "server": [
- {
- "type": "inet",
- "host": "test.org",
- "port": "24007"
- }
- ],
- "node-name": "node-c-s",
- "read-only": true,
- "discard": "unmap"
- },
+ "file": "node-c-s",
"backing": "node-d-f"
}
+{
+ "driver": "gluster",
+ "volume": "images",
+ "path": "c",
+ "server": [
+ {
+ "type": "inet",
+ "host": "test.org",
+ "port": "24007"
+ }
+ ],
+ "node-name": "node-c-s",
+ "read-only": true,
+ "discard": "unmap"
+}
{
"node-name": "node-d-f",
"read-only": true,
"driver": "raw",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/d",
- "aio": "threads",
- "node-name": "node-d-s",
- "read-only": true,
- "discard": "unmap"
- }
+ "file": "node-d-s"
+}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/d",
+ "aio": "threads",
+ "node-name": "node-d-s",
+ "read-only": true,
+ "discard": "unmap"
}
diff --git a/tests/qemublocktestdata/xml2json/file-backing_basic-cache-directsync.json
b/tests/qemublocktestdata/xml2json/file-backing_basic-cache-directsync.json
index 023caf013f..18cd183cd8 100644
--- a/tests/qemublocktestdata/xml2json/file-backing_basic-cache-directsync.json
+++ b/tests/qemublocktestdata/xml2json/file-backing_basic-cache-directsync.json
@@ -6,19 +6,20 @@
"no-flush": false
},
"driver": "qcow2",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/a",
- "node-name": "node-a-s",
- "cache": {
- "direct": true,
- "no-flush": false
- },
- "read-only": false,
- "discard": "unmap"
- },
+ "file": "node-a-s",
"backing": "node-b-f"
}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/a",
+ "node-name": "node-a-s",
+ "cache": {
+ "direct": true,
+ "no-flush": false
+ },
+ "read-only": false,
+ "discard": "unmap"
+}
{
"node-name": "node-b-f",
"read-only": true,
@@ -27,19 +28,20 @@
"no-flush": false
},
"driver": "qcow2",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/b",
- "node-name": "node-b-s",
- "cache": {
- "direct": true,
- "no-flush": false
- },
- "read-only": true,
- "discard": "unmap"
- },
+ "file": "node-b-s",
"backing": "node-c-f"
}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/b",
+ "node-name": "node-b-s",
+ "cache": {
+ "direct": true,
+ "no-flush": false
+ },
+ "read-only": true,
+ "discard": "unmap"
+}
{
"node-name": "node-c-f",
"read-only": true,
@@ -48,27 +50,28 @@
"no-flush": false
},
"driver": "qcow2",
- "file": {
- "driver": "gluster",
- "volume": "images",
- "path": "c",
- "server": [
- {
- "type": "inet",
- "host": "test.org",
- "port": "24007"
- }
- ],
- "node-name": "node-c-s",
- "cache": {
- "direct": true,
- "no-flush": false
- },
- "read-only": true,
- "discard": "unmap"
- },
+ "file": "node-c-s",
"backing": "node-d-f"
}
+{
+ "driver": "gluster",
+ "volume": "images",
+ "path": "c",
+ "server": [
+ {
+ "type": "inet",
+ "host": "test.org",
+ "port": "24007"
+ }
+ ],
+ "node-name": "node-c-s",
+ "cache": {
+ "direct": true,
+ "no-flush": false
+ },
+ "read-only": true,
+ "discard": "unmap"
+}
{
"node-name": "node-d-f",
"read-only": true,
@@ -77,15 +80,16 @@
"no-flush": false
},
"driver": "raw",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/d",
- "node-name": "node-d-s",
- "cache": {
- "direct": true,
- "no-flush": false
- },
- "read-only": true,
- "discard": "unmap"
- }
+ "file": "node-d-s"
+}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/d",
+ "node-name": "node-d-s",
+ "cache": {
+ "direct": true,
+ "no-flush": false
+ },
+ "read-only": true,
+ "discard": "unmap"
}
diff --git a/tests/qemublocktestdata/xml2json/file-backing_basic-cache-none.json
b/tests/qemublocktestdata/xml2json/file-backing_basic-cache-none.json
index 023caf013f..18cd183cd8 100644
--- a/tests/qemublocktestdata/xml2json/file-backing_basic-cache-none.json
+++ b/tests/qemublocktestdata/xml2json/file-backing_basic-cache-none.json
@@ -6,19 +6,20 @@
"no-flush": false
},
"driver": "qcow2",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/a",
- "node-name": "node-a-s",
- "cache": {
- "direct": true,
- "no-flush": false
- },
- "read-only": false,
- "discard": "unmap"
- },
+ "file": "node-a-s",
"backing": "node-b-f"
}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/a",
+ "node-name": "node-a-s",
+ "cache": {
+ "direct": true,
+ "no-flush": false
+ },
+ "read-only": false,
+ "discard": "unmap"
+}
{
"node-name": "node-b-f",
"read-only": true,
@@ -27,19 +28,20 @@
"no-flush": false
},
"driver": "qcow2",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/b",
- "node-name": "node-b-s",
- "cache": {
- "direct": true,
- "no-flush": false
- },
- "read-only": true,
- "discard": "unmap"
- },
+ "file": "node-b-s",
"backing": "node-c-f"
}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/b",
+ "node-name": "node-b-s",
+ "cache": {
+ "direct": true,
+ "no-flush": false
+ },
+ "read-only": true,
+ "discard": "unmap"
+}
{
"node-name": "node-c-f",
"read-only": true,
@@ -48,27 +50,28 @@
"no-flush": false
},
"driver": "qcow2",
- "file": {
- "driver": "gluster",
- "volume": "images",
- "path": "c",
- "server": [
- {
- "type": "inet",
- "host": "test.org",
- "port": "24007"
- }
- ],
- "node-name": "node-c-s",
- "cache": {
- "direct": true,
- "no-flush": false
- },
- "read-only": true,
- "discard": "unmap"
- },
+ "file": "node-c-s",
"backing": "node-d-f"
}
+{
+ "driver": "gluster",
+ "volume": "images",
+ "path": "c",
+ "server": [
+ {
+ "type": "inet",
+ "host": "test.org",
+ "port": "24007"
+ }
+ ],
+ "node-name": "node-c-s",
+ "cache": {
+ "direct": true,
+ "no-flush": false
+ },
+ "read-only": true,
+ "discard": "unmap"
+}
{
"node-name": "node-d-f",
"read-only": true,
@@ -77,15 +80,16 @@
"no-flush": false
},
"driver": "raw",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/d",
- "node-name": "node-d-s",
- "cache": {
- "direct": true,
- "no-flush": false
- },
- "read-only": true,
- "discard": "unmap"
- }
+ "file": "node-d-s"
+}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/d",
+ "node-name": "node-d-s",
+ "cache": {
+ "direct": true,
+ "no-flush": false
+ },
+ "read-only": true,
+ "discard": "unmap"
}
diff --git a/tests/qemublocktestdata/xml2json/file-backing_basic-cache-unsafe.json
b/tests/qemublocktestdata/xml2json/file-backing_basic-cache-unsafe.json
index 5f6b94a9d5..4e92061c65 100644
--- a/tests/qemublocktestdata/xml2json/file-backing_basic-cache-unsafe.json
+++ b/tests/qemublocktestdata/xml2json/file-backing_basic-cache-unsafe.json
@@ -6,19 +6,20 @@
"no-flush": true
},
"driver": "qcow2",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/a",
- "node-name": "node-a-s",
- "cache": {
- "direct": false,
- "no-flush": true
- },
- "read-only": false,
- "discard": "unmap"
- },
+ "file": "node-a-s",
"backing": "node-b-f"
}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/a",
+ "node-name": "node-a-s",
+ "cache": {
+ "direct": false,
+ "no-flush": true
+ },
+ "read-only": false,
+ "discard": "unmap"
+}
{
"node-name": "node-b-f",
"read-only": true,
@@ -27,19 +28,20 @@
"no-flush": true
},
"driver": "qcow2",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/b",
- "node-name": "node-b-s",
- "cache": {
- "direct": false,
- "no-flush": true
- },
- "read-only": true,
- "discard": "unmap"
- },
+ "file": "node-b-s",
"backing": "node-c-f"
}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/b",
+ "node-name": "node-b-s",
+ "cache": {
+ "direct": false,
+ "no-flush": true
+ },
+ "read-only": true,
+ "discard": "unmap"
+}
{
"node-name": "node-c-f",
"read-only": true,
@@ -48,27 +50,28 @@
"no-flush": true
},
"driver": "qcow2",
- "file": {
- "driver": "gluster",
- "volume": "images",
- "path": "c",
- "server": [
- {
- "type": "inet",
- "host": "test.org",
- "port": "24007"
- }
- ],
- "node-name": "node-c-s",
- "cache": {
- "direct": false,
- "no-flush": true
- },
- "read-only": true,
- "discard": "unmap"
- },
+ "file": "node-c-s",
"backing": "node-d-f"
}
+{
+ "driver": "gluster",
+ "volume": "images",
+ "path": "c",
+ "server": [
+ {
+ "type": "inet",
+ "host": "test.org",
+ "port": "24007"
+ }
+ ],
+ "node-name": "node-c-s",
+ "cache": {
+ "direct": false,
+ "no-flush": true
+ },
+ "read-only": true,
+ "discard": "unmap"
+}
{
"node-name": "node-d-f",
"read-only": true,
@@ -77,15 +80,16 @@
"no-flush": true
},
"driver": "raw",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/d",
- "node-name": "node-d-s",
- "cache": {
- "direct": false,
- "no-flush": true
- },
- "read-only": true,
- "discard": "unmap"
- }
+ "file": "node-d-s"
+}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/d",
+ "node-name": "node-d-s",
+ "cache": {
+ "direct": false,
+ "no-flush": true
+ },
+ "read-only": true,
+ "discard": "unmap"
}
diff --git a/tests/qemublocktestdata/xml2json/file-backing_basic-cache-writeback.json
b/tests/qemublocktestdata/xml2json/file-backing_basic-cache-writeback.json
index 9dc7d38850..a105b47483 100644
--- a/tests/qemublocktestdata/xml2json/file-backing_basic-cache-writeback.json
+++ b/tests/qemublocktestdata/xml2json/file-backing_basic-cache-writeback.json
@@ -6,19 +6,20 @@
"no-flush": false
},
"driver": "qcow2",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/a",
- "node-name": "node-a-s",
- "cache": {
- "direct": false,
- "no-flush": false
- },
- "read-only": false,
- "discard": "unmap"
- },
+ "file": "node-a-s",
"backing": "node-b-f"
}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/a",
+ "node-name": "node-a-s",
+ "cache": {
+ "direct": false,
+ "no-flush": false
+ },
+ "read-only": false,
+ "discard": "unmap"
+}
{
"node-name": "node-b-f",
"read-only": true,
@@ -27,19 +28,20 @@
"no-flush": false
},
"driver": "qcow2",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/b",
- "node-name": "node-b-s",
- "cache": {
- "direct": false,
- "no-flush": false
- },
- "read-only": true,
- "discard": "unmap"
- },
+ "file": "node-b-s",
"backing": "node-c-f"
}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/b",
+ "node-name": "node-b-s",
+ "cache": {
+ "direct": false,
+ "no-flush": false
+ },
+ "read-only": true,
+ "discard": "unmap"
+}
{
"node-name": "node-c-f",
"read-only": true,
@@ -48,27 +50,28 @@
"no-flush": false
},
"driver": "qcow2",
- "file": {
- "driver": "gluster",
- "volume": "images",
- "path": "c",
- "server": [
- {
- "type": "inet",
- "host": "test.org",
- "port": "24007"
- }
- ],
- "node-name": "node-c-s",
- "cache": {
- "direct": false,
- "no-flush": false
- },
- "read-only": true,
- "discard": "unmap"
- },
+ "file": "node-c-s",
"backing": "node-d-f"
}
+{
+ "driver": "gluster",
+ "volume": "images",
+ "path": "c",
+ "server": [
+ {
+ "type": "inet",
+ "host": "test.org",
+ "port": "24007"
+ }
+ ],
+ "node-name": "node-c-s",
+ "cache": {
+ "direct": false,
+ "no-flush": false
+ },
+ "read-only": true,
+ "discard": "unmap"
+}
{
"node-name": "node-d-f",
"read-only": true,
@@ -77,15 +80,16 @@
"no-flush": false
},
"driver": "raw",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/d",
- "node-name": "node-d-s",
- "cache": {
- "direct": false,
- "no-flush": false
- },
- "read-only": true,
- "discard": "unmap"
- }
+ "file": "node-d-s"
+}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/d",
+ "node-name": "node-d-s",
+ "cache": {
+ "direct": false,
+ "no-flush": false
+ },
+ "read-only": true,
+ "discard": "unmap"
}
diff --git a/tests/qemublocktestdata/xml2json/file-backing_basic-cache-writethrough.json
b/tests/qemublocktestdata/xml2json/file-backing_basic-cache-writethrough.json
index 9dc7d38850..a105b47483 100644
--- a/tests/qemublocktestdata/xml2json/file-backing_basic-cache-writethrough.json
+++ b/tests/qemublocktestdata/xml2json/file-backing_basic-cache-writethrough.json
@@ -6,19 +6,20 @@
"no-flush": false
},
"driver": "qcow2",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/a",
- "node-name": "node-a-s",
- "cache": {
- "direct": false,
- "no-flush": false
- },
- "read-only": false,
- "discard": "unmap"
- },
+ "file": "node-a-s",
"backing": "node-b-f"
}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/a",
+ "node-name": "node-a-s",
+ "cache": {
+ "direct": false,
+ "no-flush": false
+ },
+ "read-only": false,
+ "discard": "unmap"
+}
{
"node-name": "node-b-f",
"read-only": true,
@@ -27,19 +28,20 @@
"no-flush": false
},
"driver": "qcow2",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/b",
- "node-name": "node-b-s",
- "cache": {
- "direct": false,
- "no-flush": false
- },
- "read-only": true,
- "discard": "unmap"
- },
+ "file": "node-b-s",
"backing": "node-c-f"
}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/b",
+ "node-name": "node-b-s",
+ "cache": {
+ "direct": false,
+ "no-flush": false
+ },
+ "read-only": true,
+ "discard": "unmap"
+}
{
"node-name": "node-c-f",
"read-only": true,
@@ -48,27 +50,28 @@
"no-flush": false
},
"driver": "qcow2",
- "file": {
- "driver": "gluster",
- "volume": "images",
- "path": "c",
- "server": [
- {
- "type": "inet",
- "host": "test.org",
- "port": "24007"
- }
- ],
- "node-name": "node-c-s",
- "cache": {
- "direct": false,
- "no-flush": false
- },
- "read-only": true,
- "discard": "unmap"
- },
+ "file": "node-c-s",
"backing": "node-d-f"
}
+{
+ "driver": "gluster",
+ "volume": "images",
+ "path": "c",
+ "server": [
+ {
+ "type": "inet",
+ "host": "test.org",
+ "port": "24007"
+ }
+ ],
+ "node-name": "node-c-s",
+ "cache": {
+ "direct": false,
+ "no-flush": false
+ },
+ "read-only": true,
+ "discard": "unmap"
+}
{
"node-name": "node-d-f",
"read-only": true,
@@ -77,15 +80,16 @@
"no-flush": false
},
"driver": "raw",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/d",
- "node-name": "node-d-s",
- "cache": {
- "direct": false,
- "no-flush": false
- },
- "read-only": true,
- "discard": "unmap"
- }
+ "file": "node-d-s"
+}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/d",
+ "node-name": "node-d-s",
+ "cache": {
+ "direct": false,
+ "no-flush": false
+ },
+ "read-only": true,
+ "discard": "unmap"
}
diff --git a/tests/qemublocktestdata/xml2json/file-backing_basic-detect.json
b/tests/qemublocktestdata/xml2json/file-backing_basic-detect.json
index c1e4c40757..44a6e90fcd 100644
--- a/tests/qemublocktestdata/xml2json/file-backing_basic-detect.json
+++ b/tests/qemublocktestdata/xml2json/file-backing_basic-detect.json
@@ -3,58 +3,62 @@
"read-only": false,
"detect-zeroes": "on",
"driver": "qcow",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/a",
- "node-name": "node-a-s",
- "read-only": false,
- "discard": "unmap"
- },
+ "file": "node-a-s",
"backing": "node-b-f"
}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/a",
+ "node-name": "node-a-s",
+ "read-only": false,
+ "discard": "unmap"
+}
{
"node-name": "node-b-f",
"read-only": true,
"driver": "qed",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/b",
- "node-name": "node-b-s",
- "read-only": true,
- "discard": "unmap"
- },
+ "file": "node-b-s",
"backing": "node-c-f"
}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/b",
+ "node-name": "node-b-s",
+ "read-only": true,
+ "discard": "unmap"
+}
{
"node-name": "node-c-f",
"read-only": true,
"driver": "vmdk",
- "file": {
- "driver": "gluster",
- "volume": "images",
- "path": "c",
- "server": [
- {
- "type": "inet",
- "host": "test.org",
- "port": "24007"
- }
- ],
- "node-name": "node-c-s",
- "read-only": true,
- "discard": "unmap"
- },
+ "file": "node-c-s",
"backing": "node-d-f"
}
+{
+ "driver": "gluster",
+ "volume": "images",
+ "path": "c",
+ "server": [
+ {
+ "type": "inet",
+ "host": "test.org",
+ "port": "24007"
+ }
+ ],
+ "node-name": "node-c-s",
+ "read-only": true,
+ "discard": "unmap"
+}
{
"node-name": "node-d-f",
"read-only": true,
"driver": "raw",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/d",
- "node-name": "node-d-s",
- "read-only": true,
- "discard": "unmap"
- }
+ "file": "node-d-s"
+}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/d",
+ "node-name": "node-d-s",
+ "read-only": true,
+ "discard": "unmap"
}
diff --git a/tests/qemublocktestdata/xml2json/file-backing_basic-noopts.json
b/tests/qemublocktestdata/xml2json/file-backing_basic-noopts.json
index 3285a6ec67..b0fd9b6988 100644
--- a/tests/qemublocktestdata/xml2json/file-backing_basic-noopts.json
+++ b/tests/qemublocktestdata/xml2json/file-backing_basic-noopts.json
@@ -2,50 +2,54 @@
"node-name": "node-a-f",
"read-only": false,
"driver": "qed",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/a",
- "node-name": "node-a-s",
- "read-only": false,
- "discard": "unmap"
- },
+ "file": "node-a-s",
"backing": "node-b-f"
}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/a",
+ "node-name": "node-a-s",
+ "read-only": false,
+ "discard": "unmap"
+}
{
"node-name": "node-b-f",
"read-only": true,
"driver": "qcow",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/b",
- "node-name": "node-b-s",
- "read-only": true,
- "discard": "unmap"
- },
+ "file": "node-b-s",
"backing": "node-c-f"
}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/b",
+ "node-name": "node-b-s",
+ "read-only": true,
+ "discard": "unmap"
+}
{
"node-name": "node-c-f",
"read-only": true,
"driver": "vmdk",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/c",
- "node-name": "node-c-s",
- "read-only": true,
- "discard": "unmap"
- },
+ "file": "node-c-s",
"backing": "node-d-f"
}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/c",
+ "node-name": "node-c-s",
+ "read-only": true,
+ "discard": "unmap"
+}
{
"node-name": "node-d-f",
"read-only": true,
"driver": "raw",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/d",
- "node-name": "node-d-s",
- "read-only": true,
- "discard": "unmap"
- }
+ "file": "node-d-s"
+}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/d",
+ "node-name": "node-d-s",
+ "read-only": true,
+ "discard": "unmap"
}
diff --git a/tests/qemublocktestdata/xml2json/file-backing_basic-unmap-detect.json
b/tests/qemublocktestdata/xml2json/file-backing_basic-unmap-detect.json
index b00008dd54..6cf4e77090 100644
--- a/tests/qemublocktestdata/xml2json/file-backing_basic-unmap-detect.json
+++ b/tests/qemublocktestdata/xml2json/file-backing_basic-unmap-detect.json
@@ -4,61 +4,65 @@
"discard": "unmap",
"detect-zeroes": "unmap",
"driver": "qcow",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/a",
- "node-name": "node-a-s",
- "read-only": false,
- "discard": "unmap"
- },
+ "file": "node-a-s",
"backing": "node-b-f"
}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/a",
+ "node-name": "node-a-s",
+ "read-only": false,
+ "discard": "unmap"
+}
{
"node-name": "node-b-f",
"read-only": true,
"discard": "unmap",
"driver": "qed",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/b",
- "node-name": "node-b-s",
- "read-only": true,
- "discard": "unmap"
- },
+ "file": "node-b-s",
"backing": "node-c-f"
}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/b",
+ "node-name": "node-b-s",
+ "read-only": true,
+ "discard": "unmap"
+}
{
"node-name": "node-c-f",
"read-only": true,
"discard": "unmap",
"driver": "vmdk",
- "file": {
- "driver": "gluster",
- "volume": "images",
- "path": "c",
- "server": [
- {
- "type": "inet",
- "host": "test.org",
- "port": "24007"
- }
- ],
- "node-name": "node-c-s",
- "read-only": true,
- "discard": "unmap"
- },
+ "file": "node-c-s",
"backing": "node-d-f"
}
+{
+ "driver": "gluster",
+ "volume": "images",
+ "path": "c",
+ "server": [
+ {
+ "type": "inet",
+ "host": "test.org",
+ "port": "24007"
+ }
+ ],
+ "node-name": "node-c-s",
+ "read-only": true,
+ "discard": "unmap"
+}
{
"node-name": "node-d-f",
"read-only": true,
"discard": "unmap",
"driver": "raw",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/d",
- "node-name": "node-d-s",
- "read-only": true,
- "discard": "unmap"
- }
+ "file": "node-d-s"
+}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/d",
+ "node-name": "node-d-s",
+ "read-only": true,
+ "discard": "unmap"
}
diff --git a/tests/qemublocktestdata/xml2json/file-backing_basic-unmap-ignore.json
b/tests/qemublocktestdata/xml2json/file-backing_basic-unmap-ignore.json
index 5419deafc0..b6e454297f 100644
--- a/tests/qemublocktestdata/xml2json/file-backing_basic-unmap-ignore.json
+++ b/tests/qemublocktestdata/xml2json/file-backing_basic-unmap-ignore.json
@@ -4,61 +4,65 @@
"discard": "ignore",
"detect-zeroes": "on",
"driver": "qcow",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/a",
- "node-name": "node-a-s",
- "read-only": false,
- "discard": "unmap"
- },
+ "file": "node-a-s",
"backing": "node-b-f"
}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/a",
+ "node-name": "node-a-s",
+ "read-only": false,
+ "discard": "unmap"
+}
{
"node-name": "node-b-f",
"read-only": true,
"discard": "ignore",
"driver": "qed",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/b",
- "node-name": "node-b-s",
- "read-only": true,
- "discard": "unmap"
- },
+ "file": "node-b-s",
"backing": "node-c-f"
}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/b",
+ "node-name": "node-b-s",
+ "read-only": true,
+ "discard": "unmap"
+}
{
"node-name": "node-c-f",
"read-only": true,
"discard": "ignore",
"driver": "vmdk",
- "file": {
- "driver": "gluster",
- "volume": "images",
- "path": "c",
- "server": [
- {
- "type": "inet",
- "host": "test.org",
- "port": "24007"
- }
- ],
- "node-name": "node-c-s",
- "read-only": true,
- "discard": "unmap"
- },
+ "file": "node-c-s",
"backing": "node-d-f"
}
+{
+ "driver": "gluster",
+ "volume": "images",
+ "path": "c",
+ "server": [
+ {
+ "type": "inet",
+ "host": "test.org",
+ "port": "24007"
+ }
+ ],
+ "node-name": "node-c-s",
+ "read-only": true,
+ "discard": "unmap"
+}
{
"node-name": "node-d-f",
"read-only": true,
"discard": "ignore",
"driver": "raw",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/d",
- "node-name": "node-d-s",
- "read-only": true,
- "discard": "unmap"
- }
+ "file": "node-d-s"
+}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/d",
+ "node-name": "node-d-s",
+ "read-only": true,
+ "discard": "unmap"
}
diff --git a/tests/qemublocktestdata/xml2json/file-backing_basic-unmap.json
b/tests/qemublocktestdata/xml2json/file-backing_basic-unmap.json
index 1efc462c06..21a10c8543 100644
--- a/tests/qemublocktestdata/xml2json/file-backing_basic-unmap.json
+++ b/tests/qemublocktestdata/xml2json/file-backing_basic-unmap.json
@@ -3,61 +3,65 @@
"read-only": false,
"discard": "unmap",
"driver": "qcow",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/a",
- "node-name": "node-a-s",
- "read-only": false,
- "discard": "unmap"
- },
+ "file": "node-a-s",
"backing": "node-b-f"
}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/a",
+ "node-name": "node-a-s",
+ "read-only": false,
+ "discard": "unmap"
+}
{
"node-name": "node-b-f",
"read-only": true,
"discard": "unmap",
"driver": "qed",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/b",
- "node-name": "node-b-s",
- "read-only": true,
- "discard": "unmap"
- },
+ "file": "node-b-s",
"backing": "node-c-f"
}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/b",
+ "node-name": "node-b-s",
+ "read-only": true,
+ "discard": "unmap"
+}
{
"node-name": "node-c-f",
"read-only": true,
"discard": "unmap",
"driver": "vmdk",
- "file": {
- "driver": "gluster",
- "volume": "images",
- "path": "c",
- "server": [
- {
- "type": "inet",
- "host": "test.org",
- "port": "24007"
- }
- ],
- "node-name": "node-c-s",
- "read-only": true,
- "discard": "unmap"
- },
+ "file": "node-c-s",
"backing": "node-d-f"
}
+{
+ "driver": "gluster",
+ "volume": "images",
+ "path": "c",
+ "server": [
+ {
+ "type": "inet",
+ "host": "test.org",
+ "port": "24007"
+ }
+ ],
+ "node-name": "node-c-s",
+ "read-only": true,
+ "discard": "unmap"
+}
{
"node-name": "node-d-f",
"read-only": true,
"discard": "unmap",
"driver": "raw",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/d",
- "node-name": "node-d-s",
- "read-only": true,
- "discard": "unmap"
- }
+ "file": "node-d-s"
+}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/d",
+ "node-name": "node-d-s",
+ "read-only": true,
+ "discard": "unmap"
}
diff --git a/tests/qemublocktestdata/xml2json/file-bochs-noopts.json
b/tests/qemublocktestdata/xml2json/file-bochs-noopts.json
index 22e2560998..6ab43b2a1c 100644
--- a/tests/qemublocktestdata/xml2json/file-bochs-noopts.json
+++ b/tests/qemublocktestdata/xml2json/file-bochs-noopts.json
@@ -2,11 +2,12 @@
"node-name": "test1",
"read-only": false,
"driver": "bochs",
- "file": {
- "driver": "file",
- "filename": "/path/to/i.img",
- "node-name": "test2",
- "read-only": false,
- "discard": "unmap"
- }
+ "file": "test2"
+}
+{
+ "driver": "file",
+ "filename": "/path/to/i.img",
+ "node-name": "test2",
+ "read-only": false,
+ "discard": "unmap"
}
diff --git a/tests/qemublocktestdata/xml2json/file-cloop-noopts.json
b/tests/qemublocktestdata/xml2json/file-cloop-noopts.json
index b72bb5df56..f709c3d3bd 100644
--- a/tests/qemublocktestdata/xml2json/file-cloop-noopts.json
+++ b/tests/qemublocktestdata/xml2json/file-cloop-noopts.json
@@ -2,11 +2,12 @@
"node-name": "test1",
"read-only": false,
"driver": "cloop",
- "file": {
- "driver": "file",
- "filename": "/path/to/i.img",
- "node-name": "test2",
- "read-only": false,
- "discard": "unmap"
- }
+ "file": "test2"
+}
+{
+ "driver": "file",
+ "filename": "/path/to/i.img",
+ "node-name": "test2",
+ "read-only": false,
+ "discard": "unmap"
}
diff --git a/tests/qemublocktestdata/xml2json/file-dmg-noopts.json
b/tests/qemublocktestdata/xml2json/file-dmg-noopts.json
index 9f2912b8d3..55261de4b2 100644
--- a/tests/qemublocktestdata/xml2json/file-dmg-noopts.json
+++ b/tests/qemublocktestdata/xml2json/file-dmg-noopts.json
@@ -2,11 +2,12 @@
"node-name": "test1",
"read-only": false,
"driver": "dmg",
- "file": {
- "driver": "file",
- "filename": "/path/to/i.img",
- "node-name": "test2",
- "read-only": false,
- "discard": "unmap"
- }
+ "file": "test2"
+}
+{
+ "driver": "file",
+ "filename": "/path/to/i.img",
+ "node-name": "test2",
+ "read-only": false,
+ "discard": "unmap"
}
diff --git a/tests/qemublocktestdata/xml2json/file-ploop-noopts.json
b/tests/qemublocktestdata/xml2json/file-ploop-noopts.json
index 64006d28a3..81fa263098 100644
--- a/tests/qemublocktestdata/xml2json/file-ploop-noopts.json
+++ b/tests/qemublocktestdata/xml2json/file-ploop-noopts.json
@@ -2,11 +2,12 @@
"node-name": "test1",
"read-only": false,
"driver": "parallels",
- "file": {
- "driver": "file",
- "filename": "/path/to/i.img",
- "node-name": "test2",
- "read-only": false,
- "discard": "unmap"
- }
+ "file": "test2"
+}
+{
+ "driver": "file",
+ "filename": "/path/to/i.img",
+ "node-name": "test2",
+ "read-only": false,
+ "discard": "unmap"
}
diff --git a/tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-encryption.json
b/tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-encryption.json
index 94e2ecd1e2..3469c06654 100644
--- a/tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-encryption.json
+++ b/tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-encryption.json
@@ -6,15 +6,16 @@
"format": "luks",
"key-secret": "node-b-f-encalias"
},
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/a",
- "node-name": "node-a-s",
- "read-only": false,
- "discard": "unmap"
- },
+ "file": "node-a-s",
"backing": "node-b-f"
}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/a",
+ "node-name": "node-a-s",
+ "read-only": false,
+ "discard": "unmap"
+}
{
"node-name": "node-b-f",
"read-only": true,
@@ -23,12 +24,13 @@
"format": "aes",
"key-secret": "node-b-f-encalias"
},
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/b",
- "node-name": "node-b-s",
- "read-only": true,
- "discard": "unmap"
- },
+ "file": "node-b-s",
"backing": null
}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/b",
+ "node-name": "node-b-s",
+ "read-only": true,
+ "discard": "unmap"
+}
diff --git a/tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-noopts.json
b/tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-noopts.json
index 3e7c08f080..6bc6e2fe30 100644
--- a/tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-noopts.json
+++ b/tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-noopts.json
@@ -2,129 +2,139 @@
"node-name": "#block126",
"read-only": false,
"driver": "qcow2",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/rhel7.3.1507297895",
- "node-name": "#block004",
- "read-only": false,
- "discard": "unmap"
- },
+ "file": "#block004",
"backing": "#block313"
}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/rhel7.3.1507297895",
+ "node-name": "#block004",
+ "read-only": false,
+ "discard": "unmap"
+}
{
"node-name": "#block313",
"read-only": true,
"driver": "qcow2",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/rhel7.3.1484071872",
- "node-name": "#block256",
- "read-only": true,
- "discard": "unmap"
- },
+ "file": "#block256",
"backing": "#block556"
}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/rhel7.3.1484071872",
+ "node-name": "#block256",
+ "read-only": true,
+ "discard": "unmap"
+}
{
"node-name": "#block556",
"read-only": true,
"driver": "qcow2",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/rhel7.3.1483615252",
- "node-name": "#block418",
- "read-only": true,
- "discard": "unmap"
- },
+ "file": "#block418",
"backing": "#block767"
}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/rhel7.3.1483615252",
+ "node-name": "#block418",
+ "read-only": true,
+ "discard": "unmap"
+}
{
"node-name": "#block767",
"read-only": true,
"driver": "qcow2",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/rhel7.3.1483605924",
- "node-name": "#block624",
- "read-only": true,
- "discard": "unmap"
- },
+ "file": "#block624",
"backing": "#block937"
}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/rhel7.3.1483605924",
+ "node-name": "#block624",
+ "read-only": true,
+ "discard": "unmap"
+}
{
"node-name": "#block937",
"read-only": true,
"driver": "qcow2",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/rhel7.3.1483605920",
- "node-name": "#block869",
- "read-only": true,
- "discard": "unmap"
- },
+ "file": "#block869",
"backing": "#block1157"
}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/rhel7.3.1483605920",
+ "node-name": "#block869",
+ "read-only": true,
+ "discard": "unmap"
+}
{
"node-name": "#block1157",
"read-only": true,
"driver": "qcow2",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/rhel7.3.1483546244",
- "node-name": "#block1047",
- "read-only": true,
- "discard": "unmap"
- },
+ "file": "#block1047",
"backing": "#block1392"
}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/rhel7.3.1483546244",
+ "node-name": "#block1047",
+ "read-only": true,
+ "discard": "unmap"
+}
{
"node-name": "#block1392",
"read-only": true,
"driver": "qcow2",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/rhel7.3.1483545901",
- "node-name": "#block1279",
- "read-only": true,
- "discard": "unmap"
- },
+ "file": "#block1279",
"backing": "#block1523"
}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/rhel7.3.1483545901",
+ "node-name": "#block1279",
+ "read-only": true,
+ "discard": "unmap"
+}
{
"node-name": "#block1523",
"read-only": true,
"driver": "qcow2",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/rhel7.3.1483545313",
- "node-name": "#block1444",
- "read-only": true,
- "discard": "unmap"
- },
+ "file": "#block1444",
"backing": "#block1742"
}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/rhel7.3.1483545313",
+ "node-name": "#block1444",
+ "read-only": true,
+ "discard": "unmap"
+}
{
"node-name": "#block1742",
"read-only": true,
"driver": "qcow2",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/rhel7.3.1483536402",
- "node-name": "#block1602",
- "read-only": true,
- "discard": "unmap"
- },
+ "file": "#block1602",
"backing": "#block1909"
}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/rhel7.3.1483536402",
+ "node-name": "#block1602",
+ "read-only": true,
+ "discard": "unmap"
+}
{
"node-name": "#block1909",
"read-only": true,
"driver": "qcow2",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/rhel7.3.qcow2",
- "node-name": "#block1864",
- "read-only": true,
- "discard": "unmap"
- },
+ "file": "#block1864",
"backing": null
}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/rhel7.3.qcow2",
+ "node-name": "#block1864",
+ "read-only": true,
+ "discard": "unmap"
+}
diff --git a/tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-unterminated.json
b/tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-unterminated.json
index 8fcdc48bb0..454c07faec 100644
--- a/tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-unterminated.json
+++ b/tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-unterminated.json
@@ -2,24 +2,26 @@
"node-name": "#block126",
"read-only": false,
"driver": "qcow2",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/rhel7.3.1507297895",
- "node-name": "#block004",
- "read-only": false,
- "discard": "unmap"
- },
+ "file": "#block004",
"backing": "#block313"
}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/rhel7.3.1507297895",
+ "node-name": "#block004",
+ "read-only": false,
+ "discard": "unmap"
+}
{
"node-name": "#block313",
"read-only": true,
"driver": "qcow2",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/rhel7.3.1484071872",
- "node-name": "#block256",
- "read-only": true,
- "discard": "unmap"
- }
+ "file": "#block256"
+}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/rhel7.3.1484071872",
+ "node-name": "#block256",
+ "read-only": true,
+ "discard": "unmap"
}
diff --git a/tests/qemublocktestdata/xml2json/file-raw-aio_native.json
b/tests/qemublocktestdata/xml2json/file-raw-aio_native.json
index 2752e0b204..4e63561311 100644
--- a/tests/qemublocktestdata/xml2json/file-raw-aio_native.json
+++ b/tests/qemublocktestdata/xml2json/file-raw-aio_native.json
@@ -6,16 +6,17 @@
"no-flush": false
},
"driver": "raw",
- "file": {
- "driver": "file",
- "filename": "/path/to/i.img",
- "aio": "native",
- "node-name": "test2",
- "cache": {
- "direct": true,
- "no-flush": false
- },
- "read-only": false,
- "discard": "unmap"
- }
+ "file": "test2"
+}
+{
+ "driver": "file",
+ "filename": "/path/to/i.img",
+ "aio": "native",
+ "node-name": "test2",
+ "cache": {
+ "direct": true,
+ "no-flush": false
+ },
+ "read-only": false,
+ "discard": "unmap"
}
diff --git a/tests/qemublocktestdata/xml2json/file-raw-luks.json
b/tests/qemublocktestdata/xml2json/file-raw-luks.json
index e3d9c4c26b..c26dd3bba5 100644
--- a/tests/qemublocktestdata/xml2json/file-raw-luks.json
+++ b/tests/qemublocktestdata/xml2json/file-raw-luks.json
@@ -3,11 +3,12 @@
"read-only": false,
"driver": "luks",
"key-secret": "test1-encalias",
- "file": {
- "driver": "file",
- "filename": "/path/luks.img",
- "node-name": "test2",
- "read-only": false,
- "discard": "unmap"
- }
+ "file": "test2"
+}
+{
+ "driver": "file",
+ "filename": "/path/luks.img",
+ "node-name": "test2",
+ "read-only": false,
+ "discard": "unmap"
}
diff --git a/tests/qemublocktestdata/xml2json/file-raw-noopts.json
b/tests/qemublocktestdata/xml2json/file-raw-noopts.json
index 25de571428..cace1f6448 100644
--- a/tests/qemublocktestdata/xml2json/file-raw-noopts.json
+++ b/tests/qemublocktestdata/xml2json/file-raw-noopts.json
@@ -2,11 +2,12 @@
"node-name": "0123456789ABCDEF0123456789ABCDE",
"read-only": false,
"driver": "raw",
- "file": {
- "driver": "file",
- "filename": "/var/lib/libvirt/images/i.img",
- "node-name": "0123456789ABCDEF0123456789ABCDE",
- "read-only": false,
- "discard": "unmap"
- }
+ "file": "0123456789ABCDEF0123456789ABCDE"
+}
+{
+ "driver": "file",
+ "filename": "/var/lib/libvirt/images/i.img",
+ "node-name": "0123456789ABCDEF0123456789ABCDE",
+ "read-only": false,
+ "discard": "unmap"
}
diff --git a/tests/qemublocktestdata/xml2json/file-vdi-noopts.json
b/tests/qemublocktestdata/xml2json/file-vdi-noopts.json
index ce8e359c91..15f9da2091 100644
--- a/tests/qemublocktestdata/xml2json/file-vdi-noopts.json
+++ b/tests/qemublocktestdata/xml2json/file-vdi-noopts.json
@@ -2,11 +2,12 @@
"node-name": "test1",
"read-only": false,
"driver": "vdi",
- "file": {
- "driver": "file",
- "filename": "/path/to/i.img",
- "node-name": "test2",
- "read-only": false,
- "discard": "unmap"
- }
+ "file": "test2"
+}
+{
+ "driver": "file",
+ "filename": "/path/to/i.img",
+ "node-name": "test2",
+ "read-only": false,
+ "discard": "unmap"
}
diff --git a/tests/qemublocktestdata/xml2json/file-vhd-noopts.json
b/tests/qemublocktestdata/xml2json/file-vhd-noopts.json
index d4b8e1f55a..ce96c4be8a 100644
--- a/tests/qemublocktestdata/xml2json/file-vhd-noopts.json
+++ b/tests/qemublocktestdata/xml2json/file-vhd-noopts.json
@@ -2,11 +2,12 @@
"node-name": "test1",
"read-only": false,
"driver": "vhdx",
- "file": {
- "driver": "file",
- "filename": "/path/to/i.img",
- "node-name": "test2",
- "read-only": false,
- "discard": "unmap"
- }
+ "file": "test2"
+}
+{
+ "driver": "file",
+ "filename": "/path/to/i.img",
+ "node-name": "test2",
+ "read-only": false,
+ "discard": "unmap"
}
diff --git a/tests/qemublocktestdata/xml2json/file-vpc-noopts.json
b/tests/qemublocktestdata/xml2json/file-vpc-noopts.json
index be1ec795a7..9cba99e567 100644
--- a/tests/qemublocktestdata/xml2json/file-vpc-noopts.json
+++ b/tests/qemublocktestdata/xml2json/file-vpc-noopts.json
@@ -2,11 +2,12 @@
"node-name": "test1",
"read-only": false,
"driver": "vpc",
- "file": {
- "driver": "file",
- "filename": "/path/to/i.img",
- "node-name": "test2",
- "read-only": false,
- "discard": "unmap"
- }
+ "file": "test2"
+}
+{
+ "driver": "file",
+ "filename": "/path/to/i.img",
+ "node-name": "test2",
+ "read-only": false,
+ "discard": "unmap"
}
diff --git
a/tests/qemublocktestdata/xml2json/network-qcow2-backing-chain-cache-unsafe.json
b/tests/qemublocktestdata/xml2json/network-qcow2-backing-chain-cache-unsafe.json
index 6161f3375d..80a694eee4 100644
--- a/tests/qemublocktestdata/xml2json/network-qcow2-backing-chain-cache-unsafe.json
+++ b/tests/qemublocktestdata/xml2json/network-qcow2-backing-chain-cache-unsafe.json
@@ -6,30 +6,31 @@
"no-flush": true
},
"driver": "qcow2",
- "file": {
- "driver": "rbd",
- "pool": "rbdpool",
- "image": "rbdimg",
- "server": [
- {
- "host": "host1.example.com",
- "port": "0"
- },
- {
- "host": "host2.example.com",
- "port": "0"
- }
- ],
- "user": "testuser-rbd",
- "node-name": "node-a-s",
- "cache": {
- "direct": false,
- "no-flush": true
+ "file": "node-a-s",
+ "backing": "node-b-f"
+}
+{
+ "driver": "rbd",
+ "pool": "rbdpool",
+ "image": "rbdimg",
+ "server": [
+ {
+ "host": "host1.example.com",
+ "port": "0"
},
- "read-only": false,
- "discard": "unmap"
+ {
+ "host": "host2.example.com",
+ "port": "0"
+ }
+ ],
+ "user": "testuser-rbd",
+ "node-name": "node-a-s",
+ "cache": {
+ "direct": false,
+ "no-flush": true
},
- "backing": "node-b-f"
+ "read-only": false,
+ "discard": "unmap"
}
{
"node-name": "node-b-f",
@@ -39,19 +40,20 @@
"no-flush": true
},
"driver": "qcow2",
- "file": {
- "driver": "iscsi",
- "portal": "example.org:3260",
- "target": "iscsitarget",
- "lun": 1,
- "transport": "tcp",
- "node-name": "node-b-s",
- "cache": {
- "direct": false,
- "no-flush": true
- },
- "read-only": true,
- "discard": "unmap"
- },
+ "file": "node-b-s",
"backing": null
}
+{
+ "driver": "iscsi",
+ "portal": "example.org:3260",
+ "target": "iscsitarget",
+ "lun": 1,
+ "transport": "tcp",
+ "node-name": "node-b-s",
+ "cache": {
+ "direct": false,
+ "no-flush": true
+ },
+ "read-only": true,
+ "discard": "unmap"
+}
diff --git
a/tests/qemublocktestdata/xml2json/network-qcow2-backing-chain-encryption_auth.json
b/tests/qemublocktestdata/xml2json/network-qcow2-backing-chain-encryption_auth.json
index 7e7a4e44f7..6e5abbfbdd 100644
--- a/tests/qemublocktestdata/xml2json/network-qcow2-backing-chain-encryption_auth.json
+++ b/tests/qemublocktestdata/xml2json/network-qcow2-backing-chain-encryption_auth.json
@@ -6,27 +6,28 @@
"format": "luks",
"key-secret": "node-b-f-encalias"
},
- "file": {
- "driver": "rbd",
- "pool": "rbdpool",
- "image": "rbdimg",
- "server": [
- {
- "host": "host1.example.com",
- "port": "0"
- },
- {
- "host": "host2.example.com",
- "port": "0"
- }
- ],
- "user": "testuser-rbd",
- "node-name": "node-a-s",
- "read-only": false,
- "discard": "unmap"
- },
+ "file": "node-a-s",
"backing": "node-b-f"
}
+{
+ "driver": "rbd",
+ "pool": "rbdpool",
+ "image": "rbdimg",
+ "server": [
+ {
+ "host": "host1.example.com",
+ "port": "0"
+ },
+ {
+ "host": "host2.example.com",
+ "port": "0"
+ }
+ ],
+ "user": "testuser-rbd",
+ "node-name": "node-a-s",
+ "read-only": false,
+ "discard": "unmap"
+}
{
"node-name": "node-b-f",
"read-only": true,
@@ -35,17 +36,18 @@
"format": "aes",
"key-secret": "node-b-f-encalias"
},
- "file": {
- "driver": "iscsi",
- "portal": "example.org:3260",
- "target": "iqn.2016-09.com.example:iscsitarget",
- "lun": 1,
- "transport": "tcp",
- "user": "testuser-iscsi",
- "password-secret": "node-b-s-secalias",
- "node-name": "node-b-s",
- "read-only": true,
- "discard": "unmap"
- },
+ "file": "node-b-s",
"backing": null
}
+{
+ "driver": "iscsi",
+ "portal": "example.org:3260",
+ "target": "iqn.2016-09.com.example:iscsitarget",
+ "lun": 1,
+ "transport": "tcp",
+ "user": "testuser-iscsi",
+ "password-secret": "node-b-s-secalias",
+ "node-name": "node-b-s",
+ "read-only": true,
+ "discard": "unmap"
+}
--
2.16.2