]> xenbits.xensource.com Git - libvirt.git/commitdiff
schema: Allow '0' offset for a <slice> of <disk>
authorPeter Krempa <pkrempa@redhat.com>
Fri, 21 May 2021 12:53:43 +0000 (14:53 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 24 May 2021 18:26:20 +0000 (20:26 +0200)
Using slice to cut off the end of the image is a perfectly vaid
configuration. Use 'unsignedInt' instead of 'positiveInteger' for the
'offset' attribute in the XML schema and modify one test case to cover
this use case.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1960993
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
docs/schemas/domaincommon.rng
tests/qemuxml2argvdata/disk-slices.x86_64-latest.args
tests/qemuxml2argvdata/disk-slices.xml
tests/qemuxml2xmloutdata/disk-slices.x86_64-latest.xml

index 16e1c549c242ce3b871170d193125b23ee7ef9f2..66a581c5140bb37cca1dc8954ef00333cee00d94 100644 (file)
 
   <define name="diskSourceSlice">
     <attribute name="offset">
-      <ref name="positiveInteger"/>
+      <ref name="unsignedInt"/>
     </attribute>
     <attribute name="size">
       <ref name="positiveInteger"/>
index d337ea91a79a394708a0a41aa6a2e16a635e09bb..f41bbeea0947099cd014e5c4e1fc43d640d96707 100644 (file)
@@ -28,7 +28,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
 -boot strict=on \
 -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
 -blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/raw.img","node-name":"libvirt-6-storage","auto-read-only":true,"discard":"unmap"}' \
--blockdev '{"node-name":"libvirt-6-format","read-only":false,"driver":"raw","offset":1234,"size":321,"file":"libvirt-6-storage"}' \
+-blockdev '{"node-name":"libvirt-6-format","read-only":false,"driver":"raw","offset":0,"size":321,"file":"libvirt-6-storage"}' \
 -device virtio-blk-pci,bus=pci.0,addr=0x2,drive=libvirt-6-format,id=virtio-disk0,bootindex=1 \
 -blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/raw.img","node-name":"libvirt-5-storage","auto-read-only":true,"discard":"unmap"}' \
 -blockdev '{"driver":"raw","node-name":"libvirt-5-slice-sto","offset":9876,"size":123456789,"file":"libvirt-5-storage","auto-read-only":true,"discard":"unmap"}' \
index 1675766a4675aa065dce438e9640a55d88522527..016aa1b905343f005273a6973630b20a1dc8fc71 100644 (file)
@@ -18,7 +18,7 @@
       <driver name='qemu' type='raw'/>
       <source file='/var/lib/libvirt/images/raw.img'>
         <slices>
-          <slice type='storage' offset='1234' size='321'/>
+          <slice type='storage' offset='0' size='321'/>
         </slices>
       </source>
       <backingStore/>
index 5c200ad31cf805fe4d05032e03d44d00198b38be..be5cd2508434967fc317d68fba9b3a2f7992d770 100644 (file)
@@ -21,7 +21,7 @@
       <driver name='qemu' type='raw'/>
       <source file='/var/lib/libvirt/images/raw.img'>
         <slices>
-          <slice type='storage' offset='1234' size='321'/>
+          <slice type='storage' offset='0' size='321'/>
         </slices>
       </source>
       <backingStore/>