]> git.ipfire.org Git - thirdparty/libvirt.git/log
thirdparty/libvirt.git
3 days agodocs: fix typo in qemu-passthrough-security master
Ngai-Mint Kwan [Tue, 1 Jul 2025 16:55:23 +0000 (16:55 +0000)] 
docs: fix typo in qemu-passthrough-security

Signed-off-by: Ngai-Mint Kwan <ngai-mint.kwan@intel.com>
3 days agoqemu: Improve error message for USB controller validation
Andrea Bolognani [Tue, 13 Feb 2024 18:28:09 +0000 (19:28 +0100)] 
qemu: Improve error message for USB controller validation

Use the same wording as for SCSI controllers, which also
happens to contain additional information (the controller's
index).

The new error message and error type are more accurate anyway:
in most cases, it's perfectly fine for the user not to provide
a controller model explicitly, as libvirt will try to figure
out a reasonable default.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 days agoqemu: Move error reporting out of qemuDomainDefaultSCSIControllerModel()
Andrea Bolognani [Fri, 9 Feb 2024 17:38:35 +0000 (18:38 +0100)] 
qemu: Move error reporting out of qemuDomainDefaultSCSIControllerModel()

We want this helper to work more like other similar ones, where
error reporting is performed by the caller. This introduces a
small amount of code duplication but makes for a cleaner API.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 days agoqemu: Rename qemuDomainDefaultSCSIControllerModel()
Andrea Bolognani [Fri, 9 Feb 2024 17:34:30 +0000 (18:34 +0100)] 
qemu: Rename qemuDomainDefaultSCSIControllerModel()

The original name was qemuDomainGetSCSIControllerModel().

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 days agotests: Add controller-scsi-default-unavailable
Andrea Bolognani [Tue, 13 Feb 2024 10:20:46 +0000 (11:20 +0100)] 
tests: Add controller-scsi-default-unavailable

This provides coverage for the (very unlikely) scenario in
which none of the possible devices are built into QEMU.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 days agoTranslated using Weblate (Portuguese)
Américo Monteiro [Fri, 4 Jul 2025 07:49:27 +0000 (07:49 +0000)] 
Translated using Weblate (Portuguese)

