提交 ac71f4e6 编写于 作者: P Peter Krempa

tests: qemublock: Add test cases for 'aio' options of 'file' storage

Test that the 'aio' option is applied correctly for the 'file' protocol
backend and across the backing chain.

The top level disk image would generate the following '-drive' cmdline:

file-backing_basic-aio_threads:
-drive file=/var/lib/libvirt/images/a,format=qcow,if=none,id=drive-dummy,aio=threads
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy

file-raw-aio_native:
-drive file=/path/to/i.img,format=raw,if=none,id=drive-dummy,cache=none,aio=native
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy,write-cache=on
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
上级 7e441e2e
...@@ -417,6 +417,8 @@ mymain(void) ...@@ -417,6 +417,8 @@ mymain(void)
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-readonly");
TEST_DISK_TO_JSON("dir-fat-floppy"); TEST_DISK_TO_JSON("dir-fat-floppy");
TEST_DISK_TO_JSON("file-raw-aio_native");
TEST_DISK_TO_JSON("file-backing_basic-aio_threads");
cleanup: cleanup:
virHashFree(diskxmljsondata.schema); virHashFree(diskxmljsondata.schema);
......
{
"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"
},
"backing": "node-b-f"
}
{
"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"
},
"backing": "node-c-f"
}
{
"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"
},
"backing": "node-d-f"
}
{
"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"
}
}
<disk type='file' device='disk'>
<driver name='qemu' type='qcow' io='threads'/>
<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='qed'/>
<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='vmdk'/>
<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>
{
"node-name": "test1",
"read-only": false,
"cache": {
"direct": true,
"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"
}
}
<disk device='disk'>
<driver name='qemu' type='raw' io='native' cache='none'/>
<source file='/path/to/i.img'>
<privateData>
<nodenames>
<nodename type='storage' name='test2'/>
<nodename type='format' name='test1'/>
</nodenames>
</privateData>
</source>
<target dev='vda'/>
</disk>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册