tests: qemublock: Add test-case for the 'vvfat' driver in qemu

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

dir-fat-floppy.xml
-drive file=fat:floppy:/var/somefiles,if=none,id=drive-dummy,readonly=on

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
Peter Krempa 2018-03-19 08:00:19 +01:00
parent b54af513d6
commit 7e441e2e2c
5 changed files with 57 additions and 0 deletions

View File

@ -415,6 +415,8 @@ mymain(void)
TEST_DISK_TO_JSON("file-vpc-noopts"); TEST_DISK_TO_JSON("file-vpc-noopts");
TEST_DISK_TO_JSON("file-backing_basic-noopts"); TEST_DISK_TO_JSON("file-backing_basic-noopts");
TEST_DISK_TO_JSON("dir-fat-readonly");
TEST_DISK_TO_JSON("dir-fat-floppy");
cleanup: cleanup:
virHashFree(diskxmljsondata.schema); virHashFree(diskxmljsondata.schema);

View File

@ -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"
}
}

View File

@ -0,0 +1,14 @@
<disk type='dir' device='floppy'>
<driver name='qemu' type='fat'/>
<source dir='/var/somefiles'>
<privateData>
<nodenames>
<nodename type='storage' name='node-s'/>
<nodename type='format' name='node-f'/>
</nodenames>
</privateData>
</source>
<target dev='fda'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
<readonly/>
</disk>

View File

@ -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"
}
}

View File

@ -0,0 +1,13 @@
<disk type='dir' device='disk'>
<driver name='qemu' type='fat'/>
<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>