Currently translated at 7.6% (835 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Américo Monteiro <a_monteiro@gmx.com>
Translated using Weblate (Portuguese)

Currently translated at 7.1% (786 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Américo Monteiro <a_monteiro@gmx.com>
3 days agoTranslated using Weblate (Portuguese)
Weblate [Fri, 4 Jul 2025 07:49:27 +0000 (07:49 +0000)] 
Translated using Weblate (Portuguese)

Currently translated at 7.1% (783 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>
3 days agoTranslated using Weblate (Portuguese)
Américo Monteiro [Fri, 4 Jul 2025 07:49:26 +0000 (07:49 +0000)] 
Translated using Weblate (Portuguese)

Currently translated at 7.1% (783 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Américo Monteiro <a_monteiro@gmx.com>
Translated using Weblate (Portuguese)

Currently translated at 7.1% (781 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Américo Monteiro <a_monteiro@gmx.com>
Translated using Weblate (Portuguese)

Currently translated at 7.1% (781 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Américo Monteiro <a_monteiro@gmx.com>
3 days agoTranslated using Weblate (Portuguese)
Weblate [Fri, 4 Jul 2025 07:49:26 +0000 (07:49 +0000)] 
Translated using Weblate (Portuguese)

Currently translated at 7.1% (781 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>
3 days agoTranslated using Weblate (Portuguese)
Américo Monteiro [Fri, 4 Jul 2025 07:49:25 +0000 (07:49 +0000)] 
Translated using Weblate (Portuguese)

Currently translated at 7.1% (779 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Américo Monteiro <a_monteiro@gmx.com>
3 days agoTranslated using Weblate (Portuguese)
Weblate [Fri, 4 Jul 2025 07:49:24 +0000 (07:49 +0000)] 
Translated using Weblate (Portuguese)

Currently translated at 7.1% (779 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>
Translated using Weblate (Portuguese)

Currently translated at 7.1% (778 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>
3 days agoTranslated using Weblate (Portuguese)
Américo Monteiro [Fri, 4 Jul 2025 07:49:23 +0000 (07:49 +0000)] 
Translated using Weblate (Portuguese)

Currently translated at 7.1% (778 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Américo Monteiro <a_monteiro@gmx.com>
Translated using Weblate (Portuguese)

Currently translated at 7.1% (777 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Américo Monteiro <a_monteiro@gmx.com>
3 days agoTranslated using Weblate (Portuguese)
Weblate [Fri, 4 Jul 2025 07:49:22 +0000 (07:49 +0000)] 
Translated using Weblate (Portuguese)

Currently translated at 7.1% (777 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>
Translated using Weblate (Portuguese)

Currently translated at 7.0% (776 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>
3 days agoTranslated using Weblate (Portuguese)
Américo Monteiro [Fri, 4 Jul 2025 07:49:22 +0000 (07:49 +0000)] 
Translated using Weblate (Portuguese)

Currently translated at 7.0% (776 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Américo Monteiro <a_monteiro@gmx.com>
3 days agoTranslated using Weblate (Portuguese)
Weblate [Fri, 4 Jul 2025 07:49:21 +0000 (07:49 +0000)] 
Translated using Weblate (Portuguese)

Currently translated at 7.0% (772 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>
3 days agoTranslated using Weblate (Portuguese)
Américo Monteiro [Fri, 4 Jul 2025 07:49:20 +0000 (07:49 +0000)] 
Translated using Weblate (Portuguese)

Currently translated at 7.0% (772 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Américo Monteiro <a_monteiro@gmx.com>
Translated using Weblate (Portuguese)

Currently translated at 7.0% (771 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Américo Monteiro <a_monteiro@gmx.com>
3 days agoTranslated using Weblate (Portuguese)
Weblate [Fri, 4 Jul 2025 07:49:19 +0000 (07:49 +0000)] 
Translated using Weblate (Portuguese)

Currently translated at 7.0% (771 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>
Translated using Weblate (Portuguese)

Currently translated at 7.0% (770 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>
3 days agoTranslated using Weblate (Portuguese)
Américo Monteiro [Fri, 4 Jul 2025 07:49:18 +0000 (07:49 +0000)] 
Translated using Weblate (Portuguese)

Currently translated at 7.0% (770 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Américo Monteiro <a_monteiro@gmx.com>
3 days agoTranslated using Weblate (Portuguese)
Weblate [Fri, 4 Jul 2025 07:49:18 +0000 (07:49 +0000)] 
Translated using Weblate (Portuguese)

Currently translated at 6.2% (680 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>
3 days agoTranslated using Weblate (Portuguese)
Américo Monteiro [Fri, 4 Jul 2025 07:49:17 +0000 (07:49 +0000)] 
Translated using Weblate (Portuguese)

Currently translated at 6.2% (680 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Américo Monteiro <a_monteiro@gmx.com>
Translated using Weblate (Portuguese)

Currently translated at 5.9% (648 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Américo Monteiro <a_monteiro@gmx.com>
Translated using Weblate (Portuguese)

Currently translated at 5.7% (630 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Américo Monteiro <a_monteiro@gmx.com>
Translated using Weblate (Portuguese)

Currently translated at 5.6% (623 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Américo Monteiro <a_monteiro@gmx.com>
Translated using Weblate (Portuguese)

Currently translated at 5.5% (607 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Américo Monteiro <a_monteiro@gmx.com>
Translated using Weblate (Portuguese)

Currently translated at 5.2% (575 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Américo Monteiro <a_monteiro@gmx.com>
Translated using Weblate (Portuguese)

Currently translated at 5.2% (574 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Américo Monteiro <a_monteiro@gmx.com>
Translated using Weblate (Portuguese)

Currently translated at 4.6% (508 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Américo Monteiro <a_monteiro@gmx.com>
Translated using Weblate (Portuguese)

Currently translated at 4.2% (469 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Américo Monteiro <a_monteiro@gmx.com>
3 days agoTranslated using Weblate (Portuguese)
Weblate [Fri, 4 Jul 2025 07:49:16 +0000 (07:49 +0000)] 
Translated using Weblate (Portuguese)

Currently translated at 4.2% (462 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>
3 days agoTranslated using Weblate (Portuguese)
Américo Monteiro [Fri, 4 Jul 2025 07:49:15 +0000 (07:49 +0000)] 
Translated using Weblate (Portuguese)

Currently translated at 4.2% (462 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Américo Monteiro <a_monteiro@gmx.com>
3 days agoTranslated using Weblate (Portuguese)
Weblate [Fri, 4 Jul 2025 07:49:15 +0000 (07:49 +0000)] 
Translated using Weblate (Portuguese)

Currently translated at 4.1% (455 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>
3 days agoTranslated using Weblate (Portuguese)
Américo Monteiro [Fri, 4 Jul 2025 07:49:14 +0000 (07:49 +0000)] 
Translated using Weblate (Portuguese)

Currently translated at 4.1% (455 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Américo Monteiro <a_monteiro@gmx.com>
3 days agoTranslated using Weblate (Portuguese)
Weblate [Fri, 4 Jul 2025 07:49:13 +0000 (07:49 +0000)] 
Translated using Weblate (Portuguese)

Currently translated at 4.1% (452 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>
3 days agoTranslated using Weblate (Portuguese)
Américo Monteiro [Fri, 4 Jul 2025 07:49:12 +0000 (07:49 +0000)] 
Translated using Weblate (Portuguese)

Currently translated at 4.1% (452 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Américo Monteiro <a_monteiro@gmx.com>
Translated using Weblate (Portuguese)

Currently translated at 3.9% (436 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Américo Monteiro <a_monteiro@gmx.com>
Translated using Weblate (Portuguese)

Currently translated at 3.9% (435 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Américo Monteiro <a_monteiro@gmx.com>
Translated using Weblate (Portuguese)

Currently translated at 3.7% (406 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Américo Monteiro <a_monteiro@gmx.com>
Translated using Weblate (Portuguese)

Currently translated at 3.6% (402 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Américo Monteiro <a_monteiro@gmx.com>
3 days agoTranslated using Weblate (Portuguese)
Weblate [Fri, 4 Jul 2025 07:49:12 +0000 (07:49 +0000)] 
Translated using Weblate (Portuguese)

Currently translated at 3.6% (402 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>
3 days agoTranslated using Weblate (Portuguese)
Américo Monteiro [Fri, 4 Jul 2025 07:49:11 +0000 (07:49 +0000)] 
Translated using Weblate (Portuguese)

Currently translated at 3.6% (397 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Américo Monteiro <a_monteiro@gmx.com>
3 days agoTranslated using Weblate (Portuguese)
Weblate [Fri, 4 Jul 2025 07:49:10 +0000 (07:49 +0000)] 
Translated using Weblate (Portuguese)

Currently translated at 3.6% (397 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>
Translated using Weblate (Portuguese)

Currently translated at 3.6% (396 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>
3 days agoTranslated using Weblate (Portuguese)
Américo Monteiro [Fri, 4 Jul 2025 07:49:09 +0000 (07:49 +0000)] 
Translated using Weblate (Portuguese)

Currently translated at 3.6% (396 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Américo Monteiro <a_monteiro@gmx.com>
Translated using Weblate (Portuguese)

Currently translated at 3.2% (357 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Américo Monteiro <a_monteiro@gmx.com>
3 days agoTranslated using Weblate (Portuguese)
Weblate [Fri, 4 Jul 2025 07:49:08 +0000 (07:49 +0000)] 
Translated using Weblate (Portuguese)

Currently translated at 3.2% (357 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>
3 days agoTranslated using Weblate (Portuguese)
Américo Monteiro [Fri, 4 Jul 2025 07:49:08 +0000 (07:49 +0000)] 
Translated using Weblate (Portuguese)

Currently translated at 3.2% (350 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Américo Monteiro <a_monteiro@gmx.com>
3 days agoTranslated using Weblate (Portuguese)
Weblate [Fri, 4 Jul 2025 07:49:07 +0000 (07:49 +0000)] 
Translated using Weblate (Portuguese)

Currently translated at 3.2% (350 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>
Translated using Weblate (Portuguese)

Currently translated at 3.1% (349 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>
Translated using Weblate (Portuguese)

Currently translated at 3.1% (348 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>
3 days agoTranslated using Weblate (Portuguese)
Américo Monteiro [Fri, 4 Jul 2025 07:49:06 +0000 (07:49 +0000)] 
Translated using Weblate (Portuguese)

Currently translated at 3.1% (348 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Américo Monteiro <a_monteiro@gmx.com>
5 days agovirt-aa-helper-test: Switch to getopts
Michal Privoznik [Thu, 12 Jun 2025 07:59:08 +0000 (09:59 +0200)] 
virt-aa-helper-test: Switch to getopts

Instead of treating -d and -v arguments as positional, use
getopts to parse cmd line arguments passed to
virt-aa-helper-test script.

While at it, introduce -h for printing basic help describing each
argument.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 days agovirt-aa-helper: Drop cleanup label from get_files()
Michal Privoznik [Wed, 11 Jun 2025 12:12:33 +0000 (14:12 +0200)] 
virt-aa-helper: Drop cleanup label from get_files()

After previous cleanup the cleanup label is no longer necessary.
Drop it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 days agovirt-aa-helper: Check retval of vah_add_file()
Michal Privoznik [Wed, 11 Jun 2025 11:59:49 +0000 (13:59 +0200)] 
virt-aa-helper: Check retval of vah_add_file()

Inside of get_files() there are two cases where vah_add_file() is
not checked for its retval. This is possibly dangerous, because
vah_add_file() might fail. Fix those places by introducing checks
for the retval.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 days agovirt-aa-helper: Use automatic memory freeing
Michal Privoznik [Wed, 11 Jun 2025 11:53:23 +0000 (13:53 +0200)] 
virt-aa-helper: Use automatic memory freeing

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 days agovirt-aa-helper: Decrease scope of @mem_path in get_files()
Michal Privoznik [Wed, 11 Jun 2025 11:52:46 +0000 (13:52 +0200)] 
virt-aa-helper: Decrease scope of @mem_path in get_files()

The @mem_path variable inside of get_files() is used only within
a single block. Move its declaration inside it. And also utilize
automatic memory freeing.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 days agovirt-aa-helper: Simplify paths collection
Michal Privoznik [Tue, 10 Jun 2025 07:27:58 +0000 (09:27 +0200)] 
virt-aa-helper: Simplify paths collection

The way virt-aa-helper works is the following: the apparmor
secdriver formats domain XML, spawns virt-aa-helper process and
feeds it with domain XML (through stdin). The helper process then
parses the XML and iterates over devices, appending paths in each
loop.

These loops usually are in the following form:

  for (i = 0; i < ctl->def->nserials; i++) {
      if (ctl->def->serials[i] && ...
  }

While we are probably honourable members of tautology club, those
NULL checks are redundant. Our XML parses would never append NULL
into def->devices array. If it did, we're in way bigger problems
anyway.

Then, constantly dereferencing ctl->def just to get to a path
that's hidden a couple of structures deep gets hard to read. Just
introduce temporary variables.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 days agovirt-aa-helper: Rework USB hostdev handling
Michal Privoznik [Tue, 10 Jun 2025 12:31:20 +0000 (14:31 +0200)] 
virt-aa-helper: Rework USB hostdev handling

For an USB device, the virt-aa-helper must put that
/dev/bus/usb/... path associated with given device. The way the
code is currently written not only leads to a memleak (the @usb
variable is allocated only to be overwritten right away), but is
needlessly cumbersome.

We can use virHostdevFindUSBDevice() to find the USB device,
check if its missing and if not add the path associated with it
into the profile.

While at it, also use automatic memory freeing for the variable.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 days agovirt-aa-helper-test: Test hostdevs unconditionally
Michal Privoznik [Tue, 10 Jun 2025 12:30:40 +0000 (14:30 +0200)] 
virt-aa-helper-test: Test hostdevs unconditionally

Our test suite is very feature rich. In particular, it has two
mocks that implement sysfs close enough to create
host-independent environment to work with PCI and USB devices.
These mocks are called virpcimock and virusbmock, respectively.

Inside of virt-aa-helper-test there is an attempt to test whether
virt-aa-helper generates profiles for <hostdevs/>, once for USB
and the other time for PCI. Use this mocks to run virt-aa-helper
in an environment where certain PCI/USB devices always exist.

There are two problem though:

1) those two test cases use hardcoded PCI/USB addresses, which
   makes them host environment dependant,

2) neither of the test cases checks whether corresponding rule
   was added into the profile.

Using mocks we can get away with problem 1), and by passing the
fifth argument to testme() we can list an expected rule in the
profile.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 days agovirt-aa-helper-test: Silence ls
Michal Privoznik [Tue, 10 Jun 2025 09:58:34 +0000 (11:58 +0200)] 
virt-aa-helper-test: Silence ls

virt-aa-helper checks presence of files before it adds them into
a profile. Because of that, test cases inside of
virt-aa-helper-test that require presence of /boot/initrd* are
guarded by a check. The check uses ls to find at least one initrd
file. If there's none, then ls prints an error onto stderr. This
is not helpful because the test script prints a message on its
own right after.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 days agovirt-aa-helper-test: Print errors to stderr
Michal Privoznik [Tue, 10 Jun 2025 09:57:43 +0000 (11:57 +0200)] 
virt-aa-helper-test: Print errors to stderr

When a test case fails, there are two echo-s executed: the first
one either prints the error message into /dev/null (default) or
onto stdout (when the test script is executed with -d). Then, the
second one prints the error message onto stdout. While this
technically works, there's nothing ever printed onto stderr which
is usually what's captured. Worse, if some command within the
script fails, it prints something onto stderr but then looking at
meson logs it's needlessly hard to match stderr and stdout lines.

Just print error messages onto stderr.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 days agotests: Fix mocking of open()
Michal Privoznik [Wed, 11 Jun 2025 14:17:33 +0000 (16:17 +0200)] 
tests: Fix mocking of open()

In some cases (well, majority), open() is either rewritten to
open64(), either by plain '#define open open64') or at assembly
level (using __REDIRECT macro). See <fcntl.h> for more info.

This didn't really matter to us, because we do not chain load two
mocks that would need to reimplement open() at the same time. But
this is soon going to change.

The problem is, that VIR_MOCK_REAL_INIT(open) glances over
aforementioned rewrite and initializes real_open pointer to
open() from the standard C library. But it needs to point to
open() (well, open64()) from the next mock on the list.

Therefore, init real_open to open64().

But of course, this is all glibc specific and for example musl
does the oposite (#define open64 open).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 days agovirpcimock: Strip fakerootdir prefix in virFileCanonicalizePath()
Michal Privoznik [Wed, 11 Jun 2025 11:19:32 +0000 (13:19 +0200)] 
virpcimock: Strip fakerootdir prefix in virFileCanonicalizePath()

The mocked implementation of virFileCanonicalizePath() redirects
accesses to few dirs into a temporary directory, where PCI
related files live. See getrealpath() for more info on this.

Anyway, in the end - real implementation of
virFileCanonicalizePath() is called which then might contain the
'fakerootdir' prefix. Up until now this did not matter because
none of our test really cared about actual value of resolved
path. They usually cared about last component of the path or
something. But this will soon change.

TLDR - if the returned path has $fakerootdir prefix, strip it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 days agovirpcimock: Automatically invent fakerootdir, if not provided
Michal Privoznik [Tue, 10 Jun 2025 13:11:55 +0000 (15:11 +0200)] 
virpcimock: Automatically invent fakerootdir, if not provided

Currently, all users of virpcimock do set LIBVIRT_FAKE_ROOT_DIR
envvar. But soon, virt-aa-helper will be run with it and
basically right at the beginning of its main() it clears whole
environment. So even if the envvar is provided the mock won't see
that.

Anyway, the solution is to just create a tempdir and then 'rm
-rf' it in the desctructor.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 days agovirt-aa-helper: Use virFileCanonicalizePath()
Michal Privoznik [Wed, 11 Jun 2025 11:19:12 +0000 (13:19 +0200)] 
virt-aa-helper: Use virFileCanonicalizePath()

While use of realpath() is not forbidden, our some of our mocks
already have a test friendly reimplementation of
virFileCanonicalizePath(). Use the latter.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 days agolog_cleaner: Use virFileCanonicalizePath()
Michal Privoznik [Wed, 11 Jun 2025 11:18:55 +0000 (13:18 +0200)] 
log_cleaner: Use virFileCanonicalizePath()

While use of realpath() is not forbidden, our some of our mocks
already have a test friendly reimplementation of
virFileCanonicalizePath(). Use the latter.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 days agogendispatch: Finish rename of the migration argument
Michal Privoznik [Thu, 5 Jun 2025 08:22:15 +0000 (10:22 +0200)] 
gendispatch: Finish rename of the migration argument

This patch is useless.

Either APIs it don't have 'resource' nor 'bandwidth' argument to
begin with, or they serve as a wrapper over different API
(changed in previous commits). Nonetheless, in the name of
consistency, let's just change those variable names.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 days agoqemu: Finish argument rename
Michal Privoznik [Thu, 5 Jun 2025 08:22:08 +0000 (10:22 +0200)] 
qemu: Finish argument rename

There are still some functions around migration code that use
'resource' instead 'bandwidth'. Rename the variable/argument
inside them.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 days agosrc: Unify argument name of virDomainMigratePerform3()
Michal Privoznik [Thu, 5 Jun 2025 08:21:25 +0000 (10:21 +0200)] 
src: Unify argument name of virDomainMigratePerform3()

The virDomainMigratePerform3() API declares its last argument as
'bandwidth', though throughout various typedefs, RPC and callback
implementations the name is changed to 'resource'. This creates a
confusion. Unify the name.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 days agosrc: Unify argument name of virDomainMigrateBegin3()
Michal Privoznik [Wed, 4 Jun 2025 14:28:41 +0000 (16:28 +0200)] 
src: Unify argument name of virDomainMigrateBegin3()

The virDomainMigrateBegin3() API declares its last argument as
'bandwidth', though throughout various typedefs, RPC and callback
implementations the name is changed to 'resource'. This creates a
confusion. Unify the name.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 days agosrc: Unify argument name of virDomainMigratePrepareTunnel3()
Michal Privoznik [Thu, 5 Jun 2025 08:17:45 +0000 (10:17 +0200)] 
src: Unify argument name of virDomainMigratePrepareTunnel3()

The virDomainMigratePrepareTunnel3() API declares one of its
argument as 'bandwidth', though throughout various typedefs, RPC
and callback implementations the name is changed to 'resource'.
This creates a confusion. Unify the name.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 days agosrc: Unify argument name of virDomainMigratePrepare3()
Michal Privoznik [Thu, 5 Jun 2025 07:48:14 +0000 (09:48 +0200)] 
src: Unify argument name of virDomainMigratePrepare3()

The virDomainMigratePrepare3() API declares one of its argument
as 'bandwidth', though throughout various typedefs, RPC and
callback implementations the name is changed to 'resource'. This
creates a confusion. Unify the name.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 days agosrc: Unify argument name of virDomainMigratePrepareTunnel()
Michal Privoznik [Thu, 5 Jun 2025 07:45:49 +0000 (09:45 +0200)] 
src: Unify argument name of virDomainMigratePrepareTunnel()

The virDomainMigratePrepareTunnel() API declares one of its
argument as 'bandwidth', though throughout various typedefs, RPC
and callback implementations the name is changed to 'resource'.
This creates a confusion. Unify the name.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 days agosrc: Unify argument name of virDomainMigratePrepare2()
Michal Privoznik [Thu, 5 Jun 2025 07:43:04 +0000 (09:43 +0200)] 
src: Unify argument name of virDomainMigratePrepare2()

The virDomainMigratePrepare2() API declares one of its argument as
'bandwidth', though throughout various typedefs, RPC and callback
implementations the name is changed to 'resource'. This creates a
confusion. Unify the name.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 days agosrc: Unify argument name of virDomainMigratePerform()
Michal Privoznik [Thu, 5 Jun 2025 07:37:28 +0000 (09:37 +0200)] 
src: Unify argument name of virDomainMigratePerform()

The virDomainMigratePerform() API declares its last argument as
'bandwidth', though throughout various typedefs, RPC and callback
implementations the name is changed to 'resource'. This creates a
confusion. Unify the name.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 days agosrc: Unify argument name of virDomainMigratePrepare()
Michal Privoznik [Thu, 5 Jun 2025 07:31:26 +0000 (09:31 +0200)] 
src: Unify argument name of virDomainMigratePrepare()

The virDomainMigratePrepare() API declares its last argument as
'bandwidth', though throughout various typedefs, RPC and callback
implementations the name is changed to 'resource'. This creates a
confusion. Unify the name.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 days agoPost-release version bump to 11.6.0
Jiri Denemark [Tue, 1 Jul 2025 09:24:34 +0000 (11:24 +0200)] 
Post-release version bump to 11.6.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
6 days agoRelease of libvirt-11.5.0 v11.5.0
Jiri Denemark [Tue, 1 Jul 2025 09:21:40 +0000 (11:21 +0200)] 
Release of libvirt-11.5.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
6 days agoTranslated using Weblate (Portuguese)
Américo Monteiro [Tue, 1 Jul 2025 05:48:06 +0000 (05:48 +0000)] 
Translated using Weblate (Portuguese)

Currently translated at 3.0% (339 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Américo Monteiro <a_monteiro@gmx.com>
Translated using Weblate (Portuguese)

Currently translated at 2.8% (307 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Américo Monteiro <a_monteiro@gmx.com>
Translated using Weblate (Portuguese)

Currently translated at 2.8% (307 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Américo Monteiro <a_monteiro@gmx.com>
Translated using Weblate (Portuguese)

Currently translated at 2.8% (307 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Américo Monteiro <a_monteiro@gmx.com>
Translated using Weblate (Portuguese)

Currently translated at 2.8% (309 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Américo Monteiro <a_monteiro@gmx.com>
Translated using Weblate (Portuguese)

Currently translated at 2.8% (309 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/pt/

Signed-off-by: Américo Monteiro <a_monteiro@gmx.com>
7 days agoNEWS: document new AMD IOMMU device
Ján Tomko [Mon, 30 Jun 2025 13:44:39 +0000 (15:44 +0200)] 
NEWS: document new AMD IOMMU device

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
7 days agoNEWS: Mention 'virsh await' and proper emulation of USB cdroms
Peter Krempa [Mon, 30 Jun 2025 12:05:00 +0000 (14:05 +0200)] 
NEWS: Mention 'virsh await' and proper emulation of USB cdroms

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
7 days agoNEWS: Mention shared filesystem detection fix
Jiri Denemark [Mon, 30 Jun 2025 09:54:44 +0000 (11:54 +0200)] 
NEWS: Mention shared filesystem detection fix

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
7 days agoNEWS: Document features/improvements/bug fixes I've participated in
Michal Privoznik [Mon, 30 Jun 2025 08:37:57 +0000 (10:37 +0200)] 
NEWS: Document features/improvements/bug fixes I've participated in

There are some features/improvements/bug fixes I've either
contributed or reviewed/merged. Document them for upcoming
release.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
10 days agoTranslated using Weblate (Korean) v11.5.0-rc2
김인수 [Fri, 27 Jun 2025 10:18:40 +0000 (10:18 +0000)] 
Translated using Weblate (Korean)

Currently translated at 100.0% (10937 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/ko/

Signed-off-by: 김인수 <simmon@nplob.com>
10 days agoTranslated using Weblate (Korean)
김인수 [Fri, 27 Jun 2025 09:23:40 +0000 (09:23 +0000)] 
Translated using Weblate (Korean)

Currently translated at 99.9% (10930 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/ko/

Signed-off-by: 김인수 <simmon@nplob.com>
Translated using Weblate (Korean)

Currently translated at 99.7% (10915 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/ko/

Signed-off-by: 김인수 <simmon@nplob.com>
10 days agoTranslated using Weblate (Ukrainian)
Yuri Chornoivan [Fri, 27 Jun 2025 09:23:40 +0000 (09:23 +0000)] 
Translated using Weblate (Ukrainian)

Currently translated at 100.0% (10937 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/uk/

Signed-off-by: Yuri Chornoivan <yurchor@ukr.net>
Translated using Weblate (Ukrainian)

Currently translated at 99.9% (10932 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/uk/

Signed-off-by: Yuri Chornoivan <yurchor@ukr.net>
Translated using Weblate (Ukrainian)

Currently translated at 99.8% (10920 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/uk/

Signed-off-by: Yuri Chornoivan <yurchor@ukr.net>
Translated using Weblate (Ukrainian)

Currently translated at 99.6% (10902 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/uk/

Signed-off-by: Yuri Chornoivan <yurchor@ukr.net>
Translated using Weblate (Ukrainian)

Currently translated at 99.6% (10901 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/uk/

Signed-off-by: Yuri Chornoivan <yurchor@ukr.net>
10 days agoTranslated using Weblate (Spanish)
Nicolás Gal [Fri, 27 Jun 2025 09:23:39 +0000 (09:23 +0000)] 
Translated using Weblate (Spanish)

Currently translated at 53.6% (5867 of 10937 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/es/

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
13 days agoUpdate translation files
Weblate [Tue, 24 Jun 2025 15:02:51 +0000 (15:02 +0000)] 
Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/

Signed-off-by: Fedora Weblate Translation <i18n@lists.fedoraproject.org>
13 days agopo: Refresh potfile for v11.5.0 v11.5.0-rc1
Jiri Denemark [Tue, 24 Jun 2025 14:55:43 +0000 (16:55 +0200)] 
po: Refresh potfile for v11.5.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
13 days agoqemuxmlconftest: Add 'disk-usb-device-model' case
Peter Krempa [Tue, 24 Jun 2025 13:48:47 +0000 (15:48 +0200)] 
qemuxmlconftest: Add 'disk-usb-device-model' case

Add a test case for explicitly selected USB disk models.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
13 days agoqemu: Replace usb-storage with usb-bot
Akihiko Odaki [Sat, 8 Mar 2025 05:57:41 +0000 (14:57 +0900)] 
qemu: Replace usb-storage with usb-bot

usb-storage is a compound device that automatically creates a USB mass
storage device and a SCSI device as its backend. Unfortunately it lacks
some configuration options that are usually present with a SCSI device,
and cannot represent CD-ROM in particular.

Replace usb-storage with usb-bot, which can be combined with a manually
created SCSI device. libvirt will configure the SCSI device in a way
identical with how QEMU does for usb-storage except that now it respects
a configuration option to represent CD-ROM.

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/368
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
13 days agoqemuxmlconftest: Prepare for proper testing in 'disk-cdrom-usb-empty'
Peter Krempa [Mon, 23 Jun 2025 14:14:05 +0000 (16:14 +0200)] 
qemuxmlconftest: Prepare for proper testing in 'disk-cdrom-usb-empty'

Modify the validation of empty cdroms to trigger only for
VIR_DOMAIN_DISK_MODEL_USB_STORAGE as with 'usb-bot' we can properly
emulate a cdrom.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
13 days agoqemu: monitor: Introduce 'qemuMonitorSetUSBDiskAttached'
Peter Krempa [Thu, 19 Jun 2025 13:58:44 +0000 (15:58 +0200)] 
qemu: monitor: Introduce 'qemuMonitorSetUSBDiskAttached'

The helper sets the 'attached' property of the 'usb-bot' device to true,
which will be used on the hotplug code path.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
13 days agoqemuBuildDeviceAddresDriveProps: Prepare for 'drive' address for usb-bot disks
Peter Krempa [Thu, 19 Jun 2025 07:46:38 +0000 (09:46 +0200)] 
qemuBuildDeviceAddresDriveProps: Prepare for 'drive' address for usb-bot disks

While the 'usb-storage' based disks use the USB address directly, with
'usb-bot' the USB address is on the "controller" part of the device and
the 'scsi-hd/cd' device will use a 'drive' address from qemu's PoV.

Since we do not want to expose the 'usb-bot' as explicit controller
to preserve compatibility with existing configs we plan to upgrade
implement the formatter for 'drive' address when the "diskbus" property
is VIR_DOMAIN_DISK_BUS_USB.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
13 days agoqemu: Fill in model of 'usb' disks to preserve ABI compatibility
Peter Krempa [Mon, 23 Jun 2025 15:51:16 +0000 (17:51 +0200)] 
qemu: Fill in model of 'usb' disks to preserve ABI compatibility

While 'usb-bot' and 'usb-storage' are ABI and migration compatible for
disks it's not the case for cdroms. When migrating from a new config
using 'usb-bot' to an older daemon which would use 'usb-storage' the
guest os will get I/O errors.

Thus we must properly fill in models for 'usb' disks so that cdroms can
be handled properly.

When parsing XML fill in the models and drop the appropriate models when
formatting migratable XML.

The logic is explained in comments in the code.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
13 days agoconf: introduce usb disk models 'usb-storage' and 'usb-bot'
Peter Krempa [Thu, 19 Jun 2025 13:46:46 +0000 (15:46 +0200)] 
conf: introduce usb disk models 'usb-storage' and 'usb-bot'

Historically libvirt specified 'usb-storage' as driver for USB disks.
This though combined with '-blockdev' doesn't properly configure the
device to look like CDROM for <disk type='cdrom'>.

'usb-bot' acts like a controler and allows explicitly connecting a
-device to it.

In qemu the devices share implementation so they are effectively
identical and can be used interchangably. There is a difference in how
the storage device itself (the SCSI part) looks when configured properly
as CDROM which is unfortunately not compatible/interchangable.

As this is effectively a bugfix we'll be fixing the behaviour for the
default configuration. The possibility to explicitly set the model is
added as a possibility for working around possible problems if they'd
appear.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
13 days agoqemuxmlconftest: Invoke "disk-usb-device" case also without QEMU_CAPS_DEVICE_USB_BOT...
Peter Krempa [Thu, 19 Jun 2025 13:31:46 +0000 (15:31 +0200)] 
qemuxmlconftest: Invoke "disk-usb-device" case also without QEMU_CAPS_DEVICE_USB_BOT and with ABI_UPDATE

The QEMU_CAPS_DEVICE_USB_BOT device can be compiled out but
realistically it makes no sense to do it thus also makes no sense to
have another variant of input data for it.

Add another invocation of "disk-usb-device" clearing QEMU_CAPS_DEVICE_USB_BOT
to show the fallback code paths.

Also add "ABI_UPDATE" version for the two cases above as the ABI of
usb-bot cdrom is not migration-compatible and we'll be wanting to update
to the fixed configuration.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
13 days agoqemu_capabilities: Introduce QEMU_CAPS_DEVICE_USB_BOT
Akihiko Odaki [Sat, 8 Mar 2025 05:57:40 +0000 (14:57 +0900)] 
qemu_capabilities: Introduce QEMU_CAPS_DEVICE_USB_BOT

usb-bot is supported by all supported QEMU versions; it is present since
1.4.0 and libvirt supports 4.2.0 or later.

Add a capability just in case USB_STORAGE_BOT is disabled when building
QEMU.

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
13 days agoqemuxmlconftest: Distribute testing of 'removable' disk property
Peter Krempa [Thu, 19 Jun 2025 08:07:35 +0000 (10:07 +0200)] 
qemuxmlconftest: Distribute testing of 'removable' disk property

The 'removable' property is tested for 'usb' and 'scsi' disks. The test
case for 'usb' disks already has another test case for this, so add
testing of 'removable' SCSI disks into the 'disk-scsi' case and remove
the 'disk-device-removable' case completely.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
13 days agoqemuxmlconftest: Drop 'disk-cdrom-bus-other'
Peter Krempa [Thu, 19 Jun 2025 08:03:34 +0000 (10:03 +0200)] 
qemuxmlconftest: Drop 'disk-cdrom-bus-other'

The test case is now redundant since 'disk-usb-device' case also tests
all cdrom configurations. Remove it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
13 days agoqemusecuritytest: Use 'disk-usb-device' case instead of 'disk-cdrom-bus-other'
Peter Krempa [Thu, 19 Jun 2025 12:27:26 +0000 (14:27 +0200)] 
qemusecuritytest: Use 'disk-usb-device' case instead of 'disk-cdrom-bus-other'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
13 days agoqemuxmlconftest: Test various combinations of config
Peter Krempa [Thu, 19 Jun 2025 07:58:10 +0000 (09:58 +0200)] 
qemuxmlconftest: Test various combinations of config

Add multiple USB disks to the definition testing a matrix of 'disk' and
'cdrom' <disk> elements with user-aliases, 'serial' and 'removable'
properties configured.

This patch also removes the 'ide' disk which is not related to what
we're testing here.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
13 days agoqemuhotplugtest: Use VIR_DOMAIN_DEF_PARSE_ABI_UPDATE for virDomainDeviceDefParse
Peter Krempa [Mon, 23 Jun 2025 16:26:19 +0000 (18:26 +0200)] 
qemuhotplugtest: Use VIR_DOMAIN_DEF_PARSE_ABI_UPDATE for virDomainDeviceDefParse

The qemu hotplug code parses the device with ABI updates enabled so
qemuhotplugtest ought to do the same.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
13 days agoTranslated using Weblate (Spanish)
Nicolás Gal [Mon, 23 Jun 2025 15:48:32 +0000 (15:48 +0000)] 
Translated using Weblate (Spanish)

Currently translated at 53.6% (5862 of 10925 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/es/

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
13 days agoutil: workaround libxml2 lack of thread safe initialization
Daniel P. Berrangé [Mon, 23 Jun 2025 10:50:47 +0000 (11:50 +0100)] 
util: workaround libxml2 lack of thread safe initialization

The main XML parser code global initializer historically had a mutex
protecting it, and more recently uses a pthread_once. The RelaxNG
code, however, relies on two other global initializers that are
not thread safe, just relying on setting an integer "initialized"
flag.

Calling the relevant initializers from libvirt in a protected global
initializer will protect libvirt's own concurrent usage, however, it
cannot protect against other libraries loaded in process that might
be using libxml2's schema code. Fortunately:

 * The chances of other loaded non-libvirt code using libxml is
   relatively low
 * The chances of other loaded non-libvirt code using the schema
   validation / catalog functionality inside libxml is even
   lower
 * The chances of both libvirt and the non-libvirt usage having
   their *1st* usage of libxml2 be concurrent is tiny

IOW, in practice, although our solution doesn't fully fix the thread
safety, it is good enough.

libxml2 should none the less still be fixed to make its global
initializers be thread safe without special actions by its API
consumers[1].

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/788
[1] https://gitlab.gnome.org/GNOME/libxml2/-/merge_requests/326
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
13 days agoconf: add passthrough and xtsup attributes for IOMMU
Ján Tomko [Fri, 14 Mar 2025 16:13:31 +0000 (17:13 +0100)] 
conf: add passthrough and xtsup attributes for IOMMU

For the newly supported AMD device.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
13 days agoqemu: add IOMMU model amd
Ján Tomko [Fri, 14 Mar 2025 16:13:09 +0000 (17:13 +0100)] 
qemu: add IOMMU model amd

Introduce a new IOMMU device model 'amd', both the parser
and the formatter for QEMU because of our enum warnings.

https://issues.redhat.com/browse/RHEL-50560

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
13 days agodocs: formatdomain: document intel-only IOMMU attributes
Ján Tomko [Wed, 19 Mar 2025 00:55:02 +0000 (01:55 +0100)] 
docs: formatdomain: document intel-only IOMMU attributes

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
13 days agoqemu: introduce QEMU_CAPS_PCI_ID
Ján Tomko [Wed, 12 Mar 2025 15:22:25 +0000 (16:22 +0100)] 
qemu: introduce QEMU_CAPS_PCI_ID

Introduced by QEMU commit f864a3235ea1d1d714b3cde2d9a810ea6344a7b5
the presence of this attribute allows libvirt to specify the alias
of the AMDVI-PCI device explicitly.

(It was implicit before the introduction of this attribute)

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
13 days agoqemu: introduce QEMU_CAPS_AMD_IOMMU
Ján Tomko [Wed, 12 Mar 2025 15:10:31 +0000 (16:10 +0100)] 
qemu: introduce QEMU_CAPS_AMD_IOMMU

Check for the presence of the amd-iommu device, so we can conditionalize
probing for its properties.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 weeks agoNEWS: mention console type in domain capabilities
Roman Bogorodskiy [Thu, 19 Jun 2025 18:15:40 +0000 (20:15 +0200)] 
NEWS: mention console type in domain capabilities

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 weeks agovirSocketAddrPrefixToNetmask: Prevent undefined behaviour on bitshifts on signed...
Peter Krempa [Wed, 18 Jun 2025 06:29:01 +0000 (08:29 +0200)] 
virSocketAddrPrefixToNetmask: Prevent undefined behaviour on bitshifts on signed integer

Shifting bits into the sign bit is undefined behaviour in C although
both gcc and clang handle it as expected.

Since the value is used as unsigned convert it to unsigned int. For code
readability use 'if' statement instead of a ternary.

Closes: https://gitlab.com/libvirt/libvirt/-/issues/785
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2 weeks agotlscert: Don't force 'keyEncipherment' for ECDSA and ECDH
Peter Krempa [Tue, 17 Jun 2025 13:01:26 +0000 (15:01 +0200)] 
tlscert: Don't force 'keyEncipherment' for ECDSA and ECDH

Per RFC8813 [1] which amends RFC5580 [2] ECDSA, ECDH, and ECMQV
algorithms must not have 'keyEncipherment' present, but our code did
check it. Add exemption for known algorithms which don't use it.

[1] https://datatracker.ietf.org/doc/rfc8813/
[2] https://datatracker.ietf.org/doc/rfc5480

Closes: https://gitlab.com/libvirt/libvirt/-/issues/691
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 weeks agostorage: disk: Properly handle partition numbers separated by 'p'
Peter Krempa [Tue, 17 Jun 2025 08:42:52 +0000 (10:42 +0200)] 
storage: disk: Properly handle partition numbers separated by 'p'

The 'p' separator for partitions is now common also for NVMe devices.
Fix the algorithm to extract the partition number to always consider it.

The fix is based on suggestion in the issue mentioned below.

Closes: https://gitlab.com/libvirt/libvirt/-/issues/239
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 weeks agostorage: parthelper: Use if/else instead of ternary operator
Peter Krempa [Tue, 17 Jun 2025 08:29:05 +0000 (10:29 +0200)] 
storage: parthelper: Use if/else instead of ternary operator

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 weeks agovirshPrintJobProgress: Don't rewrite migration status line on non-terminals
Peter Krempa [Tue, 17 Jun 2025 08:00:20 +0000 (10:00 +0200)] 
virshPrintJobProgress: Don't rewrite migration status line on non-terminals

On non-terminals print each progress report on a new line. Fix based on
suggestion in the issue report.

Closes: https://gitlab.com/libvirt/libvirt/-/issues/756
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 weeks agovirQEMUCapsFindBinary: Refactor local variables
Peter Krempa [Fri, 6 Jun 2025 10:32:37 +0000 (12:32 +0200)] 
virQEMUCapsFindBinary: Refactor local variables

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>