mirror of https://gitee.com/openkylin/libvirt.git
tests: qemublock: Add cases for creating image overlays on top of disks with <slice>
Add a set of test data to see whether the backing store strings are formatted reasonably. Note that we don't support direct creation of such images so those tests are not enabled. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
73ca201467
commit
9b804ef5ef
|
@ -1064,6 +1064,8 @@ mymain(void)
|
|||
TEST_IMAGE_CREATE("qcow2-backing-raw-nbd", "raw-nbd");
|
||||
TEST_IMAGE_CREATE("qcow2-backing-luks", "luks-noopts");
|
||||
TEST_IMAGE_CREATE("qcow2-luks-encopts-backing", "qcow2");
|
||||
TEST_IMAGE_CREATE("qcow2-backing-raw-slice", "raw-slice");
|
||||
TEST_IMAGE_CREATE("qcow2-backing-qcow2-slice", "qcow2-slice");
|
||||
|
||||
TEST_IMAGE_CREATE("network-gluster-qcow2", NULL);
|
||||
TEST_IMAGE_CREATE("network-rbd-qcow2", NULL);
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
protocol:
|
||||
{
|
||||
"driver": "file",
|
||||
"filename": "/var/lib/libvirt/images/i.qcow2",
|
||||
"size": 4294967296
|
||||
}
|
||||
|
||||
format:
|
||||
{
|
||||
"driver": "qcow2",
|
||||
"file": "0123456789ABCDEF0123456789ABCDE",
|
||||
"size": 8589934590,
|
||||
"backing-file": "json:{\"driver\":\"raw\",\"offset\":1234,\"size\":5768,\"file\":{\"driver\":\"file\",\"filename\":\"/var/lib/libvirt/images/i.qcow2\"}}",
|
||||
"backing-fmt": "qcow2"
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
qcow2.xml
|
|
@ -0,0 +1,15 @@
|
|||
protocol:
|
||||
{
|
||||
"driver": "file",
|
||||
"filename": "/var/lib/libvirt/images/i.qcow2",
|
||||
"size": 4294967296
|
||||
}
|
||||
|
||||
format:
|
||||
{
|
||||
"driver": "qcow2",
|
||||
"file": "0123456789ABCDEF0123456789ABCDE",
|
||||
"size": 8589934590,
|
||||
"backing-file": "json:{\"driver\":\"raw\",\"offset\":9876,\"size\":54321,\"file\":{\"driver\":\"file\",\"filename\":\"/var/lib/libvirt/images/i.img\"}}",
|
||||
"backing-fmt": "raw"
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
qcow2.xml
|
|
@ -0,0 +1,14 @@
|
|||
<disk device='disk' name='vda'>
|
||||
<driver type='qcow2'/>
|
||||
<source file='/var/lib/libvirt/images/i.qcow2'>
|
||||
<slices>
|
||||
<slice type='storage' offset='1234' size='5768'/>
|
||||
</slices>
|
||||
<privateData>
|
||||
<nodenames>
|
||||
<nodename type='storage' name='0123456789ABCDEF0123456789ABCDE'/>
|
||||
<nodename type='format' name='0123456789ABCDEF0123456789ABCDE'/>
|
||||
</nodenames>
|
||||
</privateData>
|
||||
</source>
|
||||
</disk>
|
|
@ -0,0 +1,14 @@
|
|||
<disk device='disk' name='vda'>
|
||||
<driver type='raw'/>
|
||||
<source file='/var/lib/libvirt/images/i.img'>
|
||||
<slices>
|
||||
<slice type='storage' offset='9876' size='54321'/>
|
||||
</slices>
|
||||
<privateData>
|
||||
<nodenames>
|
||||
<nodename type='storage' name='0123456789ABCDEF0123456789ABCDE'/>
|
||||
<nodename type='format' name='0123456789ABCDEF0123456789ABCDE'/>
|
||||
</nodenames>
|
||||
</privateData>
|
||||
</source>
|
||||
</disk>
|
Loading…
Reference in New Issue