summaryrefslogtreecommitdiff
path: root/tests/storagevolxml2xmlout
diff options
context:
space:
mode:
authorPavel Hrdina <phrdina@redhat.com>2021-05-12 17:43:36 +0200
committerPavel Hrdina <phrdina@redhat.com>2021-05-21 14:00:43 +0200
commit3e1d2c93a3edce65ce8cb589edb07e2f830c9c12 (patch)
tree7fd29c1350b19f2916b3345755f77ce77c64f551 /tests/storagevolxml2xmlout
parent19967f64f4b94ac24b7560d6e7f9c96d935e33c4 (diff)
downloadlibvirt-3e1d2c93a3edce65ce8cb589edb07e2f830c9c12.tar.gz
storage: add support for QCOW2 cluster_size option
The default value hard-coded in QEMU (64KiB) is not always the ideal. Having a possibility to set the cluster_size by user may in specific use-cases improve performance for QCOW2 images. QEMU internally has some limits, the value has to be between 512B and 2048KiB and must by power of two, except when the image has Extended L2 Entries the minimal value has to be 16KiB. Since qemu-img ensures the value is correct and the limit is not always the same libvirt will not duplicate any of these checks as the error message from qemu-img is good enough: Cluster size must be a power of two between 512 and 2048k Resolves: https://gitlab.com/libvirt/libvirt/-/issues/154 Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Diffstat (limited to 'tests/storagevolxml2xmlout')
-rw-r--r--tests/storagevolxml2xmlout/vol-qcow2-clusterSize.xml17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/storagevolxml2xmlout/vol-qcow2-clusterSize.xml b/tests/storagevolxml2xmlout/vol-qcow2-clusterSize.xml
new file mode 100644
index 0000000000..393a492536
--- /dev/null
+++ b/tests/storagevolxml2xmlout/vol-qcow2-clusterSize.xml
@@ -0,0 +1,17 @@
+<volume type='file'>
+ <name>OtherDemo.img</name>
+ <key>/var/lib/libvirt/images/OtherDemo.img</key>
+ <capacity unit='bytes'>5368709120</capacity>
+ <allocation unit='bytes'>294912</allocation>
+ <target>
+ <path>/var/lib/libvirt/images/OtherDemo.img</path>
+ <format type='qcow2'/>
+ <permissions>
+ <mode>0644</mode>
+ <owner>0</owner>
+ <group>0</group>
+ <label>unconfined_u:object_r:virt_image_t:s0</label>
+ </permissions>
+ <clusterSize unit='B'>131072</clusterSize>
+ </target>
+</volume>