storage: Upgrade default qcow2 verion to 1.1

Change the default to modern qcow2 as it's supported by all qemu
versions supported by libvirt and in fact 'qemu-img' already defaults to
the new format for a long time.

Some Unittests require changes to pass, now that version 1.1 is default.
Unittests like `qcow2-1.1.argv` may not be relevant anymore, but this
patch doesn't affect them.

Closes: https://gitlab.com/libvirt/libvirt/-/issues/602
Signed-off-by: Abhiram Tilak <atp.exp@gmail.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Abhiram Tilak 2024-03-06 01:20:13 +05:30 committed by Peter Krempa
parent 47a8f6a99b
commit f432114d9c
13 changed files with 13 additions and 13 deletions

View File

@ -765,7 +765,7 @@ storageBackendCreateQemuImgOpts(virStorageEncryptionInfoDef *encinfo,
if (info->compat) if (info->compat)
virBufferAsprintf(&buf, "compat=%s,", info->compat); virBufferAsprintf(&buf, "compat=%s,", info->compat);
else if (info->format == VIR_STORAGE_FILE_QCOW2) else if (info->format == VIR_STORAGE_FILE_QCOW2)
virBufferAddLit(&buf, "compat=0.10,"); virBufferAddLit(&buf, "compat=1.1,");
if (info->clusterSize > 0) if (info->clusterSize > 0)
virBufferAsprintf(&buf, "cluster_size=%llu,", info->clusterSize); virBufferAsprintf(&buf, "cluster_size=%llu,", info->clusterSize);

View File

@ -1,7 +1,7 @@
qemu-img \ qemu-img \
create \ create \
-f qcow2 \ -f qcow2 \
-o compat=0.10 \ -o compat=1.1 \
/var/lib/libvirt/images/sparse-qcow2.img \ /var/lib/libvirt/images/sparse-qcow2.img \
1073741824K 1073741824K
qemu-img \ qemu-img \

View File

@ -2,6 +2,6 @@ qemu-img \
create \ create \
-f qcow2 \ -f qcow2 \
-b /dev/null \ -b /dev/null \
-o backing_fmt=raw,compat=0.10 \ -o backing_fmt=raw,compat=1.1 \
/var/lib/libvirt/images/OtherDemo.img \ /var/lib/libvirt/images/OtherDemo.img \
5242880K 5242880K

View File

@ -2,6 +2,6 @@ qemu-img \
convert \ convert \
-f raw \ -f raw \
-O qcow2 \ -O qcow2 \
-o compat=0.10 \ -o compat=1.1 \
/dev/HostVG/Swap \ /dev/HostVG/Swap \
/var/lib/libvirt/images/OtherDemo.img /var/lib/libvirt/images/OtherDemo.img

View File

@ -2,7 +2,7 @@ qemu-img \
create \ create \
-f qcow2 \ -f qcow2 \
--object secret,id=OtherDemoLuks.img_encrypt0,file=/path/to/secretFile \ --object secret,id=OtherDemoLuks.img_encrypt0,file=/path/to/secretFile \
-o encrypt.format=luks,encrypt.key-secret=OtherDemoLuks.img_encrypt0,compat=0.10 \ -o encrypt.format=luks,encrypt.key-secret=OtherDemoLuks.img_encrypt0,compat=1.1 \
/var/lib/libvirt/images/OtherDemoLuks.img \ /var/lib/libvirt/images/OtherDemoLuks.img \
5242880K 5242880K
qemu-img \ qemu-img \

View File

@ -1,7 +1,7 @@
qemu-img \ qemu-img \
create \ create \
-f qcow2 \ -f qcow2 \
-o compat=0.10 \ -o compat=1.1 \
/var/lib/libvirt/images/sparse-qcow2.img \ /var/lib/libvirt/images/sparse-qcow2.img \
1073741824K 1073741824K
qemu-img \ qemu-img \

View File

@ -3,6 +3,6 @@ create \
-f qcow2 \ -f qcow2 \
-b /dev/null \ -b /dev/null \
--object secret,id=OtherDemoLuks.img_encrypt0,file=/path/to/secretFile \ --object secret,id=OtherDemoLuks.img_encrypt0,file=/path/to/secretFile \
-o backing_fmt=raw,encrypt.format=luks,encrypt.key-secret=OtherDemoLuks.img_encrypt0,compat=0.10 \ -o backing_fmt=raw,encrypt.format=luks,encrypt.key-secret=OtherDemoLuks.img_encrypt0,compat=1.1 \
/var/lib/libvirt/images/OtherDemoLuks.img \ /var/lib/libvirt/images/OtherDemoLuks.img \
5242880K 5242880K

View File

@ -2,6 +2,6 @@ qemu-img \
convert \ convert \
-f raw \ -f raw \
-O qcow2 \ -O qcow2 \
-o preallocation=metadata,compat=0.10 \ -o preallocation=metadata,compat=1.1 \
/var/lib/libvirt/images/sparse.img \ /var/lib/libvirt/images/sparse.img \
/var/lib/libvirt/images/OtherDemo.img /var/lib/libvirt/images/OtherDemo.img

View File

@ -1,6 +1,6 @@
qemu-img \ qemu-img \
create \ create \
-f qcow2 \ -f qcow2 \
-o preallocation=metadata,compat=0.10 \ -o preallocation=metadata,compat=1.1 \
/var/lib/libvirt/images/OtherDemo.img \ /var/lib/libvirt/images/OtherDemo.img \
5242880K 5242880K

View File

@ -2,6 +2,6 @@ qemu-img \
convert \ convert \
-f raw \ -f raw \
-O qcow2 \ -O qcow2 \
-o preallocation=falloc,compat=0.10 \ -o preallocation=falloc,compat=1.1 \
/var/lib/libvirt/images/sparse.img \ /var/lib/libvirt/images/sparse.img \
/var/lib/libvirt/images/OtherDemo.img /var/lib/libvirt/images/OtherDemo.img

View File

@ -2,5 +2,5 @@ qemu-img \
create \ create \
-f qcow2 \ -f qcow2 \
-b /dev/null \ -b /dev/null \
-o backing_fmt=raw,compat=0.10 \ -o backing_fmt=raw,compat=1.1 \
/var/lib/libvirt/images/OtherDemo.img /var/lib/libvirt/images/OtherDemo.img

View File

@ -2,6 +2,6 @@ qemu-img \
create \ create \
-f qcow2 \ -f qcow2 \
-b /dev/null \ -b /dev/null \
-o backing_fmt=raw,nocow=on,compat=0.10 \ -o backing_fmt=raw,nocow=on,compat=1.1 \
/var/lib/libvirt/images/OtherDemo.img \ /var/lib/libvirt/images/OtherDemo.img \
5242880K 5242880K

View File

@ -1,6 +1,6 @@
qemu-img \ qemu-img \
create \ create \
-f qcow2 \ -f qcow2 \
-o compat=0.10 \ -o compat=1.1 \
/var/lib/libvirt/images/OtherDemo.img \ /var/lib/libvirt/images/OtherDemo.img \
0K 0K