On 04/25/2018 11:15 AM, Peter Krempa wrote:
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
I'm glad someone knows the rules around here - guess we won't really
know how right things are until testing gets ahold of this. Again
nothing "basic" about these things - I'm really glad none of the were
named complex or in-too-deep ;-)
[...]
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'/>
^^^
this was supposed to be 'unsafe' wasn't it?
+ <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>
With I think a minor adjustment to use 'unsafe'... and updated output...
Reviewed-by: John Ferlan <jferlan(a)redhat.com>
John