tests: qemublock: Add tests for basic backing chain formats

Formats supporting backing chain such as qed, vmdk, don't have any other
parameters than the backing store and 'qcow' has only encryption params
which will be tested extra. Add this test case so they are covered since
any further test cases will mainly care about 'qcow2' and 'raw'.

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

-drive file=/var/lib/libvirt/images/a,format=qed,if=none,id=drive-dummy
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
Peter Krempa 2018-03-28 10:27:14 +02:00
parent c4f0e16f5a
commit b54af513d6
3 changed files with 99 additions and 0 deletions

View File

@ -414,6 +414,8 @@ mymain(void)
TEST_DISK_TO_JSON("file-vhd-noopts");
TEST_DISK_TO_JSON("file-vpc-noopts");
TEST_DISK_TO_JSON("file-backing_basic-noopts");
cleanup:
virHashFree(diskxmljsondata.schema);
qemuTestDriverFree(&driver);

View File

@ -0,0 +1,51 @@
{
"node-name": "node-a-f",
"read-only": false,
"driver": "qed",
"file": {
"driver": "file",
"filename": "/var/lib/libvirt/images/a",
"node-name": "node-a-s",
"read-only": false,
"discard": "unmap"
},
"backing": "node-b-f"
}
{
"node-name": "node-b-f",
"read-only": true,
"driver": "qcow",
"file": {
"driver": "file",
"filename": "/var/lib/libvirt/images/b",
"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": "file",
"filename": "/var/lib/libvirt/images/c",
"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",
"node-name": "node-d-s",
"read-only": true,
"discard": "unmap"
}
}

View File

@ -0,0 +1,46 @@
<disk type='file' device='disk'>
<driver name='qemu' type='qed'/>
<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='qcow'/>
<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='file' index='2'>
<format type='vmdk'/>
<source file='/var/lib/libvirt/images/c'>
<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>