[GSOC] Handshake
by Mostafa ali
Hello lovely people, hope you are all well!
I'm looking to contribute to libvirt during the upcoming GSOC 2024,
specifically to the XML fuzzing idea.
Little about me: I'm a recent graduate of Cairo University, Department of
Computer Engineering. I'm extremely interested in all things involving
programming languages, compilers, interpreters or metaprogramming and
systems programming in general. I'm currently teaching part-time at my
university.
After reading your GSOC FAQ and the 4 libvirt-specific requirements listed,
I have compiled libvirt on my machine and the tests do seem to have run
successfully if ninja's terminal logging is to be trusted. After
(obviously!) subscribing to your development list, it now remains to have
an upstream contribution and the interview.
1- Regarding the interview, the FAQ says it will probably be conducted over
IRC. I haven't used IRC before, currently reading up on how to use it. Any
specific advice/irc client/guide regarding that ? Also, will the
interview be conducted before the acceptance of the contribution or after
it ?
2- Regarding the required contribution, I see here
https://gitlab.com/libvirt/libvirt/-/issues?label_name=bitesizedtask 2
issues that look interesting, the one about converting the json parsing
library and another about switching the code to use Glib's autofree instead
of malloc and free. The json one looks more interesting (and difficult!)
but it looks like it was already assigned to someone else (and also that
it's a whole other GSOC project ?). So is the autofree one suitable as a
good first issue for me?
That's all. Sorry for any inconvenience and many thanks for your time.
Regards,
Mostafa
9 months, 3 weeks
[PATCH v2] storage: Upgrade default qcow2 version
by Abhiram Tilak
Change the default to modern qcow2 as it's supported by all qemu
versions supported by libvirt and `qemu-img` already defaults to
the new format since QEMU 1.7.
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.
Signed-off-by: Abhiram Tilak <atp.exp(a)gmail.com>
Reviewed-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/storage/storage_util.c | 2 +-
.../storagevolxml2argvdata/luks-convert-encrypt2fileqcow2.argv | 2 +-
tests/storagevolxml2argvdata/qcow2-compat.argv | 2 +-
tests/storagevolxml2argvdata/qcow2-from-logical-compat.argv | 2 +-
tests/storagevolxml2argvdata/qcow2-luks-convert-encrypt.argv | 2 +-
.../qcow2-luks-convert-encrypt2fileqcow2.argv | 2 +-
tests/storagevolxml2argvdata/qcow2-luks.argv | 2 +-
.../qcow2-nobacking-convert-prealloc-compat.argv | 2 +-
.../storagevolxml2argvdata/qcow2-nobacking-prealloc-compat.argv | 2 +-
.../qcow2-nocapacity-convert-prealloc.argv | 2 +-
tests/storagevolxml2argvdata/qcow2-nocapacity.argv | 2 +-
tests/storagevolxml2argvdata/qcow2-nocow-compat.argv | 2 +-
tests/storagevolxml2argvdata/qcow2-zerocapacity.argv | 2 +-
13 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c
index 7bf815d978..28d5fce4f0 100644
--- a/src/storage/storage_util.c
+++ b/src/storage/storage_util.c
@@ -765,7 +765,7 @@ storageBackendCreateQemuImgOpts(virStorageEncryptionInfoDef *encinfo,
if (info->compat)
virBufferAsprintf(&buf, "compat=%s,", info->compat);
else if (info->format == VIR_STORAGE_FILE_QCOW2)
- virBufferAddLit(&buf, "compat=0.10,");
+ virBufferAddLit(&buf, "compat=1.1,");
if (info->clusterSize > 0)
virBufferAsprintf(&buf, "cluster_size=%llu,", info->clusterSize);
diff --git a/tests/storagevolxml2argvdata/luks-convert-encrypt2fileqcow2.argv b/tests/storagevolxml2argvdata/luks-convert-encrypt2fileqcow2.argv
index 4b9ccfe8dc..705604b162 100644
--- a/tests/storagevolxml2argvdata/luks-convert-encrypt2fileqcow2.argv
+++ b/tests/storagevolxml2argvdata/luks-convert-encrypt2fileqcow2.argv
@@ -1,7 +1,7 @@
qemu-img \
create \
-f qcow2 \
--o compat=0.10 \
+-o compat=1.1 \
/var/lib/libvirt/images/sparse-qcow2.img \
1073741824K
qemu-img \
diff --git a/tests/storagevolxml2argvdata/qcow2-compat.argv b/tests/storagevolxml2argvdata/qcow2-compat.argv
index bf3a50a7f3..40fbe065e0 100644
--- a/tests/storagevolxml2argvdata/qcow2-compat.argv
+++ b/tests/storagevolxml2argvdata/qcow2-compat.argv
@@ -2,6 +2,6 @@ qemu-img \
create \
-f qcow2 \
-b /dev/null \
--o backing_fmt=raw,compat=0.10 \
+-o backing_fmt=raw,compat=1.1 \
/var/lib/libvirt/images/OtherDemo.img \
5242880K
diff --git a/tests/storagevolxml2argvdata/qcow2-from-logical-compat.argv b/tests/storagevolxml2argvdata/qcow2-from-logical-compat.argv
index dbc7deb16a..b68da425d9 100644
--- a/tests/storagevolxml2argvdata/qcow2-from-logical-compat.argv
+++ b/tests/storagevolxml2argvdata/qcow2-from-logical-compat.argv
@@ -2,6 +2,6 @@ qemu-img \
convert \
-f raw \
-O qcow2 \
--o compat=0.10 \
+-o compat=1.1 \
/dev/HostVG/Swap \
/var/lib/libvirt/images/OtherDemo.img
diff --git a/tests/storagevolxml2argvdata/qcow2-luks-convert-encrypt.argv b/tests/storagevolxml2argvdata/qcow2-luks-convert-encrypt.argv
index d89622d4a6..3068b4b38d 100644
--- a/tests/storagevolxml2argvdata/qcow2-luks-convert-encrypt.argv
+++ b/tests/storagevolxml2argvdata/qcow2-luks-convert-encrypt.argv
@@ -2,7 +2,7 @@ qemu-img \
create \
-f qcow2 \
--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 \
5242880K
qemu-img \
diff --git a/tests/storagevolxml2argvdata/qcow2-luks-convert-encrypt2fileqcow2.argv b/tests/storagevolxml2argvdata/qcow2-luks-convert-encrypt2fileqcow2.argv
index 4d910552d0..948e9ac66d 100644
--- a/tests/storagevolxml2argvdata/qcow2-luks-convert-encrypt2fileqcow2.argv
+++ b/tests/storagevolxml2argvdata/qcow2-luks-convert-encrypt2fileqcow2.argv
@@ -1,7 +1,7 @@
qemu-img \
create \
-f qcow2 \
--o compat=0.10 \
+-o compat=1.1 \
/var/lib/libvirt/images/sparse-qcow2.img \
1073741824K
qemu-img \
diff --git a/tests/storagevolxml2argvdata/qcow2-luks.argv b/tests/storagevolxml2argvdata/qcow2-luks.argv
index 308316c90c..a3be41a406 100644
--- a/tests/storagevolxml2argvdata/qcow2-luks.argv
+++ b/tests/storagevolxml2argvdata/qcow2-luks.argv
@@ -3,6 +3,6 @@ create \
-f qcow2 \
-b /dev/null \
--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 \
5242880K
diff --git a/tests/storagevolxml2argvdata/qcow2-nobacking-convert-prealloc-compat.argv b/tests/storagevolxml2argvdata/qcow2-nobacking-convert-prealloc-compat.argv
index 463ae26779..a130ed8894 100644
--- a/tests/storagevolxml2argvdata/qcow2-nobacking-convert-prealloc-compat.argv
+++ b/tests/storagevolxml2argvdata/qcow2-nobacking-convert-prealloc-compat.argv
@@ -2,6 +2,6 @@ qemu-img \
convert \
-f raw \
-O qcow2 \
--o preallocation=metadata,compat=0.10 \
+-o preallocation=metadata,compat=1.1 \
/var/lib/libvirt/images/sparse.img \
/var/lib/libvirt/images/OtherDemo.img
diff --git a/tests/storagevolxml2argvdata/qcow2-nobacking-prealloc-compat.argv b/tests/storagevolxml2argvdata/qcow2-nobacking-prealloc-compat.argv
index 510e0c13f6..440ad8f122 100644
--- a/tests/storagevolxml2argvdata/qcow2-nobacking-prealloc-compat.argv
+++ b/tests/storagevolxml2argvdata/qcow2-nobacking-prealloc-compat.argv
@@ -1,6 +1,6 @@
qemu-img \
create \
-f qcow2 \
--o preallocation=metadata,compat=0.10 \
+-o preallocation=metadata,compat=1.1 \
/var/lib/libvirt/images/OtherDemo.img \
5242880K
diff --git a/tests/storagevolxml2argvdata/qcow2-nocapacity-convert-prealloc.argv b/tests/storagevolxml2argvdata/qcow2-nocapacity-convert-prealloc.argv
index 0152b1efb6..3bf8613d72 100644
--- a/tests/storagevolxml2argvdata/qcow2-nocapacity-convert-prealloc.argv
+++ b/tests/storagevolxml2argvdata/qcow2-nocapacity-convert-prealloc.argv
@@ -2,6 +2,6 @@ qemu-img \
convert \
-f raw \
-O qcow2 \
--o preallocation=falloc,compat=0.10 \
+-o preallocation=falloc,compat=1.1 \
/var/lib/libvirt/images/sparse.img \
/var/lib/libvirt/images/OtherDemo.img
diff --git a/tests/storagevolxml2argvdata/qcow2-nocapacity.argv b/tests/storagevolxml2argvdata/qcow2-nocapacity.argv
index 047932a559..924c5c6084 100644
--- a/tests/storagevolxml2argvdata/qcow2-nocapacity.argv
+++ b/tests/storagevolxml2argvdata/qcow2-nocapacity.argv
@@ -2,5 +2,5 @@ qemu-img \
create \
-f qcow2 \
-b /dev/null \
--o backing_fmt=raw,compat=0.10 \
+-o backing_fmt=raw,compat=1.1 \
/var/lib/libvirt/images/OtherDemo.img
diff --git a/tests/storagevolxml2argvdata/qcow2-nocow-compat.argv b/tests/storagevolxml2argvdata/qcow2-nocow-compat.argv
index 4cc7904cfc..ae94e4e588 100644
--- a/tests/storagevolxml2argvdata/qcow2-nocow-compat.argv
+++ b/tests/storagevolxml2argvdata/qcow2-nocow-compat.argv
@@ -2,6 +2,6 @@ qemu-img \
create \
-f qcow2 \
-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 \
5242880K
diff --git a/tests/storagevolxml2argvdata/qcow2-zerocapacity.argv b/tests/storagevolxml2argvdata/qcow2-zerocapacity.argv
index 607c642e6f..05e31509cb 100644
--- a/tests/storagevolxml2argvdata/qcow2-zerocapacity.argv
+++ b/tests/storagevolxml2argvdata/qcow2-zerocapacity.argv
@@ -1,6 +1,6 @@
qemu-img \
create \
-f qcow2 \
--o compat=0.10 \
+-o compat=1.1 \
/var/lib/libvirt/images/OtherDemo.img \
0K
--
2.42.1
9 months, 3 weeks
[PATCH v2] storage: Upgrade default qcow2 version
by Abhiram Tilak
Change the default to modern qcow2 as it's supported by all qemu
versions supported by libvirt and `qemu-img` already defaults to
the new format since QEMU 1.7.
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.
Signed-off-by: Abhiram Tilak <atp.exp(a)gmail.com>
Reviewed-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/storage/storage_util.c | 2 +-
.../storagevolxml2argvdata/luks-convert-encrypt2fileqcow2.argv | 2 +-
tests/storagevolxml2argvdata/qcow2-compat.argv | 2 +-
tests/storagevolxml2argvdata/qcow2-from-logical-compat.argv | 2 +-
tests/storagevolxml2argvdata/qcow2-luks-convert-encrypt.argv | 2 +-
.../qcow2-luks-convert-encrypt2fileqcow2.argv | 2 +-
tests/storagevolxml2argvdata/qcow2-luks.argv | 2 +-
.../qcow2-nobacking-convert-prealloc-compat.argv | 2 +-
.../storagevolxml2argvdata/qcow2-nobacking-prealloc-compat.argv | 2 +-
.../qcow2-nocapacity-convert-prealloc.argv | 2 +-
tests/storagevolxml2argvdata/qcow2-nocapacity.argv | 2 +-
tests/storagevolxml2argvdata/qcow2-nocow-compat.argv | 2 +-
tests/storagevolxml2argvdata/qcow2-zerocapacity.argv | 2 +-
13 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c
index 7bf815d978..28d5fce4f0 100644
--- a/src/storage/storage_util.c
+++ b/src/storage/storage_util.c
@@ -765,7 +765,7 @@ storageBackendCreateQemuImgOpts(virStorageEncryptionInfoDef *encinfo,
if (info->compat)
virBufferAsprintf(&buf, "compat=%s,", info->compat);
else if (info->format == VIR_STORAGE_FILE_QCOW2)
- virBufferAddLit(&buf, "compat=0.10,");
+ virBufferAddLit(&buf, "compat=1.1,");
if (info->clusterSize > 0)
virBufferAsprintf(&buf, "cluster_size=%llu,", info->clusterSize);
diff --git a/tests/storagevolxml2argvdata/luks-convert-encrypt2fileqcow2.argv b/tests/storagevolxml2argvdata/luks-convert-encrypt2fileqcow2.argv
index 4b9ccfe8dc..705604b162 100644
--- a/tests/storagevolxml2argvdata/luks-convert-encrypt2fileqcow2.argv
+++ b/tests/storagevolxml2argvdata/luks-convert-encrypt2fileqcow2.argv
@@ -1,7 +1,7 @@
qemu-img \
create \
-f qcow2 \
--o compat=0.10 \
+-o compat=1.1 \
/var/lib/libvirt/images/sparse-qcow2.img \
1073741824K
qemu-img \
diff --git a/tests/storagevolxml2argvdata/qcow2-compat.argv b/tests/storagevolxml2argvdata/qcow2-compat.argv
index bf3a50a7f3..40fbe065e0 100644
--- a/tests/storagevolxml2argvdata/qcow2-compat.argv
+++ b/tests/storagevolxml2argvdata/qcow2-compat.argv
@@ -2,6 +2,6 @@ qemu-img \
create \
-f qcow2 \
-b /dev/null \
--o backing_fmt=raw,compat=0.10 \
+-o backing_fmt=raw,compat=1.1 \
/var/lib/libvirt/images/OtherDemo.img \
5242880K
diff --git a/tests/storagevolxml2argvdata/qcow2-from-logical-compat.argv b/tests/storagevolxml2argvdata/qcow2-from-logical-compat.argv
index dbc7deb16a..b68da425d9 100644
--- a/tests/storagevolxml2argvdata/qcow2-from-logical-compat.argv
+++ b/tests/storagevolxml2argvdata/qcow2-from-logical-compat.argv
@@ -2,6 +2,6 @@ qemu-img \
convert \
-f raw \
-O qcow2 \
--o compat=0.10 \
+-o compat=1.1 \
/dev/HostVG/Swap \
/var/lib/libvirt/images/OtherDemo.img
diff --git a/tests/storagevolxml2argvdata/qcow2-luks-convert-encrypt.argv b/tests/storagevolxml2argvdata/qcow2-luks-convert-encrypt.argv
index d89622d4a6..3068b4b38d 100644
--- a/tests/storagevolxml2argvdata/qcow2-luks-convert-encrypt.argv
+++ b/tests/storagevolxml2argvdata/qcow2-luks-convert-encrypt.argv
@@ -2,7 +2,7 @@ qemu-img \
create \
-f qcow2 \
--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 \
5242880K
qemu-img \
diff --git a/tests/storagevolxml2argvdata/qcow2-luks-convert-encrypt2fileqcow2.argv b/tests/storagevolxml2argvdata/qcow2-luks-convert-encrypt2fileqcow2.argv
index 4d910552d0..948e9ac66d 100644
--- a/tests/storagevolxml2argvdata/qcow2-luks-convert-encrypt2fileqcow2.argv
+++ b/tests/storagevolxml2argvdata/qcow2-luks-convert-encrypt2fileqcow2.argv
@@ -1,7 +1,7 @@
qemu-img \
create \
-f qcow2 \
--o compat=0.10 \
+-o compat=1.1 \
/var/lib/libvirt/images/sparse-qcow2.img \
1073741824K
qemu-img \
diff --git a/tests/storagevolxml2argvdata/qcow2-luks.argv b/tests/storagevolxml2argvdata/qcow2-luks.argv
index 308316c90c..a3be41a406 100644
--- a/tests/storagevolxml2argvdata/qcow2-luks.argv
+++ b/tests/storagevolxml2argvdata/qcow2-luks.argv
@@ -3,6 +3,6 @@ create \
-f qcow2 \
-b /dev/null \
--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 \
5242880K
diff --git a/tests/storagevolxml2argvdata/qcow2-nobacking-convert-prealloc-compat.argv b/tests/storagevolxml2argvdata/qcow2-nobacking-convert-prealloc-compat.argv
index 463ae26779..a130ed8894 100644
--- a/tests/storagevolxml2argvdata/qcow2-nobacking-convert-prealloc-compat.argv
+++ b/tests/storagevolxml2argvdata/qcow2-nobacking-convert-prealloc-compat.argv
@@ -2,6 +2,6 @@ qemu-img \
convert \
-f raw \
-O qcow2 \
--o preallocation=metadata,compat=0.10 \
+-o preallocation=metadata,compat=1.1 \
/var/lib/libvirt/images/sparse.img \
/var/lib/libvirt/images/OtherDemo.img
diff --git a/tests/storagevolxml2argvdata/qcow2-nobacking-prealloc-compat.argv b/tests/storagevolxml2argvdata/qcow2-nobacking-prealloc-compat.argv
index 510e0c13f6..440ad8f122 100644
--- a/tests/storagevolxml2argvdata/qcow2-nobacking-prealloc-compat.argv
+++ b/tests/storagevolxml2argvdata/qcow2-nobacking-prealloc-compat.argv
@@ -1,6 +1,6 @@
qemu-img \
create \
-f qcow2 \
--o preallocation=metadata,compat=0.10 \
+-o preallocation=metadata,compat=1.1 \
/var/lib/libvirt/images/OtherDemo.img \
5242880K
diff --git a/tests/storagevolxml2argvdata/qcow2-nocapacity-convert-prealloc.argv b/tests/storagevolxml2argvdata/qcow2-nocapacity-convert-prealloc.argv
index 0152b1efb6..3bf8613d72 100644
--- a/tests/storagevolxml2argvdata/qcow2-nocapacity-convert-prealloc.argv
+++ b/tests/storagevolxml2argvdata/qcow2-nocapacity-convert-prealloc.argv
@@ -2,6 +2,6 @@ qemu-img \
convert \
-f raw \
-O qcow2 \
--o preallocation=falloc,compat=0.10 \
+-o preallocation=falloc,compat=1.1 \
/var/lib/libvirt/images/sparse.img \
/var/lib/libvirt/images/OtherDemo.img
diff --git a/tests/storagevolxml2argvdata/qcow2-nocapacity.argv b/tests/storagevolxml2argvdata/qcow2-nocapacity.argv
index 047932a559..924c5c6084 100644
--- a/tests/storagevolxml2argvdata/qcow2-nocapacity.argv
+++ b/tests/storagevolxml2argvdata/qcow2-nocapacity.argv
@@ -2,5 +2,5 @@ qemu-img \
create \
-f qcow2 \
-b /dev/null \
--o backing_fmt=raw,compat=0.10 \
+-o backing_fmt=raw,compat=1.1 \
/var/lib/libvirt/images/OtherDemo.img
diff --git a/tests/storagevolxml2argvdata/qcow2-nocow-compat.argv b/tests/storagevolxml2argvdata/qcow2-nocow-compat.argv
index 4cc7904cfc..ae94e4e588 100644
--- a/tests/storagevolxml2argvdata/qcow2-nocow-compat.argv
+++ b/tests/storagevolxml2argvdata/qcow2-nocow-compat.argv
@@ -2,6 +2,6 @@ qemu-img \
create \
-f qcow2 \
-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 \
5242880K
diff --git a/tests/storagevolxml2argvdata/qcow2-zerocapacity.argv b/tests/storagevolxml2argvdata/qcow2-zerocapacity.argv
index 607c642e6f..05e31509cb 100644
--- a/tests/storagevolxml2argvdata/qcow2-zerocapacity.argv
+++ b/tests/storagevolxml2argvdata/qcow2-zerocapacity.argv
@@ -1,6 +1,6 @@
qemu-img \
create \
-f qcow2 \
--o compat=0.10 \
+-o compat=1.1 \
/var/lib/libvirt/images/OtherDemo.img \
0K
--
2.42.1
9 months, 3 weeks
[PATCH] virsh: Fix overflow error of freepages command
by Adam Julis
Trying to print pages of a size larger than the UINT_MAX of the
given platform (for example, around 4G on 64-bit intel), a system
error was printed, but this is a legitimate request, fixed.
vshCommandOptScaledInt requiers set maximum returning size for
the variable '&bytes'. It was set as UINT_MAX, while the public
API variable 'kibibytes', which loads the 'bytes' lately, is type
of UINT. Since it's kibibytes, the value in bytes should be 1024*
bigger and it still will works correctly. So the correct max size
of bytes is UINT_MAX * 1024.
Resolves: https://issues.redhat.com/browse/RHEL-23608
Signed-off-by: Adam Julis <ajulis(a)redhat.com>
---
tools/virsh-host.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/virsh-host.c b/tools/virsh-host.c
index 6c14be865f..5a934d7a7f 100644
--- a/tools/virsh-host.c
+++ b/tools/virsh-host.c
@@ -335,7 +335,7 @@ cmdFreepages(vshControl *ctl, const vshCmd *cmd)
VSH_EXCLUSIVE_OPTIONS_VAR(all, cellno);
- if (vshCommandOptScaledInt(ctl, cmd, "pagesize", &bytes, 1024, UINT_MAX) < 0)
+ if (vshCommandOptScaledInt(ctl, cmd, "pagesize", &bytes, 1024, UINT_MAX * 1024ULL) < 0)
goto cleanup;
kibibytes = VIR_DIV_UP(bytes, 1024);
--
2.43.2
9 months, 3 weeks
[PATCH 0/2] storage: Upgrade default qcow2 verion to 1.1
by Abhiram Tilak
Right now the default qcow2 version if not specified explicitly,
defaults to 0.10. Certain features like live snapshots, cluster
size specification require 1.1 to work.
This patch series aims at upgrading the qcow2 default image version,
and use compatibility version 1.1 unless specified. This also requires
correcting multiple testcases related to this compat version.
If any other locations require changing, they will be
added as a part of this series.
Resolves: https://gitlab.com/libvirt/libvirt/-/issues/602
Abhiram Tilak (2):
storage: change assigning qcow2 compat to 1.1 from 0.10 automatically
storage: fix testcases on changing the default qcow2 compat to 1.1
src/storage/storage_util.c | 2 +-
.../storagevolxml2argvdata/luks-convert-encrypt2fileqcow2.argv | 2 +-
tests/storagevolxml2argvdata/qcow2-compat.argv | 2 +-
tests/storagevolxml2argvdata/qcow2-from-logical-compat.argv | 2 +-
tests/storagevolxml2argvdata/qcow2-luks-convert-encrypt.argv | 2 +-
.../qcow2-luks-convert-encrypt2fileqcow2.argv | 2 +-
tests/storagevolxml2argvdata/qcow2-luks.argv | 2 +-
.../qcow2-nobacking-convert-prealloc-compat.argv | 2 +-
.../storagevolxml2argvdata/qcow2-nobacking-prealloc-compat.argv | 2 +-
.../qcow2-nocapacity-convert-prealloc.argv | 2 +-
tests/storagevolxml2argvdata/qcow2-nocapacity.argv | 2 +-
tests/storagevolxml2argvdata/qcow2-nocow-compat.argv | 2 +-
tests/storagevolxml2argvdata/qcow2-zerocapacity.argv | 2 +-
13 files changed, 13 insertions(+), 13 deletions(-)
--
2.42.1
9 months, 3 weeks
[PATCH] qemu: Optimize CPU check='partial' for usable CPUs
by Jiri Denemark
Ideally check='partial' would check exactly the features QEMU would want
to enable when asked for a specific CPU model (and features). But there
is no way we could ask QEMU how a specific CPU would look like. So we
use our definition from CPU map, which may slightly differ as QEMU adds
or removes features from CPU models, and thus we may end up checking
features which QEMU would not enable while missing some required ones.
We can do better in specific cases, though. If a CPU definition uses
only a model and disabled features (or none at all), we already know
whether QEMU can enable all features required by the CPU model as that's
what we use to set usable='yes' attribute in the list of available CPU
models in domain capbilities XML. So when a usable CPU model is
requested without asking for additional features (disabling features is
fine) we can avoid our possible inaccurate check using our CPU map.
For backward compatibility we only consider usable models. If a
specified model is not usable, we still check it the old way and even
let QEMU start it (and disable some features) in case our definition
lacks some features compared to QEMU.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/qemu/qemu_capabilities.c | 44 ++++++++++++++++++++++++++++++++++++
src/qemu/qemu_capabilities.h | 3 +++
src/qemu/qemu_process.c | 1 +
3 files changed, 48 insertions(+)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index e383d85920..cb9846dfcf 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -2433,6 +2433,50 @@ virQEMUCapsIsCPUDeprecated(virQEMUCaps *qemuCaps,
}
+/**
+ * virQEMUCapsIsCPUUsable:
+ * @qemuCaps: QEMU capabilities
+ * @type: virtualization type (kvm vs tcg)
+ * @cpu: CPU definition to check, including explicitly configured features
+ *
+ * Checks whether @cpu is considered usable by QEMU, i.e., all features
+ * required by the CPU model are supported and can be enabled. If so, we can
+ * avoid checking the CPU according to its definition in the CPU map when
+ * starting a domain with check='partial'. Our checks could be inaccurate
+ * anyway because QEMU might have changed the definition of the CPU model
+ * since we added it into the CPU map.
+ *
+ * Returns true iff @cpu is usable.
+ */
+bool
+virQEMUCapsIsCPUUsable(virQEMUCaps *qemuCaps,
+ virDomainVirtType type,
+ virCPUDef *cpu)
+{
+ qemuMonitorCPUDefs *defs;
+ size_t i;
+
+ if (!cpu->model ||
+ !(defs = virQEMUCapsGetAccel(qemuCaps, type)->cpuModels))
+ return false;
+
+ /* CPU model usability is valid only when CPU def does not contain any
+ * features or all features are disabled.
+ */
+ for (i = 0; i < cpu->nfeatures; i++) {
+ if (cpu->features[i].policy != VIR_CPU_FEATURE_DISABLE)
+ return false;
+ }
+
+ for (i = 0; i < defs->ncpus; i++) {
+ if (STREQ(defs->cpus[i].name, cpu->model))
+ return defs->cpus[i].usable == VIR_DOMCAPS_CPU_USABLE_YES;
+ }
+
+ return false;
+}
+
+
bool
virQEMUCapsIsMachineDeprecated(virQEMUCaps *qemuCaps,
virDomainVirtType type,
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index 486a4a6f63..ef1ad2c01c 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -770,6 +770,9 @@ const char *virQEMUCapsGetMachineDefaultCPU(virQEMUCaps *qemuCaps,
bool virQEMUCapsIsCPUDeprecated(virQEMUCaps *qemuCaps,
virDomainVirtType type,
const char *model);
+bool virQEMUCapsIsCPUUsable(virQEMUCaps *qemuCaps,
+ virDomainVirtType type,
+ virCPUDef *cpu);
bool virQEMUCapsIsMachineDeprecated(virQEMUCaps *qemuCaps,
virDomainVirtType type,
const char *machine);
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 6e51d6586b..8e35d0a73f 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -6288,6 +6288,7 @@ qemuProcessUpdateGuestCPU(virDomainDef *def,
g_autoptr(virDomainCapsCPUModels) cpuModels = NULL;
if (def->cpu->check == VIR_CPU_CHECK_PARTIAL &&
+ !virQEMUCapsIsCPUUsable(qemuCaps, def->virtType, def->cpu) &&
virCPUCompare(hostarch,
virQEMUCapsGetHostModel(qemuCaps, def->virtType,
VIR_QEMU_CAPS_HOST_CPU_FULL),
--
2.44.0
9 months, 3 weeks
[PATCH] virsh: Fix overflow error of freepages command
by Adam Julis
Trying to print pages of a size larger than the UINT_MAX of the given platform, a system error was printed, but this is a legitimate request, fixed
Signed-off-by: Adam Julis <ajulis(a)redhat.com>
---
tools/virsh-host.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/virsh-host.c b/tools/virsh-host.c
index 6c14be865f..dc1282e718 100644
--- a/tools/virsh-host.c
+++ b/tools/virsh-host.c
@@ -335,7 +335,7 @@ cmdFreepages(vshControl *ctl, const vshCmd *cmd)
VSH_EXCLUSIVE_OPTIONS_VAR(all, cellno);
- if (vshCommandOptScaledInt(ctl, cmd, "pagesize", &bytes, 1024, UINT_MAX) < 0)
+ if (vshCommandOptScaledInt(ctl, cmd, "pagesize", &bytes, 1024, UINT_MAX*1024ULL) < 0)
goto cleanup;
kibibytes = VIR_DIV_UP(bytes, 1024);
--
2.43.2
9 months, 3 weeks
[PATCH] cpu: x86: Check for invalid CPU data from hypervisor
by Jiri Denemark
Recently a kernel bug caused QEMU to report a CPU feature as enabled
while listing it in the "unavailable-features" list of features that
were requested, but could not be enabled. The feature was actually
enabled, but we marked it as disabled when starting a domain. Later when
the domain is migrated, the destination requests the feature to be
disabled, which breaks the guest ABI or if we are lucky QEMU just fails
to load the migration stream.
Let's make similar bugs more visible in the future by refusing to even
start the domain.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/cpu/cpu_x86.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
index 6b2531b360..e8409ce616 100644
--- a/src/cpu/cpu_x86.c
+++ b/src/cpu/cpu_x86.c
@@ -3019,6 +3019,14 @@ virCPUx86UpdateLive(virCPUDef *cpu,
x86DataIsSubset(&modelDisabled->data, &feature->data))
expected = VIR_CPU_FEATURE_DISABLE;
+ if (x86DataIsSubset(&enabled, &feature->data) &&
+ x86DataIsSubset(&disabled, &feature->data)) {
+ virReportError(VIR_ERR_OPERATION_FAILED,
+ _("hypervisor provided conflicting CPU data: feature '%1$s' is both enabled and disabled at the same time"),
+ feature->name);
+ return -1;
+ }
+
if (expected == VIR_CPU_FEATURE_DISABLE &&
x86DataIsSubset(&enabled, &feature->data)) {
VIR_DEBUG("Feature '%s' enabled by the hypervisor", feature->name);
--
2.44.0
9 months, 3 weeks
RE: join running core dump job
by Thanos Makatos
> -----Original Message-----
> From: Thanos Makatos <thanos.makatos(a)nutanix.com>
> Sent: Monday, March 4, 2024 5:24 PM
> To: devel(a)lists.libvirt.org
> Subject: join running core dump job
>
> Is there a way to programmatically wait for a previously initiated
> virDomainCoreDumpWithFormat() where the process that started it died? I'm
> looking at the API and don't seem to find anything relevant. I suppose I could
> poll via virDomainGetJobStats(), but, ideally, I'd like a function that would join
> the dump job and return when the dump job finishes.
> _______________________________________________
> Devel mailing list -- devel(a)lists.libvirt.org
> To unsubscribe send an email to devel-leave(a)lists.libvirt.org
I see there's qemuDumpWaitForCompletion(), looks promising.
9 months, 3 weeks
[PATCH] ci: refresh with lcitool manifest
by Daniel P. Berrangé
Picks up the switch from FreeBSD 13.2 to 13.3
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
ci/gitlab/builds.yml | 2 +-
ci/lcitool/targets/freebsd-13.yml | 2 --
2 files changed, 1 insertion(+), 3 deletions(-)
delete mode 100644 ci/lcitool/targets/freebsd-13.yml
diff --git a/ci/gitlab/builds.yml b/ci/gitlab/builds.yml
index 49a0b27029..b23a3989b9 100644
--- a/ci/gitlab/builds.yml
+++ b/ci/gitlab/builds.yml
@@ -619,7 +619,7 @@ x86_64-freebsd-13:
needs: []
allow_failure: false
variables:
- CIRRUS_VM_IMAGE_NAME: freebsd-13-2
+ CIRRUS_VM_IMAGE_NAME: freebsd-13-3
CIRRUS_VM_IMAGE_SELECTOR: image_family
CIRRUS_VM_INSTANCE_TYPE: freebsd_instance
INSTALL_COMMAND: pkg install -y
diff --git a/ci/lcitool/targets/freebsd-13.yml b/ci/lcitool/targets/freebsd-13.yml
deleted file mode 100644
index 0337926479..0000000000
--- a/ci/lcitool/targets/freebsd-13.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-cirrus:
- image_name: freebsd-13-2
--
2.43.0
9 months, 3 weeks