[PATCH 34/35] tests: qemublock: Test handling of all cache modes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The test cases would correspond to the following -drive command lines:

dir-fat-cache.xml:
-drive file=fat:/var/somefiles,if=none,id=drive-dummy,readonly=on,cache=directsync
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy,write-cache=off

file-backing_basic-cache-directsync.xml:
-drive file=/var/lib/libvirt/images/a,format=qcow2,if=none,id=drive-dummy,cache=directsync
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy,write-cache=off

file-backing_basic-cache-none.xml:
-drive file=/var/lib/libvirt/images/a,format=qcow2,if=none,id=drive-dummy,cache=none
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy,write-cache=on

file-backing_basic-cache-unsafe.xml:
-drive file=/var/lib/libvirt/images/a,format=qcow2,if=none,id=drive-dummy,cache=unsafe
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy,write-cache=on

file-backing_basic-cache-writeback.xml:
-drive file=/var/lib/libvirt/images/a,format=qcow2,if=none,id=drive-dummy,cache=writeback
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy,write-cache=on

file-backing_basic-cache-writethrough.xml:
-drive file=/var/lib/libvirt/images/a,format=qcow2,if=none,id=drive-dummy,cache=writethrough
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy,write-cache=off

network-qcow2-backing-chain-cache-unsafe.xml:
-drive file=rbd:rbdpool/rbdimg:id=testuser-rbd:auth_supported=cephx\;none:
        mon_host=host1.example.com\;host2.example.com,
        file.password-secret=node-a-s-secalias,format=qcow2,
        if=none,id=drive-dummy,cache=directsync
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy,write-cache=off
---
 tests/qemublocktest.c                              |  8 ++
 .../qemublocktestdata/xml2json/dir-fat-cache.json  | 22 ++++++
 tests/qemublocktestdata/xml2json/dir-fat-cache.xml | 13 ++++
 .../file-backing_basic-cache-directsync.json       | 91 ++++++++++++++++++++++
 .../file-backing_basic-cache-directsync.xml        | 47 +++++++++++
 .../xml2json/file-backing_basic-cache-none.json    | 91 ++++++++++++++++++++++
 .../xml2json/file-backing_basic-cache-none.xml     | 47 +++++++++++
 .../xml2json/file-backing_basic-cache-unsafe.json  | 91 ++++++++++++++++++++++
 .../xml2json/file-backing_basic-cache-unsafe.xml   | 47 +++++++++++
 .../file-backing_basic-cache-writeback.json        | 91 ++++++++++++++++++++++
 .../file-backing_basic-cache-writeback.xml         | 47 +++++++++++
 .../file-backing_basic-cache-writethrough.json     | 91 ++++++++++++++++++++++
 .../file-backing_basic-cache-writethrough.xml      | 47 +++++++++++
 .../network-qcow2-backing-chain-cache-unsafe.json  | 57 ++++++++++++++
 .../network-qcow2-backing-chain-cache-unsafe.xml   | 31 ++++++++
 15 files changed, 821 insertions(+)
 create mode 100644 tests/qemublocktestdata/xml2json/dir-fat-cache.json
 create mode 100644 tests/qemublocktestdata/xml2json/dir-fat-cache.xml
 create mode 100644 tests/qemublocktestdata/xml2json/file-backing_basic-cache-directsync.json
 create mode 100644 tests/qemublocktestdata/xml2json/file-backing_basic-cache-directsync.xml
 create mode 100644 tests/qemublocktestdata/xml2json/file-backing_basic-cache-none.json
 create mode 100644 tests/qemublocktestdata/xml2json/file-backing_basic-cache-none.xml
 create mode 100644 tests/qemublocktestdata/xml2json/file-backing_basic-cache-unsafe.json
 create mode 100644 tests/qemublocktestdata/xml2json/file-backing_basic-cache-unsafe.xml
 create mode 100644 tests/qemublocktestdata/xml2json/file-backing_basic-cache-writeback.json
 create mode 100644 tests/qemublocktestdata/xml2json/file-backing_basic-cache-writeback.xml
 create mode 100644 tests/qemublocktestdata/xml2json/file-backing_basic-cache-writethrough.json
 create mode 100644 tests/qemublocktestdata/xml2json/file-backing_basic-cache-writethrough.xml
 create mode 100644 tests/qemublocktestdata/xml2json/network-qcow2-backing-chain-cache-unsafe.json
 create mode 100644 tests/qemublocktestdata/xml2json/network-qcow2-backing-chain-cache-unsafe.xml

diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c
index 4a2051da57..a888eab524 100644
--- a/tests/qemublocktest.c
+++ b/tests/qemublocktest.c
@@ -470,6 +470,14 @@ mymain(void)
     TEST_DISK_TO_JSON("file-backing_basic-unmap-ignore");
     TEST_DISK_TO_JSON("file-backing_basic-detect");

+    TEST_DISK_TO_JSON("file-backing_basic-cache-none");
+    TEST_DISK_TO_JSON("file-backing_basic-cache-writethrough");
+    TEST_DISK_TO_JSON("file-backing_basic-cache-writeback");
+    TEST_DISK_TO_JSON("file-backing_basic-cache-directsync");
+    TEST_DISK_TO_JSON("file-backing_basic-cache-unsafe");
+    TEST_DISK_TO_JSON("network-qcow2-backing-chain-cache-unsafe");
+    TEST_DISK_TO_JSON("dir-fat-cache");
+
  cleanup:
     virHashFree(diskxmljsondata.schema);
     qemuTestDriverFree(&driver);
diff --git a/tests/qemublocktestdata/xml2json/dir-fat-cache.json b/tests/qemublocktestdata/xml2json/dir-fat-cache.json
new file mode 100644
index 0000000000..8c0a045ed5
--- /dev/null
+++ b/tests/qemublocktestdata/xml2json/dir-fat-cache.json
@@ -0,0 +1,22 @@
+{
+  "node-name": "node-f",
+  "read-only": true,
+  "cache": {
+    "direct": true,
+    "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"
+  }
+}
diff --git a/tests/qemublocktestdata/xml2json/dir-fat-cache.xml b/tests/qemublocktestdata/xml2json/dir-fat-cache.xml
new file mode 100644
index 0000000000..18e652a45f
--- /dev/null
+++ b/tests/qemublocktestdata/xml2json/dir-fat-cache.xml
@@ -0,0 +1,13 @@
+<disk type='dir' device='disk'>
+  <driver name='qemu' type='fat' cache='directsync'/>
+  <source dir='/var/somefiles'>
+    <privateData>
+      <nodenames>
+        <nodename type='storage' name='node-s'/>
+        <nodename type='format' name='node-f'/>
+      </nodenames>
+    </privateData>
+  </source>
+  <target dev='vda'/>
+  <readonly/>
+</disk>
diff --git a/tests/qemublocktestdata/xml2json/file-backing_basic-cache-directsync.json b/tests/qemublocktestdata/xml2json/file-backing_basic-cache-directsync.json
new file mode 100644
index 0000000000..023caf013f
--- /dev/null
+++ b/tests/qemublocktestdata/xml2json/file-backing_basic-cache-directsync.json
@@ -0,0 +1,91 @@
+{
+  "node-name": "node-a-f",
+  "read-only": false,
+  "cache": {
+    "direct": true,
+    "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"
+  },
+  "backing": "node-b-f"
+}
+{
+  "node-name": "node-b-f",
+  "read-only": true,
+  "cache": {
+    "direct": true,
+    "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"
+  },
+  "backing": "node-c-f"
+}
+{
+  "node-name": "node-c-f",
+  "read-only": true,
+  "cache": {
+    "direct": true,
+    "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"
+  },
+  "backing": "node-d-f"
+}
+{
+  "node-name": "node-d-f",
+  "read-only": true,
+  "cache": {
+    "direct": true,
+    "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"
+  }
+}
diff --git a/tests/qemublocktestdata/xml2json/file-backing_basic-cache-directsync.xml b/tests/qemublocktestdata/xml2json/file-backing_basic-cache-directsync.xml
new file mode 100644
index 0000000000..cf4197ea86
--- /dev/null
+++ b/tests/qemublocktestdata/xml2json/file-backing_basic-cache-directsync.xml
@@ -0,0 +1,47 @@
+<disk type='file' device='disk'>
+  <driver name='qemu' type='qcow2' cache='directsync'/>
+  <source file='/var/lib/libvirt/images/a'>
+    <privateData>
+      <nodenames>
+        <nodename type='storage' name='node-a-s'/>
+        <nodename type='format' name='node-a-f'/>
+      </nodenames>
+    </privateData>
+  </source>
+  <backingStore type='file' index='1'>
+    <format type='qcow2'/>
+    <source file='/var/lib/libvirt/images/b'>
+      <privateData>
+        <nodenames>
+          <nodename type='storage' name='node-b-s'/>
+          <nodename type='format' name='node-b-f'/>
+        </nodenames>
+      </privateData>
+    </source>
+    <backingStore type='network' index='2'>
+      <format type='qcow2'/>
+      <source protocol='gluster' name='images/c'>
+        <host name='test.org'/>
+        <privateData>
+          <nodenames>
+            <nodename type='storage' name='node-c-s'/>
+            <nodename type='format' name='node-c-f'/>
+          </nodenames>
+        </privateData>
+      </source>
+      <backingStore type='file' index='3'>
+        <format type='raw'/>
+        <source file='/var/lib/libvirt/images/d'>
+          <privateData>
+            <nodenames>
+              <nodename type='storage' name='node-d-s'/>
+              <nodename type='format' name='node-d-f'/>
+            </nodenames>
+          </privateData>
+        </source>
+        <backingStore/>
+      </backingStore>
+    </backingStore>
+  </backingStore>
+  <target dev='vda'/>
+</disk>
diff --git a/tests/qemublocktestdata/xml2json/file-backing_basic-cache-none.json b/tests/qemublocktestdata/xml2json/file-backing_basic-cache-none.json
new file mode 100644
index 0000000000..023caf013f
--- /dev/null
+++ b/tests/qemublocktestdata/xml2json/file-backing_basic-cache-none.json
@@ -0,0 +1,91 @@
+{
+  "node-name": "node-a-f",
+  "read-only": false,
+  "cache": {
+    "direct": true,
+    "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"
+  },
+  "backing": "node-b-f"
+}
+{
+  "node-name": "node-b-f",
+  "read-only": true,
+  "cache": {
+    "direct": true,
+    "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"
+  },
+  "backing": "node-c-f"
+}
+{
+  "node-name": "node-c-f",
+  "read-only": true,
+  "cache": {
+    "direct": true,
+    "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"
+  },
+  "backing": "node-d-f"
+}
+{
+  "node-name": "node-d-f",
+  "read-only": true,
+  "cache": {
+    "direct": true,
+    "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"
+  }
+}
diff --git a/tests/qemublocktestdata/xml2json/file-backing_basic-cache-none.xml b/tests/qemublocktestdata/xml2json/file-backing_basic-cache-none.xml
new file mode 100644
index 0000000000..240afa85d2
--- /dev/null
+++ b/tests/qemublocktestdata/xml2json/file-backing_basic-cache-none.xml
@@ -0,0 +1,47 @@
+<disk type='file' device='disk'>
+  <driver name='qemu' type='qcow2' cache='none'/>
+  <source file='/var/lib/libvirt/images/a'>
+    <privateData>
+      <nodenames>
+        <nodename type='storage' name='node-a-s'/>
+        <nodename type='format' name='node-a-f'/>
+      </nodenames>
+    </privateData>
+  </source>
+  <backingStore type='file' index='1'>
+    <format type='qcow2'/>
+    <source file='/var/lib/libvirt/images/b'>
+      <privateData>
+        <nodenames>
+          <nodename type='storage' name='node-b-s'/>
+          <nodename type='format' name='node-b-f'/>
+        </nodenames>
+      </privateData>
+    </source>
+    <backingStore type='network' index='2'>
+      <format type='qcow2'/>
+      <source protocol='gluster' name='images/c'>
+        <host name='test.org'/>
+        <privateData>
+          <nodenames>
+            <nodename type='storage' name='node-c-s'/>
+            <nodename type='format' name='node-c-f'/>
+          </nodenames>
+        </privateData>
+      </source>
+      <backingStore type='file' index='3'>
+        <format type='raw'/>
+        <source file='/var/lib/libvirt/images/d'>
+          <privateData>
+            <nodenames>
+              <nodename type='storage' name='node-d-s'/>
+              <nodename type='format' name='node-d-f'/>
+            </nodenames>
+          </privateData>
+        </source>
+        <backingStore/>
+      </backingStore>
+    </backingStore>
+  </backingStore>
+  <target dev='vda'/>
+</disk>
diff --git a/tests/qemublocktestdata/xml2json/file-backing_basic-cache-unsafe.json b/tests/qemublocktestdata/xml2json/file-backing_basic-cache-unsafe.json
new file mode 100644
index 0000000000..5f6b94a9d5
--- /dev/null
+++ b/tests/qemublocktestdata/xml2json/file-backing_basic-cache-unsafe.json
@@ -0,0 +1,91 @@
+{
+  "node-name": "node-a-f",
+  "read-only": false,
+  "cache": {
+    "direct": false,
+    "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"
+  },
+  "backing": "node-b-f"
+}
+{
+  "node-name": "node-b-f",
+  "read-only": true,
+  "cache": {
+    "direct": false,
+    "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"
+  },
+  "backing": "node-c-f"
+}
+{
+  "node-name": "node-c-f",
+  "read-only": true,
+  "cache": {
+    "direct": false,
+    "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"
+  },
+  "backing": "node-d-f"
+}
+{
+  "node-name": "node-d-f",
+  "read-only": true,
+  "cache": {
+    "direct": false,
+    "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"
+  }
+}
diff --git a/tests/qemublocktestdata/xml2json/file-backing_basic-cache-unsafe.xml b/tests/qemublocktestdata/xml2json/file-backing_basic-cache-unsafe.xml
new file mode 100644
index 0000000000..e18d33ce3c
--- /dev/null
+++ b/tests/qemublocktestdata/xml2json/file-backing_basic-cache-unsafe.xml
@@ -0,0 +1,47 @@
+<disk type='file' device='disk'>
+  <driver name='qemu' type='qcow2' cache='unsafe'/>
+  <source file='/var/lib/libvirt/images/a'>
+    <privateData>
+      <nodenames>
+        <nodename type='storage' name='node-a-s'/>
+        <nodename type='format' name='node-a-f'/>
+      </nodenames>
+    </privateData>
+  </source>
+  <backingStore type='file' index='1'>
+    <format type='qcow2'/>
+    <source file='/var/lib/libvirt/images/b'>
+      <privateData>
+        <nodenames>
+          <nodename type='storage' name='node-b-s'/>
+          <nodename type='format' name='node-b-f'/>
+        </nodenames>
+      </privateData>
+    </source>
+    <backingStore type='network' index='2'>
+      <format type='qcow2'/>
+      <source protocol='gluster' name='images/c'>
+        <host name='test.org'/>
+        <privateData>
+          <nodenames>
+            <nodename type='storage' name='node-c-s'/>
+            <nodename type='format' name='node-c-f'/>
+          </nodenames>
+        </privateData>
+      </source>
+      <backingStore type='file' index='3'>
+        <format type='raw'/>
+        <source file='/var/lib/libvirt/images/d'>
+          <privateData>
+            <nodenames>
+              <nodename type='storage' name='node-d-s'/>
+              <nodename type='format' name='node-d-f'/>
+            </nodenames>
+          </privateData>
+        </source>
+        <backingStore/>
+      </backingStore>
+    </backingStore>
+  </backingStore>
+  <target dev='vda'/>
+</disk>
diff --git a/tests/qemublocktestdata/xml2json/file-backing_basic-cache-writeback.json b/tests/qemublocktestdata/xml2json/file-backing_basic-cache-writeback.json
new file mode 100644
index 0000000000..9dc7d38850
--- /dev/null
+++ b/tests/qemublocktestdata/xml2json/file-backing_basic-cache-writeback.json
@@ -0,0 +1,91 @@
+{
+  "node-name": "node-a-f",
+  "read-only": false,
+  "cache": {
+    "direct": false,
+    "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"
+  },
+  "backing": "node-b-f"
+}
+{
+  "node-name": "node-b-f",
+  "read-only": true,
+  "cache": {
+    "direct": false,
+    "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"
+  },
+  "backing": "node-c-f"
+}
+{
+  "node-name": "node-c-f",
+  "read-only": true,
+  "cache": {
+    "direct": false,
+    "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"
+  },
+  "backing": "node-d-f"
+}
+{
+  "node-name": "node-d-f",
+  "read-only": true,
+  "cache": {
+    "direct": false,
+    "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"
+  }
+}
diff --git a/tests/qemublocktestdata/xml2json/file-backing_basic-cache-writeback.xml b/tests/qemublocktestdata/xml2json/file-backing_basic-cache-writeback.xml
new file mode 100644
index 0000000000..7040388040
--- /dev/null
+++ b/tests/qemublocktestdata/xml2json/file-backing_basic-cache-writeback.xml
@@ -0,0 +1,47 @@
+<disk type='file' device='disk'>
+  <driver name='qemu' type='qcow2' cache='writeback'/>
+  <source file='/var/lib/libvirt/images/a'>
+    <privateData>
+      <nodenames>
+        <nodename type='storage' name='node-a-s'/>
+        <nodename type='format' name='node-a-f'/>
+      </nodenames>
+    </privateData>
+  </source>
+  <backingStore type='file' index='1'>
+    <format type='qcow2'/>
+    <source file='/var/lib/libvirt/images/b'>
+      <privateData>
+        <nodenames>
+          <nodename type='storage' name='node-b-s'/>
+          <nodename type='format' name='node-b-f'/>
+        </nodenames>
+      </privateData>
+    </source>
+    <backingStore type='network' index='2'>
+      <format type='qcow2'/>
+      <source protocol='gluster' name='images/c'>
+        <host name='test.org'/>
+        <privateData>
+          <nodenames>
+            <nodename type='storage' name='node-c-s'/>
+            <nodename type='format' name='node-c-f'/>
+          </nodenames>
+        </privateData>
+      </source>
+      <backingStore type='file' index='3'>
+        <format type='raw'/>
+        <source file='/var/lib/libvirt/images/d'>
+          <privateData>
+            <nodenames>
+              <nodename type='storage' name='node-d-s'/>
+              <nodename type='format' name='node-d-f'/>
+            </nodenames>
+          </privateData>
+        </source>
+        <backingStore/>
+      </backingStore>
+    </backingStore>
+  </backingStore>
+  <target dev='vda'/>
+</disk>
diff --git a/tests/qemublocktestdata/xml2json/file-backing_basic-cache-writethrough.json b/tests/qemublocktestdata/xml2json/file-backing_basic-cache-writethrough.json
new file mode 100644
index 0000000000..9dc7d38850
--- /dev/null
+++ b/tests/qemublocktestdata/xml2json/file-backing_basic-cache-writethrough.json
@@ -0,0 +1,91 @@
+{
+  "node-name": "node-a-f",
+  "read-only": false,
+  "cache": {
+    "direct": false,
+    "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"
+  },
+  "backing": "node-b-f"
+}
+{
+  "node-name": "node-b-f",
+  "read-only": true,
+  "cache": {
+    "direct": false,
+    "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"
+  },
+  "backing": "node-c-f"
+}
+{
+  "node-name": "node-c-f",
+  "read-only": true,
+  "cache": {
+    "direct": false,
+    "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"
+  },
+  "backing": "node-d-f"
+}
+{
+  "node-name": "node-d-f",
+  "read-only": true,
+  "cache": {
+    "direct": false,
+    "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"
+  }
+}
diff --git a/tests/qemublocktestdata/xml2json/file-backing_basic-cache-writethrough.xml b/tests/qemublocktestdata/xml2json/file-backing_basic-cache-writethrough.xml
new file mode 100644
index 0000000000..d2fe1b780b
--- /dev/null
+++ b/tests/qemublocktestdata/xml2json/file-backing_basic-cache-writethrough.xml
@@ -0,0 +1,47 @@
+<disk type='file' device='disk'>
+  <driver name='qemu' type='qcow2' cache='writethrough'/>
+  <source file='/var/lib/libvirt/images/a'>
+    <privateData>
+      <nodenames>
+        <nodename type='storage' name='node-a-s'/>
+        <nodename type='format' name='node-a-f'/>
+      </nodenames>
+    </privateData>
+  </source>
+  <backingStore type='file' index='1'>
+    <format type='qcow2'/>
+    <source file='/var/lib/libvirt/images/b'>
+      <privateData>
+        <nodenames>
+          <nodename type='storage' name='node-b-s'/>
+          <nodename type='format' name='node-b-f'/>
+        </nodenames>
+      </privateData>
+    </source>
+    <backingStore type='network' index='2'>
+      <format type='qcow2'/>
+      <source protocol='gluster' name='images/c'>
+        <host name='test.org'/>
+        <privateData>
+          <nodenames>
+            <nodename type='storage' name='node-c-s'/>
+            <nodename type='format' name='node-c-f'/>
+          </nodenames>
+        </privateData>
+      </source>
+      <backingStore type='file' index='3'>
+        <format type='raw'/>
+        <source file='/var/lib/libvirt/images/d'>
+          <privateData>
+            <nodenames>
+              <nodename type='storage' name='node-d-s'/>
+              <nodename type='format' name='node-d-f'/>
+            </nodenames>
+          </privateData>
+        </source>
+        <backingStore/>
+      </backingStore>
+    </backingStore>
+  </backingStore>
+  <target dev='vda'/>
+</disk>
diff --git a/tests/qemublocktestdata/xml2json/network-qcow2-backing-chain-cache-unsafe.json b/tests/qemublocktestdata/xml2json/network-qcow2-backing-chain-cache-unsafe.json
new file mode 100644
index 0000000000..de4be359cb
--- /dev/null
+++ b/tests/qemublocktestdata/xml2json/network-qcow2-backing-chain-cache-unsafe.json
@@ -0,0 +1,57 @@
+{
+  "node-name": "node-b-f",
+  "read-only": false,
+  "cache": {
+    "direct": true,
+    "no-flush": false
+  },
+  "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": true,
+      "no-flush": false
+    },
+    "read-only": false,
+    "discard": "unmap"
+  },
+  "backing": "node-b-f"
+}
+{
+  "node-name": "node-b-f",
+  "read-only": true,
+  "cache": {
+    "direct": true,
+    "no-flush": false
+  },
+  "driver": "qcow2",
+  "file": {
+    "driver": "iscsi",
+    "portal": "example.org:3260",
+    "target": "iscsitarget",
+    "lun": 1,
+    "transport": "tcp",
+    "node-name": "node-b-s",
+    "cache": {
+      "direct": true,
+      "no-flush": false
+    },
+    "read-only": true,
+    "discard": "unmap"
+  },
+  "backing": null
+}
diff --git a/tests/qemublocktestdata/xml2json/network-qcow2-backing-chain-cache-unsafe.xml b/tests/qemublocktestdata/xml2json/network-qcow2-backing-chain-cache-unsafe.xml
new file mode 100644
index 0000000000..b4ba7470af
--- /dev/null
+++ b/tests/qemublocktestdata/xml2json/network-qcow2-backing-chain-cache-unsafe.xml
@@ -0,0 +1,31 @@
+<disk type='network' device='disk'>
+  <driver name='qemu' type='qcow2' cache='directsync'/>
+  <source protocol='rbd' name='rbdpool/rbdimg'>
+    <host name='host1.example.com'/>
+    <host name='host2.example.com'/>
+    <auth username='testuser-rbd'>
+      <secret type='ceph' usage='testuser-rbd-secret'/>
+    </auth>
+    <privateData>
+      <nodenames>
+        <nodename type='storage' name='node-a-s'/>
+        <nodename type='format' name='node-b-f'/>
+      </nodenames>
+    </privateData>
+  </source>
+  <backingStore type='network' index='1'>
+    <format type='qcow2'/>
+    <source protocol='iscsi' name='iscsitarget/1'>
+      <host name='example.org'/>
+      <privateData>
+        <nodenames>
+          <nodename type='storage' name='node-b-s'/>
+          <nodename type='format' name='node-b-f'/>
+        </nodenames>
+      </privateData>
+    </source>
+    <backingStore/>
+  </backingStore>
+  <target dev='vda' bus='virtio'/>
+  <alias name='virtio-disk0'/>
+</disk>
-- 
2.16.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux