Test mapping of the 'FAT' disk format to 'vvfat' in qemu.
The top level disk image would generate the following '-drive' cmdline:
dir-fat-readonly.xml:
-drive file=fat:/var/somefiles,if=none,id=drive-dummy,readonly=on
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
tests/qemublocktest.c | 2 ++
tests/qemublocktestdata/xml2json/dir-fat-floppy.json | 14 ++++++++++++++
tests/qemublocktestdata/xml2json/dir-fat-floppy.xml | 11 +++++++++++
tests/qemublocktestdata/xml2json/dir-fat-readonly.json | 14 ++++++++++++++
tests/qemublocktestdata/xml2json/dir-fat-readonly.xml | 10 ++++++++++
5 files changed, 51 insertions(+)
create mode 100644 tests/qemublocktestdata/xml2json/dir-fat-floppy.json
create mode 100644 tests/qemublocktestdata/xml2json/dir-fat-floppy.xml
create mode 100644 tests/qemublocktestdata/xml2json/dir-fat-readonly.json
create mode 100644 tests/qemublocktestdata/xml2json/dir-fat-readonly.xml
diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c
index 881d7c17ee..81a2261dab 100644
--- a/tests/qemublocktest.c
+++ b/tests/qemublocktest.c
@@ -414,6 +414,8 @@ mymain(void)
TEST_DISK_TO_JSON("file-vpc-noopts");
TEST_DISK_TO_JSON("file-backing_basic-noopts");
+ TEST_DISK_TO_JSON("dir-fat-readonly");
+ TEST_DISK_TO_JSON("dir-fat-floppy");
cleanup:
virHashFree(diskxmljsondata.schema);
diff --git a/tests/qemublocktestdata/xml2json/dir-fat-floppy.json
b/tests/qemublocktestdata/xml2json/dir-fat-floppy.json
new file mode 100644
index 0000000000..9685acaa8b
--- /dev/null
+++ b/tests/qemublocktestdata/xml2json/dir-fat-floppy.json
@@ -0,0 +1,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"
+ }
+}
diff --git a/tests/qemublocktestdata/xml2json/dir-fat-floppy.xml
b/tests/qemublocktestdata/xml2json/dir-fat-floppy.xml
new file mode 100644
index 0000000000..b7f2d9f8a6
--- /dev/null
+++ b/tests/qemublocktestdata/xml2json/dir-fat-floppy.xml
@@ -0,0 +1,11 @@
+<disk type='dir' device='floppy'>
+ <driver name='qemu' type='fat'/>
+ <source dir='/var/somefiles'>
+ <privateData>
+ <nodename storage='node-s' format='node-f'/>
+ </privateData>
+ </source>
+ <target dev='fda'/>
+ <address type='drive' controller='0' bus='0'
target='0' unit='0'/>
+ <readonly/>
+</disk>
diff --git a/tests/qemublocktestdata/xml2json/dir-fat-readonly.json
b/tests/qemublocktestdata/xml2json/dir-fat-readonly.json
new file mode 100644
index 0000000000..7d35d255cc
--- /dev/null
+++ b/tests/qemublocktestdata/xml2json/dir-fat-readonly.json
@@ -0,0 +1,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"
+ }
+}
diff --git a/tests/qemublocktestdata/xml2json/dir-fat-readonly.xml
b/tests/qemublocktestdata/xml2json/dir-fat-readonly.xml
new file mode 100644
index 0000000000..bdb291e412
--- /dev/null
+++ b/tests/qemublocktestdata/xml2json/dir-fat-readonly.xml
@@ -0,0 +1,10 @@
+<disk type='dir' device='disk'>
+ <driver name='qemu' type='fat'/>
+ <source dir='/var/somefiles'>
+ <privateData>
+ <nodename storage='node-s' format='node-f'/>
+ </privateData>
+ </source>
+ <target dev='vda'/>
+ <readonly/>
+</disk>
--
2.14.3