1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-12-06 00:24:43 +03:00

Compare commits

...

356 Commits

Author SHA1 Message Date
Jiri Denemark
cd16a1e913 Release of libvirt-11.10.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2025-12-01 11:57:01 +01:00
Fco. Javier F. Serrador
c7733935a5 Translated using Weblate (Spanish)
Currently translated at 79.1% (8713 of 11005 strings)

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

Signed-off-by: "Fco. Javier F. Serrador" <fserrador@gmail.com>
2025-11-30 17:58:34 +00:00
Peter Krempa
2504f6f99b NEWS: Mention CVE-2025-13193 and improvements for block stats/config and backups
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2025-11-28 16:48:51 +01:00
Daniel P. Berrangé
f625585788 rpm: disable QEMU driver on non-64-bit arches for Fedora >= 44
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2025-11-28 15:00:10 +01:00
Daniel P. Berrangé
ad76c59450 news: document improved certs, host validate details & TDX fix
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2025-11-28 14:58:51 +01:00
Jiri Denemark
54f3472d72 formatdomaincaps: Fix typo in Hyper-V Enlightenments section
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-28 14:56:29 +01:00
Jiri Denemark
e60c21fc3f NEWS: Fix incoming migration to QEMU 10.0.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2025-11-28 14:56:19 +01:00
Martin Kletzander
6cd0d7951a NEWS: Add CVE-2025-12748
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2025-11-28 11:03:08 +01:00
Michal Privoznik
70f5a75f78 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>
2025-11-27 15:03:09 +01:00
Daniel P. Berrangé
df0d1c915d src: fix redundant/misleading build conditional for KVM MSR code
The condition

   WITH_LINUX_KVM_H && (defined(__linux__) || defined(__FreeBSD__))

is redundant. If the meson check for linux/kvm.h succeeded, we
must be on a Linux host and cannot be on a FreeBSD host. Remove
these redundant OS conditions from the MSR code to stop misleading
readers.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-11-27 12:54:09 +00:00
jianqing yan
40f5e37ff3 Translated using Weblate (Chinese (Simplified) (zh_CN))
Currently translated at 97.8% (10763 of 11005 strings)

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

Signed-off-by: jianqing yan <yanjianqing@kylinos.cn>
2025-11-27 06:58:32 +00:00
Yuri Chornoivan
6b1a32f1cc Translated using Weblate (Ukrainian)
Currently translated at 100.0% (11005 of 11005 strings)

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

Signed-off-by: Yuri Chornoivan <yurchor@ukr.net>
2025-11-27 06:58:31 +00:00
Américo Monteiro
67b8836be1 Translated using Weblate (Portuguese)
Currently translated at 100.0% (11005 of 11005 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 100.0% (11005 of 11005 strings)

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

Signed-off-by: Américo Monteiro <a_monteiro@gmx.com>
2025-11-27 06:58:31 +00:00
김인수
2e727417ac Translated using Weblate (Korean)
Currently translated at 100.0% (11005 of 11005 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% (10972 of 11005 strings)

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

Signed-off-by: 김인수 <simmon@nplob.com>
2025-11-27 06:58:30 +00:00
Michal Privoznik
e2a0af28df ci: refresh with 'lcitool manifest'
- Add AlmaLinux 10
- Add CentOS Stream 10
- Add Fedora 43
- Remove EOL Fedora 41
- Switch mingw from Fedora 42 to Fedora 43
- Switch integration tests from Fedora 41 to Fedora 43

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-11-25 16:18:06 +01:00
Praveen K Paladugu
c58ee467ad NEWS: Document Hyper-V virttype for Qemu Domains
Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-11-25 14:26:44 +01:00
Hosted Weblate
ead8915a7e 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>
2025-11-25 12:21:36 +00:00
Jiri Denemark
faa5c69899 po: Refresh potfile for v11.10.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2025-11-25 13:10:14 +01:00
Salvatore Cocuzza
44118a7a70 Translated using Weblate (Italian)
Currently translated at 70.4% (7734 of 10976 strings)

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

Signed-off-by: Salvatore Cocuzza <info@salvatorecocuzza.it>
2025-11-25 09:09:49 +00:00
Renan Birck Pinheiro
a4563be866 Translated using Weblate (Portuguese (Brazil))
Currently translated at 44.0% (4837 of 10976 strings)

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

Signed-off-by: Renan Birck Pinheiro <renan.birck.pinheiro@gmail.com>

Translated using Weblate (Portuguese (Brazil))

Currently translated at 44.0% (4834 of 10976 strings)

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

Signed-off-by: Renan Birck Pinheiro <renan.birck.pinheiro@gmail.com>
2025-11-25 09:09:49 +00:00
jianqing yan
18cbdffec7 Translated using Weblate (Chinese (Simplified) (zh_CN))
Currently translated at 97.8% (10739 of 10976 strings)

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

Signed-off-by: jianqing yan <yanjianqing@kylinos.cn>
2025-11-25 09:09:48 +00:00
Pavel Borecki
7f343d454b Translated using Weblate (Czech)
Currently translated at 94.4% (10365 of 10976 strings)

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

Signed-off-by: Pavel Borecki <pavel.borecki@gmail.com>

Translated using Weblate (Czech)

Currently translated at 94.4% (10367 of 10976 strings)

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

Signed-off-by: Pavel Borecki <pavel.borecki@gmail.com>
2025-11-25 09:09:48 +00:00
Weblate
cec8eb4a49 Translated using Weblate (Czech)
Currently translated at 94.4% (10367 of 10976 strings)

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

Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>

Translated using Weblate (Czech)

Currently translated at 94.4% (10367 of 10976 strings)

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

Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>

Translated using Weblate (Czech)

Currently translated at 94.4% (10367 of 10976 strings)

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

Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>

Translated using Weblate (Czech)

Currently translated at 94.4% (10367 of 10976 strings)

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

Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>

Translated using Weblate (Czech)

Currently translated at 94.4% (10367 of 10976 strings)

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

Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>

Translated using Weblate (Czech)

Currently translated at 94.4% (10367 of 10976 strings)

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

Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>

Translated using Weblate (Czech)

Currently translated at 94.4% (10367 of 10976 strings)

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

Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>

Translated using Weblate (Czech)

Currently translated at 94.4% (10367 of 10976 strings)

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

Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>

Translated using Weblate (Czech)

Currently translated at 94.4% (10367 of 10976 strings)

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

Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>

Translated using Weblate (Czech)

Currently translated at 94.4% (10367 of 10976 strings)

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

Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>

Translated using Weblate (Czech)

Currently translated at 94.4% (10367 of 10976 strings)

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

Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>

Translated using Weblate (Czech)

Currently translated at 94.4% (10367 of 10976 strings)

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

Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>

Translated using Weblate (Czech)

Currently translated at 94.4% (10367 of 10976 strings)

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

Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>

Translated using Weblate (Czech)

Currently translated at 94.4% (10367 of 10976 strings)

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

Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>
2025-11-25 09:09:48 +00:00
김인수
afcfc6b8c4 Translated using Weblate (Korean)
Currently translated at 100.0% (10976 of 10976 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.9% (10975 of 10976 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 100.0% (10976 of 10976 strings)

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

Signed-off-by: 김인수 <simmon@nplob.com>
2025-11-25 09:09:48 +00:00
Américo Monteiro
8a16508bdb Translated using Weblate (Portuguese)
Currently translated at 100.0% (10976 of 10976 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 100.0% (10976 of 10976 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 99.8% (10964 of 10976 strings)

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

Signed-off-by: Américo Monteiro <a_monteiro@gmx.com>
2025-11-25 09:09:48 +00:00
Peter Krempa
33b512a7de qemuxmlconftest: Update 'aarch64' tests using 'virt-4.2' machine type
In the upcoming qemu-10.2 release the 'virt-4.2' machine type will be
removed.

To preserve the spirit of the test pin the existing test to qemu-10.0
and add a new version using 'virt-10.0' machine type.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2025-11-25 10:08:47 +01:00
Peter Krempa
f6212a4ff2 qemuxmlconftest: Update 'aarch64' tests using 'virt-4.0' machine type
In the upcoming qemu-10.2 release the 'virt-4.0' machine type will be
removed. Update all existing tests which use it to 'virt-10.0' which is
currently present in our caps dump.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2025-11-25 10:08:47 +01:00
Peter Krempa
3fab3ea57e qemucapabilitiestest: Update 'caps_10.2.0_x86_64' to 'v10.2.0-rc1-38-gfb241d0a1f'
Notable changes:
 - New 'postcopy-device' migration state
 - New 'exit-with-parent' option
 - Features 'guest_tunnel_csum', 'host_tunnel', 'host_tunnel_csum',
   'guest_tunnel' of 'virtio-net-pci' are now enabled by default
 - 'extended-tseg-mbytes' is now 64 for 'mch' device

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2025-11-25 10:08:47 +01:00
Roman Bogorodskiy
59685009ee NEWS: mention VNC 'wait' attribute for bhyve
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2025-11-24 18:01:49 +01:00
Roman Bogorodskiy
3a2127bef1 docs: bhyve: document VNC's wait attribute
Document the new VNC's 'wait' attribute in formatdomain.rst and
drvbhyve.rst.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2025-11-24 18:01:38 +01:00
Peter Krempa
4176cdc978 spec: Fix 'libvirt-daemon-driver-storage-zfs' on Fedora 43 and newer
On Fedora 43 and newer the 'fuse-zfs' package was removed. Commit
bd30147e74 added an 'Obsoletes' directive so that the storage driver
core package will update properly but hardcoded the obsoleted version
as 11.4 (when the change was comitted) similarly to the old sheepdog/rbd
packages and disabled the build.

Now it is still possible to obtain ZFS support from other means and it
may be useful for users to have libvirt's ZFS backend. This patch thus:

 - re-enables build of 'libvirt-daemon-driver-storage-zfs' on Fedora
 - removes 'libvirt-daemon-driver-storage-zfs' as 'Requires dependency
   from 'daemon-driver-storage' meta-package on Fedora 43 and newer
 - removes dependancy on '/sbin/zpool' and '/sbin/zfs' on Fedora 43
   and newer

With this the package still is built and installable but will require
users to get their ZFS support installed somehow.

Fixes: bd30147e74
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2025-11-24 17:07:21 +01:00
Peter Krempa
c1576ad519 Add support for 'dpofua' setting for SCSI disks
Add the 'dpofua' setting in the XML and for the qemu driver.

DPO - Disable Page Out and FUA - Force Unit Access are two features
implemented by SCSI disks (either both together or neither of them)
which influence how caching is handled. QEMU provides a good default
but in certain specific occasions changing the default may have
performance benefits.

Add support for setting them via the XML.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2025-11-24 16:40:32 +01:00
Peter Krempa
b1a2ea971d virDomainDiskDefCheckABIStability: Add missing check for 'removable' property
The 'removable' state is guest-visible.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2025-11-24 16:40:32 +01:00
Peter Krempa
eadbb34a8f docs: page.xsl: Convert repository edit URI into a parameter
Allow other sub-projects using the XSL template without modification.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-11-24 16:40:24 +01:00
Peter Krempa
361106506b docs: site.xsl: Use separate 'asset_href_base' and 'link_href_base'
While our main page uses same argument for both to ensure that the
linking works also when browsed locally sub-projects such as
libvirt-wiki and libvirt-security-notice will want to pull 'site.xsl' as
is into their build assets. Pass both arguments via the build system so
that we don't have to carry distinct instances.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-11-24 16:40:24 +01:00
Peter Krempa
071d29b726 docs: css: Split out any main-page CSS to local.css
Our other sub-projects such as the libvirt-wiki and soon also the
libvirt-security-notices will use the same CSS via asset import script.

Move any specifics into 'local.css' which will be defined by the
sub-projects so that 'main.css' can be imported directly.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-11-24 16:40:24 +01:00
Peter Krempa
5ca7270c08 docs: index: Link to security notices from home page
Our main page mentions security notices which we host at
https://security.libvirt.org but links to them only from the security
process page. Since we already have the wording there, turn it directly
into a link.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-11-24 16:40:24 +01:00
Peter Krempa
895a973c49 kbase: Add note about preserving VM on shutdown to backup article
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-11-24 16:40:24 +01:00
Peter Krempa
eca6a92a6d qemu: backup: Add support for VIR_DOMAIN_BACKUP_BEGIN_PRESERVE_SHUTDOWN_DOMAIN
Implement the support for VIR_DOMAIN_BACKUP_BEGIN_PRESERVE_SHUTDOWN_DOMAIN
which will keep the qemu process around while the backup is still
running.

The above is achieved by avoiding killing the qemu process in the
shutdown qemu monitor event handlers. Instead 'system_reset' QMP command
is issued and the domain object is transitioned into _PAUSED state in
sync with what qemu does.

Now once the backup job finishes (or is cancelled e.g. for pull mode
backups) the backup job termination code re-asseses if the qemu process
needs to be killed or the VM was re-started by un-pausing.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-11-24 16:40:24 +01:00
Peter Krempa
56432ed065 lib: Introduce VIR_DOMAIN_BACKUP_BEGIN_PRESERVE_SHUTDOWN_DOMAIN flag
This flag will instruct the hypervisor driver to keep the VM around
while the backup is running if the guest OS decides to shut down, so
that the backup can be finished.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-11-24 16:40:24 +01:00
Peter Krempa
4453331b89 lib: Introduce VIR_DOMAIN_EVENT_SUSPENDED_GUEST_SHUTDOWN event reason
Upcoming patches will introduce the possibility for the domain to be
kept paused after the guest OS shuts itself down. It'll allow jobs
such as backup to finish as e.g. in the qemu driver it requires the qemu
process.

Add an the appropriate reason for the VIR_DOMAIN_EVENT_SUSPENDED
lifecycle event.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-11-24 16:40:24 +01:00
Peter Krempa
8e5b0cd450 qemuBlockJobProcessEventConcludedBackup: Notify the backup job later
Move the notification to the backup job after finishing the cleanup of
the current block job the backup operation consists of.

Currently the termination of the blockjob would e.g. delete the scratch
files before they are detached from qemu.

In later patches the termination of the backup job may cause the qemu
process to be killed (if the guest OS shut down but the qemu process
was being kept alive to finish the backup) which would cause errors in
the monitor commands for dismissing the block job.

Since the NBD server still needs to be terminated first as otherwise
the scratch files can't be unplugged from qemu we need to split the
operation into two. First the NBD server is terminated, then the
current block job is finalized and then the backup job is notified.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-11-24 16:40:24 +01:00
Peter Krempa
0fe378f1b1 qemu: backup: Don't attempt to stop the NBD server twice
When notifying the backup code about termination of the block job which
is part of a backup operation the code attempts to terminate the NBD
server. This is done for every blockjob so could cause us to attempt to
terminate the NBD server multiple times which doesn't cause problems but
generates spurious errors.

Add a flag that the NBD server was stopped and do it just once. Don't
bother storing the flag in the status XML as it's just for the shutdown
phase.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-11-24 16:40:24 +01:00
Peter Krempa
7d90085e12 qemuProcessReconnect: Continue reconnection if VM untergoes fake-reboot
'qemuProcessShutdownOrReboot' may or may not kill the VM. In
'qemuProcessReconnect' if we decided that the VM was in a state
requiring 'qemuProcessShutdownOrReboot' to be called we'd stop the
reconnection unconditionally.

Now if the VM ought to undergo a fake reboot we really need to reconnect
to the process because the process will be kept around for much longer.

Make qemuProcessShutdownOrReboot return whether it killed the VM and
continue the reconnection if it didn't.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-11-24 16:40:24 +01:00
Peter Krempa
18ceb1002d virDomainNestedJobAllowed: Allow VIR_JOB_MODIFY_MIGRATION_SAFE if VIR_JOB_MODIFY is allowed
The VIR_JOB_MODIFY_MIGRATION_SAFE is supposed to be a subset of _MODIFY
jobs which are allowed during migration.

Now with async jobs which allow VIR_JOB_MODIFY (namely the backup job)
it shouldn't be required to explicitly mention
VIR_JOB_MODIFY_MIGRATION_SAFE since we already allow everything.

Adjust the logic in virDomainNestedJobAllowed to accept
VIR_JOB_MODIFY_MIGRATION_SAFE if VIR_JOB_MODIFY is allowed so that other
places can simply allow the latter.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-11-24 16:40:24 +01:00
Daniel P. Berrangé
baf5f7b0ee qemu: always report s390 prot-virt feature in domain caps
Our preference is to unconditionally report all features known
to libvirt code, rather than pre-filter them by architecture.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-11-24 15:05:09 +00:00
Daniel P. Berrangé
e98a12d133 qemu: always report TDX feature caps on x86
Currently domain capabilities will only ever report

    <tdx supported='yes'/>

so it is not possible to determine whether libvirt itself is
new enough to have TDX support or not, vs the host OS lacking
it.

For SEV and s390 prot-virt, the capability is always reported
whether supported or not, so do likewise for TDX, so other
x86 hosts get:

    <tdx supported='no'/>

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-11-24 15:05:09 +00:00
Daniel P. Berrangé
62d14ba496 qemu: correctly detect working TDX support
Querying existence of the 'tdx-guest' type merely tells us whether
QEMU has been compiled with TDX support, not whether it is usable
on the host. Thus QEMU was incorrectly reporting

    <tdx supported='yes'/>
    ...
    <launchSecurity supported='yes'>
      <enum name='sectype'>
        <value>tdx</value>
      </enum>
    </launchSecurity>

on every platform with new enough QEMU.

Unfortunately an earlier patch for a 'query-tdx-capabilities' QMP
command in QEMU was dropped, so there is no way to ask QEMU whether
it can launch a TDX guest. Libvirt must directly query the KVM
device and ask for supported VM types.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-11-24 15:05:09 +00:00
Daniel P. Berrangé
dac28c6185 docs: describe support for multiple certs & PQC config
This describes the new index based certificate naming scheme, and
how to create & deploy certificates for post-quantum cryptography.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-11-24 15:05:09 +00:00
Daniel P. Berrangé
59a65f4987 rpc: support loading multiple certificate identities
In addition to servercert.pem / serverkey.pem, we now also support
loading servercert{N}.pem / serverkey{N}.pem, for values of {N}
between 0 and 3 inclusive.

If servercert0.pem is provided, then using servercert.pem becomes
optional. The first missing index terminates the loading process.
eg if servercert1.pem is NOT present, then it will NOT attempt to
look for servercert2.pem / servercert3.pem.

This also applies to clientcert.pem / clientkey.pem.

This facilitates the transition to post-quantum cryptography by
allowing loading of certificates with different algorithms,
eg traditional RSA based cert, and optional ECC based cert or
MLDSA based cert for PQC.

The use of CA cert files is unchanged with only a single cacert.pem
loaded. WHen multiple CAs are needed they must be concatenated in
the single cacert.pem file.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-11-24 15:05:09 +00:00
Daniel P. Berrangé
ba8e1720aa rpc: reduce duplication when locating credentials
The three different APIs for locating credentials differ only in
what directories they search and their policy for missing files.
Their code can be collapsed onto a single helper method. This
will greatly facilitate the subsequent patch that expands the
logic to locate many certificate files.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-11-24 15:05:09 +00:00
Daniel P. Berrangé
375ab122d5 rpc: move file access checks into TLS config API
A future patch will require fule access checks to be done
as part of locating the certificate files, as we will have
the ability to load many more files, most of which will be
optional.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-11-24 15:05:09 +00:00
Daniel P. Berrangé
88a7a57806 rpc: skip fallback when using custom PKI path
The virNetTLSConfigCustomCreds will always set the cert paths
to non-NULL strings. This in turn means that the later call to
virNetTLSConfigSystemCreds will be a no-op aside from duplicating
log information. Refactor the conditions so that the call to
find system credentials is skipped when using custom credentials.

While this patch could have just done an early "return 0" after
the virNetTLSConfigCustomCreds call, an "} else {" branch is
instead added, since this will facilitate a later patch in this
series which prefers a common return path.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-11-24 15:05:09 +00:00
Daniel P. Berrangé
289d554998 remote: support specifying multiple keys/certs in libvirtd.conf
The 'cert_file' and 'key_file' parameters in libvirtd.conf only
permit a single cert/key. To support hybrid deployments for PQC,
we need to be able to request multiple certs/keys. This involves
new 'cert_files' and 'key_files' config parameters that accept a
list of filenames. The new parameters are mutually exclusive with
the old parameters.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-11-24 15:05:09 +00:00
Daniel P. Berrangé
d249170bf6 rpc: add support for loading multiple certs & keys
In the transition to Post-Quantum Cryptography, it will often be
desirable to load multiple sets of certificates, some with RSA/ECC
and some with MLDSA. This extends the TLS context code to support
the loading of many certs, passed as a NULL terminated array.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-11-24 15:05:09 +00:00
Daniel P. Berrangé
74a664edd7 rpc: refactor TLS sanity checking to support many cert files
Future patches will make it possible to load multiple certificate
files. This prepares the sanity checking code to support that by
taking a NUL terminated array of cert filenames.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-11-24 15:05:09 +00:00
Daniel P. Berrangé
9aff986bc4 rpc: change 'isServer' parameter from 'int' to 'bool'
The callers are all passing in a 'bool' value, and this type
should be maintained rather than cast to 'int' and then
inpreted as a bool again later.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-11-24 15:05:09 +00:00
Daniel P. Berrangé
86143735a6 remote: use g_strfreev for free()ing lists of strings
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-11-24 15:05:09 +00:00
Aaron M. Brown
65d21c8692 domain_addr.c: update virtconsole port reservation comment and allowZero var
Rename variable "allowZero" to "allowPortZero" for clarity and update the virtconsole port reservation comment,
as port 0 is reserved for the first virtconsole unless specified.

Signed-off-by: Aaron M. Brown <aaronmbr@linux.ibm.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2025-11-24 15:40:57 +01:00
Aaron M. Brown
2083efe030 domain_addr.c: Fix virtio console port autoassign on virtio-serial bus
This change fixes an issue with virtio console port assignment on virtio-serial buses.
Currently, when trying to autoassign a virtio console device, the device cannot be
assigned to a port greater than 0 on virtio-serial buses.
You will receive the following error:

`virtio-serial-bus: A port already exists at id 0`

Therefore, the data needs to be passed back into info when allowZero is true.
We should also preserve the controller data when allowZero is true, and
propagate allowZero into virDomainVirtioSerialAddrNextFromController
to get an appropriate startPort.

Fixes: 16db8d2e ("Add functions to track virtio-serial addresses")
Signed-off-by: Aaron M. Brown <aaronmbr@linux.ibm.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2025-11-24 15:40:57 +01:00
Aaron M. Brown
22059030f9 tests: Add console-virtio-serial-autoassign-address tests
Add test coverage for multiple virtio consoles on a virtio-serial controller.
This test makes sure that multiple virtconsoles get auto-assigned appropriate
port numbers on a virtio-serial-bus.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Aaron M. Brown <aaronmbr@linux.ibm.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2025-11-24 15:40:57 +01:00
Daniel P. Berrangé
e9f74bbdba src: cap the data size in stream I/O functions
The main stream I/O functions have a design flaw in that they accept
'size_t' as the input data length, while intending to return the
amount actually processed in an 'int'.

Fortunately all functions explicitly document that less data may be
processed than requested, and with the remote driver data cap we will
never get anywhere near exceeding an 'int' even on 32-bit.

For sanity, however, lets explicitly cap the data size in the public
API to fix the design flaw.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-11-24 12:16:56 +00:00
Daniel P. Berrangé
2e595888aa include: fix version for recent block stats constants
The recent commit:

  commit 166be0d48c
  Author:     Peter Krempa <pkrempa@redhat.com>
  AuthorDate: Fri Sep 12 13:32:36 2025 +0200
  Commit:     Peter Krempa <pkrempa@redhat.com>
  CommitDate: Wed Nov 5 14:27:57 2025 +0100

      Expose qemu timed block statistics via bulk stats API

had a bit of delay between authoring and merging, such that the
merged version number was outdated.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-11-24 12:16:03 +00:00
Praveen K Paladugu
3e33e91c5d tests: qemuxmlconftest: Add case for hyperv domains
Add qemuxmlconftest test for hyperv domains.

Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-11-22 08:23:05 +01:00
Praveen K Paladugu
9290014103 tests: qemucapabilities: Introduce MSHV capability
Add case to test libvirt's parsing of MSHV capability.

Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-11-22 08:23:05 +01:00
Praveen K Paladugu
33e716a56d tests: Add domaincaps case for mshv
Add domaincaps tests data for mshv capability

Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-11-22 08:23:05 +01:00
Praveen K Paladugu
82b40953a0 conf: Fix virttype handling in schemas
Create a common `virttype` definition in basictypes.rng and reuse it
to enumerate all virt types. This change eliminates the need to duplicate
virttypes in multiple locations.

Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-11-22 08:23:05 +01:00
Praveen K Paladugu
7b752b98f1 qemu: conditionally add /dev/mshv to acl
Conditionally add /dev/mshv device to acl while launching
hyperv domains.

Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-11-22 08:23:05 +01:00
Praveen K Paladugu
ba40f678f4 qemu: use mshv accel for hyperv domains
Add mshv acceleration (-accel mshv) flag while launching hyperv domains.

Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2025-11-22 08:23:05 +01:00
Eugene Fedorenko
c852d9ca3c qemu: Append mshv to hwaccel list.
Append mshv to the default list of hwaccel to use be used by qemu.

Signed-off-by: Eugene Fedorenko <eugene.fedor@gmail.com>
Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-11-22 08:23:05 +01:00
Praveen K Paladugu
6d0702f4cc qemu: Query and use mshv capabilities
Qemu with mshv capabilities can launch VIR_DOMAIN_VIRT_HYPERV domains.

Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-11-22 08:23:05 +01:00
Praveen K Paladugu
3b7edf755d qemu: Introduce mshv capabilities
This capability indicates if qemu supports mshv as an accelerator. Qemu
with mshv capabilities can launch domains of type VIR_DOMAIN_VIRT_HYPERV.

Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2025-11-22 08:23:04 +01:00
Collin Walling
029933be86 qemu: only allow enabling deprecated features that are supported
When updating the guest CPU model and the deprecated_features attribute
is set to on, only enable the features the model can actually enable.

While host-model would normally just enable these features without
intervention (and without the presence of the deprecated_features
attribute), custom models would see no changes to their feature set
without these changes.

This is useful for e.g. testing CPU models.

Fixes: f279ea36 (qemu: process: refactor deprecated features code)
Signed-off-by: Collin Walling <walling@linux.ibm.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2025-11-21 16:17:31 +01:00
Collin Walling
906f0e448a qemu: query and cache static/host deprecated features
When performing a static CPU model expansion, the reported list of
deprecated features will reflect the features which are currently
enabled on the CPU model.

Retrieve this subset and store them as static deprecated properties for
the model info, and as host deprecated features in the cache.

Note that this list may exclude items that are shown in the
<deprecatedFeatures> list, as some feature support has been dropped by
hardware (e.g. csske).

Signed-off-by: Collin Walling <walling@linux.ibm.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2025-11-21 16:17:31 +01:00
Collin Walling
82eb7690a0 qemu: refactor load/format of deprecated features
Signed-off-by: Collin Walling <walling@linux.ibm.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2025-11-21 16:17:31 +01:00
Collin Walling
8403817182 qemu: rename modelinfo's deprecated_props to full_dep_props
The current query of deprecated properties is the result of a full model
expansion.  Rename the field to reflect this.

Signed-off-by: Collin Walling <walling@linux.ibm.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2025-11-21 16:17:31 +01:00
Michal Privoznik
37b0b74b48 tests: Don't link vmx2xmltest with esx_lib
When reworking the vmx2xmltest to call esxParseVMXFileName() from
the ESX driver I also made the test link with the driver
statically. But the function then calls some other functions
which are mocked in vmx2xmlmock. Now, on many systems this works
just fine as the dynamic linker finds the mocked functions first.
But on Fedora 41 and Fedora 42 the dynamic linker resolves the
symbols to those from statically linked library rendering our
mock ineffective.

Just don't link in the esx_lib.

Fixes: f82d30307d
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-11-21 15:59:56 +01:00
Nux
7d5a1a5384 Edit apps.rst to add Apache CloudStack in the IaaS section.
Add Apache CloudStack to the docs/apps.rst file, IaaS section.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Nux <nux@li.nux.ro>
2025-11-21 12:58:25 +00:00
Achill Gilgenast via Devel
4ab1e25f6e qemu: Remove redundant kvm group config in sysusers.d
It's already defined by default in systemd:
https://github.com/systemd/systemd/blob/v257.6/sysusers.d/basic.conf.in#L32

Adding it again here in libvirt-qemu.sysusers.conf causes the following
warning by validating it with sd-sysuers:

	/usr/lib/sysusers.d/libvirt-qemu.conf:1: Conflict with earlier configuration for group 'kvm' in /usr/lib/sysusers.d/basic.conf:32, ignoring line.

On Fedora/RHEL systemd is built with -Dkvm-gid=36 so there is no change
in the allocated GID on these platforms. Other platforms have the same
facility available to them if they wish to retain a fixed GID.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Achill Gilgenast <achill@achill.org>
2025-11-21 12:55:50 +00:00
Jaroslav Suchanek
6bc397eb23 cputest: Skip test for Intel(R) Xeon(R) 6788P CPU when QEMU driver is disabled
Commit 034f02d25c added new test for the
Intel(R) Xeon(R) 6788P cpu model. The test depends on QEMU driver. If
the driver is not available, then skip it. Similarly as in commit
c22b734117.

Signed-off-by: Jaroslav Suchanek <jsuchane@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2025-11-21 13:44:34 +01:00
Daniel P. Berrangé
047affcbd0 tests: skip vmx tests when ESX is disabled
Since the recent change:

  commit f82d30307d
  Author: Michal Prívozník <mprivozn@redhat.com>
  Date:   Fri Nov 14 10:35:14 2025 +0100

    vmx2xmltest: Drop custom file name parse function

The VMX parsing uses the esxParseVMXFileName() function in
the ESX library. This is unavailable when the ESX driver is
disabled, so the tests must be skipped too.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-11-21 12:15:27 +00:00
Ján Tomko
f1c8c9a1e8 build: drop userfaultfd_sysctl option
Since e2bc742fcc we do not
install it on RHEL nor Fedora.

OpenSUSE is also new enough that it disables the installation.
On Debian, sysctl files are only installed as an example.

Remove the option and delete the file.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-11-20 23:32:08 +01:00
Nathan Chen
7b471c563f tests: qemuxmlconfdata: provide device-pluggable smmuv3 sample XML and CLI args
Provide sample XML and CLI args for the device-pluggable smmuv3
XML schema for virt machine type.

Signed-off-by: Nathan Chen <nathanc@nvidia.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-11-20 22:56:42 +01:00
Nathan Chen
4d6419b286 qemu: Implement pluggable-device smmuv3
Introduce support for "pciBus" driver attribute for
"smmuv3" IOMMU model. The "pciBus" attribute indicates
the index of the controller that a smmuv3 IOMMU device
is attached to, and differentiates the device-pluggable
arm-smmuv3 model from the virt-machine-associated smmuv3
model.

Signed-off-by: Nathan Chen <nathanc@nvidia.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-11-20 22:56:39 +01:00
Nathan Chen
e70c4d54d3 conf: Support multiple device-pluggable smmuv3 IOMMUs
Add support for parsing multiple IOMMU devices from
the VM definition when "smmuv3" is the IOMMU model.

Signed-off-by: Nathan Chen <nathanc@nvidia.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-11-20 22:56:33 +01:00
Nathan Chen
d97bc25b82 qemu: Format IOMMU devices after controllers
Format qemu arguments for IOMMU devices after
controllers as the multi-SMMUv3 model associates
SMMUv3 devices with hostdevs by plugging them
into the same controller upstream.

Signed-off-by: Nathan Chen <nathanc@nvidia.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-11-20 22:56:25 +01:00
Ján Tomko
a523920171 qemu: make qemuBuildDeviceAddressPCIGetBus more generic
Operate on a virPCIDeviceAddress, not virDomainDeviceInfo
so that this can be reused to look for buses that are not
stored in the device info.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2025-11-20 22:48:23 +01:00
Roman Bogorodskiy
5944f566ac bhyve: support VNC 'wait' attribute
Bhyve supports the 'wait' option for the VNC device configuration.
When enabled, VM boots only upon a VNC connection.

Sample device configuration looks like this:

 -s 29,fbuf,tcp=0.0.0.0:5900,w=800,h=600,wait

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-11-20 19:22:13 +01:00
Roman Bogorodskiy
c8bffda588 conf: introduce 'wait' attribute for VNC
Introduce an optional 'wait' attribute for 'VNC'.
When set to 'yes', VM should only boot upon the initiation of a VNC
connection.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-11-20 19:17:29 +01:00
Daniel P. Berrangé
ec501bdc5e tools: inform user which hardware virt was found during validation
On x86 we can indicate VMX or SVM, while s390x would be SIE, and
PowerPC would be LCPR (Logical Partitioning Control Register).

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-11-20 17:27:30 +00:00
Daniel P. Berrangé
e6d8983cdb tools: be explicit about failure to find x86 secure virt
If we fail to find either SEV or TDX on x86, we can explicitly
say there is no secure guest support on the platform.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-11-20 17:26:18 +00:00
Daniel P. Berrangé
785c9fd512 tools: inform user which CVM is found during validation
For AMD, the virt-host-validate 'secure guest' check reports
support for SEV, and there are then further check results
printed for SEV-ES/SEV-SNP which are overly verbose and the
long lines break output alignment.

This uses the new ability to report details with PASS results
to concisely tell the user which out of SEV/SEV-ES/SEV-SNP
are found. Only a single answer is neede, as SEV-SNP implies
SEV & SEV-ES, and SEV-ES implies SEV.

The TDX s390x PROT-VIRT checks also identify themselves.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-11-20 17:26:13 +00:00
Daniel P. Berrangé
f44e2ecc5b tools: inform user which IOMMU was found during validation
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-11-20 17:26:00 +00:00
Daniel P. Berrangé
c0f42f4d76 tools: allow passing details for passed validation tests
In a number of virt-host-validte tests we are testing for
at least one out of multiple acceptable features. For
example the 'secure guest' test can be satisfied by
s390x protvirt, or x86 TDX, SEV, SEV-ES, SEV-SNP.

It would be useful to inform the user which one we detected
when the test passes. This introduces virValidatePassDetails
to enable that.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-11-20 17:25:38 +00:00
Michal Privoznik
fa15860ac1 vmx2xmltest: Add a test case for disks in subfolder
This test case demonstrates correctness of the previous fix.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-11-20 15:09:20 +01:00
Michal Privoznik
07d3cc9d57 esx: Allow disk images in subdirectories
The esxParseVMXFileName() function parses path to a disk image
trying to replace some "known" patterns (e.g. datastore paths).
A simple filename is treated as a path relative to .vmx file. But
disk images (and thus filenames) can be in a subdirectory,
relative to the .vmx file. For instance:

  subfolder/disk.vmdk

Adapt our parser to this fact.

Resolves: https://issues.redhat.com/browse/RHEL-122751
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-11-20 15:09:18 +01:00
Michal Privoznik
f82d30307d vmx2xmltest: Drop custom file name parse function
Having a custom file name parsing function in vmx2xml that's
different to the one used in production (esxParseVMXFileName())
might have served us well, but it also defeats the point of
having a unit test. More specifically, if there's a bug in
esxParseVMXFileName() then our unit test would not catch it.

But now that we have vmx2xmlmock the custom parsing function can
be dropped and the test can use the real one.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-11-20 15:09:14 +01:00
Michal Privoznik
29ddffbe6c tests: Introduce vmx2xmlmock
If we want vmx2xmltest to use actual file name parser that's used
in production (esxParseVMXFileName()) we need a mock to stop it
from doing any HTTP requests and also to return predictable data.

So far, the function can call three functions that do HTTP
requests: esxVI_LookupDatastoreList(),
esxVI_LookupDatastoreHostMount() and
esxVI_LookupDatastoreByName().

Mock all three of them. And since their implementation uses some
other symbols (like allocators or _AppendToList() helpers) we
need to expose these symbols too.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-11-20 15:09:10 +01:00
Michal Privoznik
ad92def79e esx: Make esxVI_LookupDatastoreByName() mockable
This function is going to be mocked soon. Annotate and export it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-11-20 15:09:09 +01:00
Michal Privoznik
c3a927c121 esx: Make esxVI_LookupDatastoreHostMount() mockable
This function is going to be mocked soon. Annotate and export it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-11-20 15:09:07 +01:00
Michal Privoznik
bdd681f9b2 esx: Make esxVI_LookupDatastoreList() mockable
This function is going to be mocked soon. Annotate and export it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-11-20 15:09:02 +01:00
Michal Privoznik
3ccb15006a esx: Expose esxParseVMXFileName() for tests
So far, our vmx2xmltest uses a custom .parseFileName callback.
And it kind of makes sense because the one that's used in
production (esxParseVMXFileName()) does some HTTP requests which
we don't want to do in our test suite. But this creates other
sorts of problems and the idea is to have the test ditch custom
parse callback and stick with the production one. But for now,
just expose it. With it, the esxVMX_Data struct is exposed too as
it is passed into the function (via 'opaque' argument).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-11-20 15:08:59 +01:00
Michal Privoznik
6db235e913 libvirt_esx.syms: Put proper header file name into comment
The esxVI_DateTime_ConvertToCalendarTime() symbol is declared in
esx_vi_types.h header file. Reflect this in the corresponding
.syms file.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-11-20 15:08:49 +01:00
Massimiliano Minella
4ae5351a50 docs: domain: add watchdog notification support
Since v0.8.0 a watchdog notification is available under event ID
VIR_DOMAIN_EVENT_ID_WATCHDOG, update the documentation to remove the
previous limitation.

Signed-off-by: Massimiliano Minella <massimiliano.minella@se.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2025-11-19 11:32:46 +01:00
Peter Krempa
475ed7075d qemuDomainPrepareDiskSourceData: Setup 'detect_zeroes' for all layers
While it may seem that zero detection is pointless for backing chain
layers other than the top one, which is usually the only one gettin
written to,  with block operations such as active-layer commit the
non-top layer may become active, in which case the VM wouldn't be
configured in accordance to the XML any more.

Similarly with snapshots a new image is introduced which would not get
zero detection enabled, but next start of the VM would enable it.

Fix this by propagating the zero detection setting for all layers.

This problem partially addresses one of the issues reported in
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1120389

Fixes: 8a78f88a1a and a522c3044b (effectively reverts them)
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2025-11-19 08:34:13 +01:00
Peter Krempa
312be5eb9a qemuxmlconftest: Improve coverage of 'disk-detect-zeroes' test case
Add test cases for all three options 'off'/'on'/'unmap' as well as add
backing store for each image to show how the configuration behaves.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2025-11-19 08:34:13 +01:00
Cole Robinson
f5bb1ae77b selinux: Mark anything using content_context as shared
This marks kernel, initrd, dtb, and similar elements with is_shared,
meaning we skip label restore if xattr label remembering is not
enabled or supported (like on qemu:///session).

non-xattr based label restore is subject to race conditions if
multiple VMs are starting and stopping using shared media:
https://issues.redhat.com/browse/RHEL-126945

This converts every case that is using content_context (virt_content_t)
as SetFileLabel time, which is how we are marking content as
readonly. All the shareable cases (marked with file_context) are
already skipping remembering/label restore entirely.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2025-11-13 19:26:18 -05:00
Cole Robinson
5616eaf63e selinux: Add is_shared plumbing to RestoreFileLabel
If set, we will skip fallback label restore attempts, if label
remembering fails or isn't supported.

This is a no-op, as every caller passes in `false` which matches
existing behavior. Next patch will make use of it

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2025-11-13 19:26:18 -05:00
Cole Robinson
f4903ebcf7 selinux: Don't remember labels for shareable SCSI devices
For shareable/readonly devices, label restore is skipped entirely in
virSecuritySELinuxRestoreSCSILabel. So requesting remember=true here
doesn't accomplish anything

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2025-11-13 19:26:18 -05:00
Cole Robinson
3a611df5b1 selinux: Match remember/recall arguments for SavedStateLabel
virSecuritySELinuxSetSavedStateLabel uses remember=false, but
virSecuritySELinuxRestoreSavedStateLabel uses recall=true.

This doesn't cause problems in practice, just some redundant xattr
calls. But Set and Restore calls should be matched here.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2025-11-13 19:26:18 -05:00
Michal Privoznik
cf0806477b bhyve: s/provconn/privcon/
Due to a typo, the bhyve driver doesn't compile. Fix it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-13 09:08:02 +01:00
Peter Krempa
a379327d8a qemu: snapshot: Set umask for 'qemu-img' when creating external inactive snapshots
External inactive snapshots are created by invoking 'qemu-img' which
creates the file. Currently qemu-img creates image with mode 644 based
on default umask as libvirt doesn't set any.

Having a world-readable image is obviously wrong so set the umask to
077 to have the file readable only by the owner.

Resolves: https://bugs.debian.org/1120119
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2025-11-13 08:31:39 +01:00
Martin Kletzander
2a326c415a qemu: Check ACLs before parsing the whole domain XML
Utilise the new virDomainDefIDsParseString() for that.

This is one of the more complex ones since there is also a function that
reads relevant metadata from a save image XML.  In order _not_ to extract
the parsing out of the function (and make the function basically trivial
and all callers more complex) add a callback to the function which will
be used to check the ACLs.

Fixes: CVE-2025-12748
Reported-by: Святослав Терешин <s.tereshin@fobos-nt.ru>
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-12 09:50:56 +01:00
Martin Kletzander
eb4322dfe8 ch: Check ACLs before parsing the whole domain XML
Utilise the new virDomainDefIDsParseString() for that.

This is one of the more complex ones since there is also a function that
reads relevant metadata from a save image XML.  In order not to extract
the parsing out of the function (and make the function basically trivial
and all callers more complex) add a callback to the function which will
be used to check the ACLs.  And since this function is called in APIs
that perform ACL checks both with and without flags, add two of them for
good measure.

Fixes: CVE-2025-12748
Reported-by: Святослав Терешин <s.tereshin@fobos-nt.ru>
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-12 09:50:56 +01:00
Martin Kletzander
7285c10a7e vz: Check ACLs before parsing the whole domain XML
Utilise the new virDomainDefIDsParseString() for that.

Fixes: CVE-2025-12748
Reported-by: Святослав Терешин <s.tereshin@fobos-nt.ru>
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-12 09:50:56 +01:00
Martin Kletzander
a6dcfee896 lxc: Check ACLs before parsing the whole domain XML
Utilise the new virDomainDefIDsParseString() for that.

Fixes: CVE-2025-12748
Reported-by: Святослав Терешин <s.tereshin@fobos-nt.ru>
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-12 09:50:56 +01:00
Martin Kletzander
a1f48bca07 libxl: Check ACLs before parsing the whole domain XML
Utilise the new virDomainDefIDsParseString() for that.

Fixes: CVE-2025-12748
Reported-by: Святослав Терешин <s.tereshin@fobos-nt.ru>
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-12 09:50:56 +01:00
Martin Kletzander
b45f10bc0a bhyve: Check ACLs before parsing the whole domain XML
Utilise the new virDomainDefIDsParseString() for that.

Fixes: CVE-2025-12748
Reported-by: Святослав Терешин <s.tereshin@fobos-nt.ru>
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-12 09:50:56 +01:00
Martin Kletzander
e6de1e43ab conf: Add virDomainDefIDsParseString
This function performs only parsing with the underlying
virDomainDefParseIDs() function to get needed metadata for any ACL
checks, but nothing else to avoid extraneous allocations and any
parser-induced DoS over ACL-forbidden connections.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-12 09:50:56 +01:00
Peter Krempa
05baaddb3f virXMLFormatMetadata: Don't modify deprecated 'xmlIndentTreeOutput'
'libxml2' deprecated the 'xmlIndentTreeOutput' thread-local variable as
well as the 'xmlThrDefIndentTreeOutput' function for setting the global
default, which we use in our code for formatting the metadata sub-XML.

'libxml2' also for now doesn't provide a way to set target indentation
level in 'xmlSaveCtxt' which would allow us to use the modern output
APIs, we can't replace our use of 'xmlDumpNode'. (See
https://gitlab.gnome.org/GNOME/libxml2/-/issues/989 )

Since the indentation is enabled by default in libxml2 and our most
commonly used code which calls xmlDumpNode lives in a standalone
process, where we don't override the setting, just removing the override
will result in identical behaviour.

For the use cases which do live in a process we don't fully control and
thus the default could have been overriden, the result would be that the
<metadata> element would be un-indented, but that is still valid XML.

Thus to fix the deprecated use just stop setting 'xmlIndentTreeOutput'.

Closes: https://gitlab.com/libvirt/libvirt/-/issues/816
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2025-11-11 21:30:06 +01:00
Peter Krempa
f307c7dc0c virVBoxSnapshotConfSaveVboxFile: Don't modify deprecated 'xmlIndentTreeOutput'
'xmlIndentTreeOutput' is now deprecated by libxml2.

The default value set by libxml2 is '1', and the vbox driver resides
only inside the standalone daemon where the value will not be changed by
us thus there's no observable change in behaviour.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2025-11-11 21:30:03 +01:00
Roman Bogorodskiy
a181d99cba bhyve: domain: improve disks validation
Do not allow to configure queues and queue size for non-NVMe disks.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-11 19:25:11 +01:00
Roman Bogorodskiy
b3e1e9a187 bhyve: domain: refactor bhyveDomainDeviceDefValidate()
Refactor bhyveDomainDeviceDefValidate() to use switch/case instead of
series of ifs which makes it easier to follow.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-11 19:25:11 +01:00
Roman Bogorodskiy
26a9c7d840 bhyve: support queue configuration for NVMe disks
bhyve supports queue configuration for the NVMe disks:

  maxq        Max number of queues.
  qsz         Max elements in each queue.

Map that to the disk driver's "queues" and "queue_size" attributes
respectfully, so:

  <driver name='file' type='raw' queues='2' queue_size='256'/>

results in:

  -s N:0,nvme,/tmp/disk.img,maxq=2,qsz=256

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-11 19:25:04 +01:00
Roman Bogorodskiy
52bddfd65c conf: domain_validate: make disk queue configuration driver specific
Currently, virDomainDiskDefValidate() allows to configure disks' number
of queues and queue size for virtio disks only. However, the bhyve
driver allows to configure these for the NVMe disks, so make this
check driver-specific.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-11 18:28:57 +01:00
Roman Bogorodskiy
f81e5158d4 docs: drvbhyve: add guest-specific nodes section
Add a section with guest-specific notes. Start with LPC slot address
information for the Windows guests.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-10 18:23:04 +01:00
Roman Bogorodskiy
b2c7dba3eb docs: drvbhyve: improve the manpage link
When linking to the bhyve(8) manual page, do not set manpath
to a specific FreeBSD version so the latest actual version
is displayed.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-10 18:23:01 +01:00
Roman Bogorodskiy
f4751e23d3 docs: drvbhyve: document device passthrough
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-10 18:22:50 +01:00
Daniel P. Berrangé
15833693e6 meson: default to system crypto policies where available
In RHEL and Fedora, the built-in GNUTLS default priority is changed
from "NORMAL" to "@SYSTEM", but because libvirt sets an explicit
policy with gnutls we don't honour that. Instead we force "NORMAL"
unless the 'tls_priority' meson option is changed.

In RPM builds, meanwhile, we ask for "@LIBVIRT,SYSTEM" to make it
look for a libvirt specific profile first, falling back to "@SYSTEM"

This changes the meson option to default to "@LIBVIRT,SYSTEM" if the
crypto-policies config is present on the local machine and the meson
option -Dsystem=true is given.

This gives developers more appropriate default behaviour, matching
that seen in package builds.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-11-10 13:18:51 +00:00
Michal Privoznik
81ce368347 ch: Sort driver sources and drop header files
Firstly, there's no need to list header files in
ch_driver_sources (we don't do that anywhere else, and meson is
smart enough to figure them out). And secondly, the list of
source file is not sorted which means new source files are added
in random order.

Thus, drop header files from the list and sort it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2025-11-10 13:16:22 +01:00
Michal Privoznik
b224d2b377 ch: Assign device alias early
Assigning device should happen from ch_hotplug.c (just like it's
done for disks currently) not in ch_process.c. Move alias
assignment out of chProcessAddNetworkDevice(). And while at it,
mimic what's done with disks and have net hotplug handling done
from a function.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2025-11-10 13:16:12 +01:00
Michal Privoznik
85cf0e4f17 ch: Set transient domain definition
Libvirt's philosophy is that for a running domain there are two
(in general distinct) definitions: live definition (reflects the
running state) and inactive definition (used to seed the live
definition when domain is being created).  That's why we have
VIR_DOMAIN_AFFECT_LIVE and VIR_DOMAIN_AFFECT_CONFIG flags to APIs
that modify domain definitions.

Well, the CH driver doesn't do this distinction. Fix this by
making the domain definition transient when it's being created.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2025-11-10 13:16:02 +01:00
Michal Privoznik
7e5d224536 ch: Use correct domain definition in chDomainGetXMLDesc()
The chDomainGetXMLDesc() function claims to support
VIR_DOMAIN_XML_INACTIVE to obtain the persistent definition of a
running domain (in its call to virCheckFlags()) but in fact, it's
always passing vm->def to virDomainDefFormat().

So far, there's no harm done because CH driver never sets domain
def as transient. But that'll change.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2025-11-10 13:15:32 +01:00
Michal Privoznik
29195b7b17 ch_process: Avoid memleak in chProcessAddNetworkDevice()
The 'payload' variable inside of chProcessAddNetworkDevice() is
reused and thus the memory it points to just before its
repurpose is not freed. Avoid reusing g_autofree variables.

 128 bytes in 1 blocks are definitely lost in loss record 1,828 of 2,026
    at 0x491A120: realloc (vg_replace_malloc.c:1801)
    by 0x4FEC251: g_realloc (in /usr/lib64/libglib-2.0.so.0.8400.4)
    by 0x500BB7E: g_string_expand (in /usr/lib64/libglib-2.0.so.0.8400.4)
    by 0x500BBF0: g_string_sized_new (in /usr/lib64/libglib-2.0.so.0.8400.4)
    by 0x4A114C0: virBufferInitialize (virbuffer.c:121)
    by 0x4A11890: virBufferAdd (virbuffer.c:160)
    by 0x4A67344: virJSONValueToBuffer (virjson.c:1562)
    by 0x4A673DB: virJSONValueToString (virjson.c:1599)
    by 0xBC878AB: virCHMonitorBuildNetJson (ch_monitor.c:466)
    by 0xBC8D4A9: chProcessAddNetworkDevice (ch_process.c:688)
    by 0xBC8FCE2: chDomainAttachDeviceLive (ch_hotplug.c:78)
    by 0xBC900CA: chDomainAttachDeviceLiveAndUpdateConfig (ch_hotplug.c:174)

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2025-11-10 13:15:17 +01:00
Michal Privoznik
bf34b3c86f domain_capabilities: Use virXMLFormatElement() in FORMAT_PROLOGUE and FORMAT_EPILOGUE macros
Domain capabilities XML is formatted (mostly) using
FORMAT_PROLOGUE and FORMAT_EPILOGUE macros. These format opening
and closing stanzas for given element. The FORMAT_PROLOGUE macro
even tries to be clever and format element onto one line (if the
element isn't supported), but that's not enough. Fortunately, we
have virXMLFormatElement() which formats elements properly, so
let's switch macros into using that.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2025-11-10 12:21:48 +01:00
Michal Privoznik
d2d442d79d domain_capabilities: Check NULL in FORMAT_PROLOGUE
In the virDomainCaps struct there are some pointers that might be
NULL (for instance 'sev', 'sgx', 'hyperv'). Teach FORMAT_PROLOGUE
macro to check for NULL argument so that format functions (like
virDomainCapsFeatureHypervFormat()) don't need to.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2025-11-10 10:35:39 +01:00
Michal Privoznik
b20ae99e1d domain_capabilities: Rework virDomainCapsCPUFormat()
Make the virDomainCapsCPUFormat() function use
virXMLFormatElement() family of functions.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2025-11-10 10:35:15 +01:00
Michal Privoznik
166fad633a domain_capabilities: Rework virDomainCapsCPUCustomFormat()
Make the virDomainCapsCPUCustomFormat() function use
virXMLFormatElement() family of functions.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2025-11-10 10:33:15 +01:00
Michal Privoznik
132ba55a00 domain_capabilities: Move indentation adjustment out of virDomainCapsCPUCustomFormat()
The aim of virDomainCapsCPUCustomFormat() is to format CPU models
into given buffer. But it starts by adjusting indentation. Move
this one level up into the caller so that another buffer can be
used. This also makes the pattern match in the caller
(virDomainCapsCPUFormat()) with the rest of CPU related domcaps
formatting.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2025-11-10 10:32:39 +01:00
Roman Bogorodskiy
238be79bb9 bhyve: auto-assign PCI addresses for hostdevs
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-08 10:28:00 +01:00
Alexander Shursha
43579767f4 bhyve: Tie the 'passthru' option to the 'hostdev' XML config
Signed-off-by: Alexander Shursha <kekek2@ya.ru>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-08 10:27:56 +01:00
Alexander Shursha
447252a54c bhyve: Advertise hostdev support
Signed-off-by: Alexander Shursha <kekek2@ya.ru>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-08 10:27:49 +01:00
Alexander Shursha
e4056c458a bhyve: Support passing the 'passthru' command line option
Bhyve supports PCI device passthrough using the following syntax:

  bhyve ... -s 4:0,passthru,5/2/0 ...

Where 5/2/0 is PCI address of the device in the host, and "4:0" is the
address in the guest.

Currently, user is responsible for reserving the device for passthrough,
i.e. by configuring pptdevs in loader.conf(5), or using devctl(8) to
detach the device.

Co-authored-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Signed-off-by: Alexander Shursha <kekek2@ya.ru>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-08 10:27:27 +01:00
Roman Bogorodskiy
4714272b39 bhyve: process: improve domain startup error handling
After executing the bhyve binary, it might happen that it fails very
early due to configuration issues (missing/inaccessible files, incorrect
custom args), bugs, etc. In this case it'll look like the domain has
started normally, but quickly turned off.

Improve that by waiting for the domain's vmm entity to appear in
/dev/vmm.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-08 09:14:37 +01:00
Jiri Denemark
afafb2a28b cpu_map: Add YongFeng-v3 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark
a6000b20ba cpu_map: Add YongFeng-v2 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark
98b4609b51 cpu_map: Add YongFeng CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark
db80641510 cpu_map: Add features used by Zhaoxin YongFeng Processor
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark
56ee1bfb7a cpu_map: Add Zhaoxin CentaurHauls CPU vendor
Zhaoxin uses two distinct vendor IDs. This patch is adding one of them
used by Zhaoxin YongFeng Processor.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark
ee95c9d7d1 cpu_map: Add EPYC-Turin CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark
f37126bc55 cpu_map: Add EPYC-Milan-v3 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark
0fcde0edc5 cpu_map: Add EPYC-v5 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark
d2925f23e7 cpu_map: Add EPYC-Rome-v5 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark
7e8f1698c7 cpu_map: Add EPYC-Genoa-v2 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark
dec859cb66 cpu_map: Add ClearwaterForest CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark
b8d830ff54 cpu_map: Add GraniteRapids-v3 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark
cbc2f8e2b3 cpu_map: Add SapphireRapids-v4 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark
bd43aa4cbb cpu_map: Add SierraForest-v3 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark
64143828d7 cpu_map: Add SierraForest-v2 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark
189d7b64ac cputest: Add data for AMD Ryzen 9 9950X 16-Core CPU
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark
034f02d25c cputest: Add data for Intel(R) Xeon(R) 6788P CPU
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark
b7c92ce918 cputest: Read more MSRs in cpu-data.py
The features defined in our CPU map use quite a bit more than just the
two MSRs the script is currently trying to read. Let's read all of them
to get complete host CPU data.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark
a3395fb598 cputest: Ignore missing MSRs in cpu-data.py
The current code made sense when we were reading only one MSR, but since
we started reading more MSRs, the host CPU would have to support all of
them otherwise the function would just return an empty dict.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark
21c61bee36 sync_qemu_models_i386: Support adding models to an empty group
When adding a new CPU vendor, we create a new empty group in
src/cpu_map/index.xml and want to use the sync_qemu_models_i386.py
script to add models there.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark
d3888c470a sync_qemu_models_i386: Handle unknown features in GraniteRapids-v2
The GraniteRapids-v2 uses quite a few CPU features unknown to this
script.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark
b74b452f8a sync_qemu_models_i386: Print current model for unknown features
This way one can just grep for all warnings in the script output and
still be able to see for which CPU model is defined using features the
script doesn't know about.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark
58972035bd sync_qemu_models_i386: Fix typo in CPUID_8000_0021_EAX_No_NESTED_DATA_BP
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark
96df5805fd cpu_map: Fix ordering of CPU models in meson.build
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark
a86973056a cpu_map: Add feature for detecting Indirect Target Selection immunity
QEMU commit 74978391b2da0116b9109d52931f342118d5a122

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark
81c20d2c32 cpu_map: Add feature for detecting Branch History Injection immunity
QEMU commit b611931d4f70b9a3e49e39c405c63b3b5e9c0df1

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:55 +01:00
Jiri Denemark
c80b283277 cpu_map: Add features for Transient Scheduler Attacks mitigation
QEMU commits d8ec0baf4a15082cdc4abe1de28face9a26f0dc9 and
c79a35acadee784610aed40134a12738381b4fba

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:55 +01:00
Jiri Denemark
b72758d62a cpu_map: Add a few missing features to 0x80000021 CPUID leaf
QEMU commit dfd5b456108a75588ab094358ba5754787146d3d

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:55 +01:00
Jiri Denemark
819ce69b38 cpu_map: Add msr-imm CPU feature
QEMU commit 91084f3b44b1da4935eec85b79c1f97d1c140ada

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:55 +01:00
Ján Tomko
a088734d57 scripts: do not use uninitialized variable
A previous commit removed the 'ret' variable when
switching to subprocess.run, but did not adjust
the exit code.

Fixes: 15c9ca383c
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2025-11-07 15:44:09 +01:00
Daniel P. Berrangé
1ff3d18528 tools/nss: check for missing array element
We've already checked the upper bound of the array, but we should
none the less sanity check that the requested array element is
not NULL before dereferencing it.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-11-07 11:58:35 +00:00
Daniel P. Berrangé
f1e59f961d src: check for invalid stream in virStreamInData
All methods must use virCheckStreamReturn to validate their
'stream' parameter.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-11-07 11:58:30 +00:00
Daniel P. Berrangé
15c9ca383c scripts: use subprocess.run instead of os.system
The subprocess.run command avoids using the shell and so is robust
should sys.argv contain any whitespace or unexpected shell meta
characters.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-11-07 11:58:26 +00:00
Praveen K Paladugu
7db2138dc9 qemu: Use query-accelerators to query accelerators
Use the `query-accelerators` command to generically query the enabled
acclerator. Below is an example invocation in Qemu:

  { "execute": "query-accelerators"}
  "return": {"enabled": "kvm", "present": ["kvm", "mshv", "qtest", "tcg", "xen"]}}

"enabled" here indicates "kvm" is the enabled accelertor.

If query-accelerators command is not available, fallback to existing
mechnisms for querying kvm and hvf capabilities.

Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 12:19:03 +01:00
Praveen K Paladugu
4c266d53e8 qemu: Introduce query-accelerators cap
Introduce query-accelerators capability which is a generic way to query
the accelerators supported by qemu.

Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 12:15:02 +01:00
Daniel P. Berrangé
878470256e src: report error from failing to add timer/FD watches
The virEventAddHandle/Timeout APIs are unusual in that they do not
report errors on failure, because they call through to function
callbacks which might be provided externally to libvirt and thus
won't be using libvirt's error reporting APIs.

This is a rather unfortunate design characteristic as we can see
most callers forgot about this special behaviour and so we are
lacking error reporting in many cases.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-11-06 12:04:48 +00:00
Peter Krempa
9b7ef8058b conf: Don't leak virDomainDiskDef's 'statistics' member
In commit 19fc614d53 I've added an option to configure statistics but
forgot to free it once the disk definition struct is freed.

Fixes: 19fc614d53
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2025-11-05 16:03:13 +01:00
Peter Krempa
7ee9dbacbe qemu: Add support for enabling timed block device statistics collection
Add validation that qemu supports the collection of statistics and
enable it on the block device commandline.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-05 14:27:57 +01:00
Peter Krempa
19fc614d53 conf: Add configuration option for timed disk statistics collection
QEMU supports collection of disk statistics in configurable time
windows. Add support for enabling this feature to the conf parser.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-05 14:27:57 +01:00
Peter Krempa
1c4234b34e qemu: capabilities: Introduce QEMU_CAPS_DISK_TIMED_STATS
The capability tracks support for 'stats-intervals' property of disk
frontends which enables statistics collection on the devices.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-05 14:27:57 +01:00
Peter Krempa
166be0d48c Expose qemu timed block statistics via bulk stats API
The statistics show various disk access timing parameters collected in
configurable interval which can be useful for performance
investigations.

Note that the statistic collection needs to be enabled explicitly for
the statistics to be collected and displayed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-05 14:27:57 +01:00
Peter Krempa
6914b4f2a5 qemu_monitor: Extract 'timed_stats' of block devices
The 'timed_stats' block is a set of statistics gathered in configurable
time intervals. The stats include latency timings of reads/writes as
well as the depth of the request queues.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-05 14:27:57 +01:00
Peter Krempa
d1eafbe88b Expose qemu storage request limits via bulk stats API
Management applications can use the detected limits to cross reference
with configuration within the VM to ensure optimal performance.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-05 14:27:57 +01:00
Peter Krempa
c33e5971b1 qemu: monitor: Extract block limit values
The 'limits' field reports various maximum request sizes and
alignments for a qemu blockdev protocol node.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-05 14:27:57 +01:00
Peter Krempa
c177003d4d qemucapabilitiestest: qemucapabilitiestest: Update 'caps_10.2.0_x86_64' to 'v10.1.0-1969-g53b41bb789'
Notable changes:
 - deprecated 'reconnect' option removed from socket chardevs
 - 'query-accelerators' QMP command added
 - 'query-firmware-log' QMP command added
 - block image limits exposed via QMP
 - timed block statistics collection config is now available via -device
 - 'audio-backend' QOM object type added
 - 'mshv-accel' QOM object type added
 - 'tsa-l1-no', 'tsa-sq-no', 'verw-clear' cpu properties added
 - SCLP_CPI_INFO_AVAILABLE event addedt

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-11-05 14:25:46 +01:00
Peter Krempa
ed0f489352 qemu: capabilities: Fix logic for formatting 'reconnect' parameter
In commit e4d058866e I've converted the code to use the modern
'reconnect-ms' parameter instead of 'reconnect' but messed up the logic
for the time when 'reconnect' will be removed.

We need to check QEMU_CAPS_NETDEV_STREAM_RECONNECT_MILISECONDS
individually and not based on QEMU_CAPS_NETDEV_STREAM_RECONNECT.

Fix the logic as upstream qemu now removed 'reconnect'.

Fixes: e4d058866e
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-11-05 14:25:46 +01:00
Peter Krempa
d0316c24ca qemu: capabilities: Retire QEMU_CAPS_CHARDEV_RECONNECT
The flag was never queried since it's introduction in
5f7da98b3f

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-11-05 14:25:46 +01:00
Peter Krempa
ce0c3e0ea3 qemucapabilitiesdata: README: Add rules for dumps of unreleased qemu
Add a note that the filename should match the final version number and
that it's expected to do an update after the given qemu version gets
released.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2025-11-05 14:25:32 +01:00
Michal Privoznik
5e8698aa76 ci: Refresh with 'lcitool manifest'
The only change here is that fuse3 is installed instead of fuse.
This is needed by v11.9.0-9-gb100dabd6d which made the change in
spec file.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-11-05 14:22:17 +01:00
Daniel P. Berrangé
b100dabd6d rpm: change from fuse-devel to fuse3-devel
The meson.build already supports both fuse2 and fuse3, and fuse3
is in all Fedora versions we need, so switch to the newer version
unconditionally.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-11-04 08:36:24 +00:00
Daniel P. Berrangé
258bb23e94 Remove arm from KVM arches
Not only was ARM 7 dropped from Fedora 37, KVM support has also been
dropped in upstream Linux.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-11-04 08:36:08 +00:00
Jiri Denemark
ba16113c76 qemu: Ignore "ht" CPU feature
The feature does not do anything, QEMU will always set it according to
the CPU topology completely ignoring what we asked for. Unfortunately,
the way the state of "ht" is reported changed in QEMU 10.0.0 (commit
c6bd2dd634208).

QEMU older than 10.0.0 would just report whatever was specified on the
command line totally ignoring the actual state of the feature visible to
a guest. But after the change QEMU reports ht=on in case it enabled "ht"
based on the CPU topology. In all other cases QEMU still reports the
state requested on the command line.

As a result of this change a domain with multiple CPU threads started on
QEMU < 10.0.0 could not be migrated to QEMU >= 10.0.0 unless "ht" was
explicitly enabled in the domain XML because libvirt would see "ht"
enabled on the destination, but disabled on the source (the guest would
see "ht" enabled in both cases anyway). Outgoing migration of domains
started on QEMU >= 10.0.0 is not affected.

To fix this issue we can completely ignore "ht" both in the domain XML
and in the CPU properties reported by QEMU. With this fix incoming
migration to QEMU >= 10.0.0 works again.

Fixes: https://gitlab.com/libvirt/libvirt/-/issues/821
Fixes: https://issues.redhat.com/browse/RHEL-104216
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-11-03 12:33:26 +01:00
Jiri Denemark
4d5c1bc241 qemu_monitor: Filter CPU features reported by QEMU
Some features may be on our ignore list because they do nothing even
though QEMU still supports them and reports their state. But as the
features do nothing, the state reported by QEMU may not correspond to
what the guest sees. To avoid possible confusion we may just pretend
QEMU did not report any of the features on our ignore list.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-11-03 12:33:26 +01:00
Jiri Denemark
c15ae99dab qemu_process: Always fix CPUs on reconnect
We fix CPUs (i.e., remove ignored CPU features) only when libvirt/QEMU
combo used to start the domain is very old and doesn't support
query-cpu-model-expansion, in which case the CPU definition may contain
features that are unknown to QEMU. But even if both libvirt and QEMU are
new enough, we still want to remove features that do nothing to minimize
confusion or to avoid false migration issues.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-11-03 12:33:26 +01:00
Jiri Denemark
2ab6925218 qemu_domain: Fix qemuDomainFixupCPUs
The function was apparently created when the list of ignored CPU
features contained just cmt and related features. The list grew quite a
bit since then and this function stopped making sense as it would remove
all ignored features from CPU definitions but only if cmt was present.
The issue with cmt is long gone and this function was not really doing
anything. Surprisingly this didn't cause any real issues as we don't
update CPU definitions with features unknown to QEMU. But we may still
want to remove ignored features even though QEMU knows about them for
compatibility reasons.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-11-03 12:33:26 +01:00
Jiri Denemark
fbf44bc8cf qemu_domain: Simplify qemuDomainFixupCPUs
Since virCPUDefFilterFeatures never fails, we can use it for in-place
modifications instead of modifying a temporary virCPUDef copy.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-11-03 12:33:26 +01:00
Jiri Denemark
fd6cf1b44a cpu_conf: Make virCPUDefFilterFeatures return void
The only thing that can fail inside virCPUDefFilterFeatures is
VIR_DELETE_ELEMENT_INPLACE macro. The macro just calls
virDeleteElementsN, which reports a warning when all elements to be
removed are not within the array bounds and returns -1. The function
succeeds otherwise. But since VIR_DELETE_ELEMENT_INPLACE sets the number
of elements to be removed to 1 and we call it with i < cpu->nfeatures,
the safety check in virDeleteElementsN will never fail. And even if we
theoretically called it with wrong arguments, it just wouldn't do
anything.

Thus we can safely assume VIR_DELETE_ELEMENT_INPLACE always succeeds in
virCPUDefFilterFeatures and avoid reporting any errors to simplify
callers.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-11-03 12:33:26 +01:00
Jiri Denemark
3c7e44d3c8 Post-release version bump to 11.10.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2025-11-03 12:29:58 +01:00
Jiri Denemark
91f3e8b667 Release of libvirt-11.9.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2025-11-03 12:26:40 +01:00
Peter Krempa
cdbb3bc8d7 NEWS: mention 'manual' snapshot mode improvement
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2025-11-03 11:32:27 +01:00
Américo Monteiro
73b99b2ba0 Translated using Weblate (Portuguese)
Currently translated at 99.5% (10922 of 10976 strings)

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

Signed-off-by: Américo Monteiro <a_monteiro@gmx.com>
2025-11-03 07:03:50 +00:00
Anonymous
4bc00fd6da Translated using Weblate (Portuguese)
Currently translated at 99.5% (10922 of 10976 strings)

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

Signed-off-by: Anonymous <noreply@weblate.org>
2025-11-03 07:03:49 +00:00
Américo Monteiro
d31a4a2c78 Translated using Weblate (Portuguese)
Currently translated at 99.3% (10901 of 10976 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 98.9% (10856 of 10976 strings)

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

Signed-off-by: Américo Monteiro <a_monteiro@gmx.com>
2025-11-03 07:03:47 +00:00
Michal Privoznik
f80eec7eab 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>
2025-10-31 15:12:49 +01:00
Yuri Chornoivan
05ca6be8a6 Translated using Weblate (Ukrainian)
Currently translated at 100.0% (10976 of 10976 strings)

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

Signed-off-by: Yuri Chornoivan <yurchor@ukr.net>
2025-10-31 13:39:16 +01:00
Américo Monteiro
b59bed2603 Translated using Weblate (Portuguese)
Currently translated at 98.2% (10788 of 10976 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 98.0% (10766 of 10976 strings)

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

Signed-off-by: Américo Monteiro <a_monteiro@gmx.com>
2025-10-31 13:39:16 +01:00
Roman Bogorodskiy
63e989cc26 docs: drvbhyve: document NVMe device
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2025-10-31 13:38:50 +01:00
Roman Bogorodskiy
cc2b022c35 NEWS: document bhyve changes for 11.9.0
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2025-10-31 13:38:50 +01:00
Michal Privoznik
86bba8f1d9 drvch: Document config file locations
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2025-10-31 13:14:16 +01:00
Michal Privoznik
3299ce060f ch: Load ch.conf from SYSCONFDIR
Config files for system instances of our drivers (e.g.
"ch:///system", "qemu:///system", etc.) live under /etc/libvirt.
But for some reason, the CH driver was trying to load the config
file from /var/lib/libvirt/ch/ even though the file is installed
under /etc/libvirt per the following line from src/meson.build:

  install_data(virt_conf_files, install_dir: confdir)

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2025-10-31 13:14:12 +01:00
Michal Privoznik
4c5021bc92 drvch: Demote example section to a subsection
In our drvch.rst there's a section with example XML. Demote it to
a subsection ('-') since the whole document starts with section
('=') and this paragraph is really just a child of the root.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2025-10-31 13:14:08 +01:00
Michal Privoznik
a96a4b04e1 docs: Document supported URIs for CH driver
Our docs suggest that only session mode is supported for CH
drvier. Well, that's clearly not case. Document the system URI
and refer to other (remote) supported transport modes (yeah, that
works too).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2025-10-31 13:14:02 +01:00
Weblate
47683ca63d 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>
2025-10-29 13:04:58 +01:00
Jiri Denemark
339ff29e5d po: Refresh potfile for v11.9.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2025-10-29 12:59:52 +01:00
Michal Privoznik
fa89c178a5 domain_conf: Avoid memory leak in virDomainMemoryDefFree()
In my one of my recent commits I've introduced new member to
virDomainMemoryDef struct. While allocated in
virDomainMemoryDefParseXML() its counterpart for freeing is
missing in virDomainMemoryDefFree(). Add it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2025-10-29 12:43:39 +01:00
Michal Privoznik
ccc0538329 NEWS: Document virtio options for memory models
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2025-10-29 12:09:28 +01:00
Michal Privoznik
e6d1cb69d5 qemu_command: Generate virtio options for memory device
Thanks to previous refactors (namely v11.1.0-rc1~142) this is
trivial. There's all the infrastructure needed to generate virtio
options onto cmd line, all that's left to do is set a pointer to
appropriate struct member.

Resolves: https://issues.redhat.com/browse/RHEL-7493
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2025-10-29 12:09:28 +01:00
Michal Privoznik
4848c85053 conf: Introduce virtio options for virtio memory models
Both virtio-mem and virtio-pmem memory models are virtio devices
and as such support setting various virtio knobs (iommu, ats,
packed, page_per_vq) common to other virtio devices.

Introduce <driver/> element as a child to <memory/> element, just
like we do for other virtio devices, where aforementioned knobs
live.

NB, this is without docs changes, since we do not document which
virtio devices support these knobs and each one is already
documented.

Also, the virtio-options.xml test needed some additional
adjustment (apart from adding virtio-mem device) to enable memory
hotplug.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2025-10-29 12:09:28 +01:00
Michal Privoznik
3c6d7f2705 qemu: Use virDomainMemoryIsVirtioModel()
Instead of having these big switch()-es that enumerate all memory
models (but act only on virtio models), let's use
virDomainMemoryIsVirtioModel() helper instead.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2025-10-29 12:09:28 +01:00
Michal Privoznik
0d46a1f4d5 conf: Introduce virDomainMemoryIsVirtioModel()
The aim is to return true for memory models that are virtio
devices (virtio-mem and virtio-pmem) and false for everything
else.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2025-10-29 12:09:28 +01:00
Michal Privoznik
6787f82cfc domain_conf: Switch to virXMLFormatElement() in virDomainMemoryDefFormat()
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2025-10-29 12:09:28 +01:00
Michal Privoznik
30eab13fc9 domain_conf: Make virDomainMemoryDefFormat() return void
The only thing that's possibly making virDomainMemoryDefFormat()
fail is call to virDomainMemorySourceDefFormat() but that always
returns zero. Make both functions return void so callers are not
confused.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2025-10-29 12:09:28 +01:00
Roman Bogorodskiy
93c4b1bf55 bhyve: support specifying disk rotation rate
Bhyve supports specifying disk rotation rate using the nmrr attribute,
e.g.:

 -s 3:0,ahci,hd:/data/img/freebsd.img,nmrr=1

Where 1 means the SSD, 0 (default) means do not report, and other values
specify the actual RPM.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-10-29 11:45:42 +01:00
Roman Bogorodskiy
4d70b2c783 bhyve: nvme: check if NVMe is supported by bhyve
For domains using NVMe disks make sure that the bhyve binary supports
that by checking capabilities.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-10-29 11:45:42 +01:00
Roman Bogorodskiy
a997aee58f bhyve: do not allow more than one NVMe device per controller
As bhyve does not have explicit notion of controllers, and for NVMe
devices it allows to specify one a single source for for a given PCI
address, it effectively means that there could be only one device per
controller.

Update validation code to check this case.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-10-29 11:45:42 +01:00
Roman Bogorodskiy
8d9bf732a7 bhyve: tests: cover 2 NVMe devices on 2 controllers case
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-10-29 11:45:42 +01:00
Roman Bogorodskiy
79e46b1698 bhyve: implement NVMe device support
NVMe devices in bhyve are modeled this way:

 -s $pciaddr,nvme,devpath[,opts]

devpath can be a path to the image or the block device. It also can be
"ram=size_in_MiB", but this is not covered by this series.

There could be only a single device per PCI address.

Optional configuration options (such as max number of queues, concurrent
I/O requests, etc) are also not covered by this series.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-10-29 11:45:42 +01:00
Salvatore Cocuzza
1ab27a5b96 Translated using Weblate (Italian)
Currently translated at 33.6% (3694 of 10962 strings)

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

Signed-off-by: Salvatore Cocuzza <info@salvatorecocuzza.it>
2025-10-29 10:07:00 +01:00
Fco. Javier F. Serrador
6038ed07c2 Translated using Weblate (Spanish)
Currently translated at 79.1% (8677 of 10962 strings)

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

Signed-off-by: "Fco. Javier F. Serrador" <fserrador@gmail.com>
2025-10-29 10:06:59 +01:00
Ricky Tigg
d207136b5d Translated using Weblate (Finnish)
Currently translated at 22.2% (2437 of 10962 strings)

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

Signed-off-by: Ricky Tigg <ricky.tigg@gmail.com>
2025-10-29 10:06:59 +01:00
Sergey A
02266588b4 Translated using Weblate (Russian)
Currently translated at 82.3% (9029 of 10962 strings)

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

Signed-off-by: "Sergey A." <Ser82-png@yandex.ru>
2025-10-29 10:06:58 +01:00
Américo Monteiro
92e1519395 Translated using Weblate (Portuguese)
Currently translated at 97.5% (10692 of 10962 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 97.4% (10687 of 10962 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 97.0% (10642 of 10962 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 96.3% (10562 of 10962 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 96.1% (10545 of 10962 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 95.4% (10462 of 10962 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 95.2% (10445 of 10962 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 94.5% (10362 of 10962 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 94.0% (10307 of 10962 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 93.3% (10230 of 10962 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 93.0% (10199 of 10962 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 92.2% (10117 of 10962 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 92.0% (10090 of 10962 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 91.3% (10013 of 10962 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 91.0% (9979 of 10962 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 90.5% (9926 of 10962 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 90.3% (9902 of 10962 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 89.3% (9797 of 10962 strings)

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

Signed-off-by: Américo Monteiro <a_monteiro@gmx.com>
2025-10-29 10:06:58 +01:00
Peter Krempa
0a30b6d2e5 qemuDomainBlocksStatsGather: Fix blockstats gathering after refactor
Commit 58aa005f3e which refactored how block stats are stored
intended to change the code path where stats for all devices are totaled
together by allocating new stats object and using that but the commit
forgot to actually change the pointers inside the loop.

Unfortunately this was not caught by the compiler as there were
pre-existing pointers of the same type with the same name, which
resulted into a NULL dereference.

Fixes: 58aa005f3e
Closes: https://gitlab.com/libvirt/libvirt/-/issues/827
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2025-10-29 10:05:52 +01:00
Cole Robinson
f6ea64f182 conf: never reject <disk> <seclabel relabel='no'> overrides
Trying to disable <seclabel> for the whole <domain> and _also_
disable <seclabel> at the <disk> level will fail with:

  error: unsupported configuration: label overrides require relabeling to be enabled at the domain level

which seems wrong. Instead skip the validation when disk seclabel
has relabel='no', that config should always be valid.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2025-10-24 14:38:38 -04:00
Stefan Kober
be638396f0 NEWS: ch: announce network hotplug feature
On-behalf-of: SAP stefan.kober@sap.com
Signed-off-by: Stefan Kober <stefan.kober@cyberus-technology.de>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-10-23 11:25:35 +02:00
Stefan Kober
058df74ed6 ch: implement network device hot detach
On-behalf-of: SAP stefan.kober@sap.com
Signed-off-by: Stefan Kober <stefan.kober@cyberus-technology.de>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-10-23 11:25:33 +02:00
Stefan Kober
92441ba35a ch: implement network device hot attach
On-behalf-of: SAP stefan.kober@sap.com
Signed-off-by: Stefan Kober <stefan.kober@cyberus-technology.de>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-10-23 11:25:31 +02:00
Stefan Kober
6a4c59e993 ch: add net device alias assignment
On-behalf-of: SAP stefan.kober@sap.com
Signed-off-by: Stefan Kober <stefan.kober@cyberus-technology.de>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-10-23 11:25:28 +02:00
Hector Cao
b90cf0c916 apparmor: Allow AMD-SEV device access for AMD-SEV VM
AMD-SEV virtual machines interact with the underlying
AMD-SEV technology through the character device /dev/sev.
Currently, the AppArmor profile does not include the rule
required to allow this access.

There are two main approaches to address this limitation:

1) Add the required rule to the libvirt-qemu abstraction.
2) Dynamically add the rule only when the VM is an AMD-SEV
   guest.

Since AMD-SEV guests represent a niche use case, it is more
appropriate to apply the rule dynamically rather than granting
access to all VMs through a global abstraction change.

This commit implements option (2) by modifying the virt-aa-helper
binary to insert the necessary rule into the AppArmor dynamic
profile when the VM is identified as an AMD-SEV guest.

The added entry in the generated libvirt-<uuid>.files file
will look like:

  ...
  "/dev/sev" rw,
  ...

Signed-off-by: Hector Cao <hector.cao@canonical.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-10-23 10:22:46 +02:00
Praveen K Paladugu
d8d3595851 qemu: Drop /dev/kvm from default device ACL
A domain that runs with TCG emulation does not need kvm device, so drop
it from default device ACL.

Dynamically grant access to /dev/kvm based on domain type.

Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-10-23 09:50:32 +02:00
Friedrich Oslage
f3f8408975 NEWS: Document Hyper-v never notify feature for spinlocks
Signed-off-by: Friedrich Oslage <friedrich@oslage.de>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-10-22 15:17:44 +02:00
Friedrich Oslage
66a47f8049 qemu: Update hyperv spinlock retries count default
Update default to 0xFFFFFFFF ("never notify" in qemu) and make retries
attribute optional.

Signed-off-by: Friedrich Oslage <friedrich@oslage.de>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-10-22 15:17:44 +02:00
Friedrich Oslage
d0de1b89be qemu: Fix hyperv spinlock retries count type mismatch
Use unsigned int for sprintf and update tests to ensure it can hold INT_MAX+1.

Signed-off-by: Friedrich Oslage <friedrich@oslage.de>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-10-22 15:17:44 +02:00
Ján Tomko
6862969cf8 qemu: forbid readonly attribute for externally launched virtiofsd
In that case, libvirtd cannot set it on the command line because
virtiofsd is not launched by libvirt.

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

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-10-22 14:35:54 +02:00
Peter Krempa
69e5ad478e qemumonitorjsontes: Properly free blockstats
In the patch converting block stats to objects in 58aa005f3e I forgot
to change the allocation of the hash table in qemumonitorjsontest which
doesn't use the wrapper. This problem didn't manifest itself with newer
glib versions.

Use 'g_object_unref' instead of 'g_free'.

Fixes: 58aa005f3e
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2025-10-21 18:29:08 +02:00
Peter Krempa
45f49ad340 Remove qemuMonitorBlockStatsUpdateCapacityBlockdev
Remove the function and address the ripple effect the removal has.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-10-21 15:35:45 +02:00
Peter Krempa
5b0fd22920 qemuMonitorJSONGetAllBlockStatsInfo: Directly probe data from 'query-named-block-nodes'
Currently the data which was probed for statistics from
'query-named-block-nodes' was updated in a separate call in
qemuMonitorJSONBlockStatsUpdateCapacityBlockdev.

This patch moves and adapts the code so that everything is probed in
qemuMonitorJSONGetAllBlockStatsInfo.

qemuMonitorJSONBlockStatsUpdateCapacityBlockdev is now an empty function
and will be removed later.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-10-21 15:35:45 +02:00
Peter Krempa
a189ad03bb qemuMonitorJSONBlockStatsUpdateCapacityData: Merge into caller
It's called just from
qemuMonitorJSONBlockStatsUpdateCapacityBlockdevWorker. Merging it in
makes the code much simpler especially when combined with a change to
APIs that can't fail.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-10-21 15:35:45 +02:00
Peter Krempa
5485e7e832 qemuMigrationCookieAddNBD: Use qemuBlockGetNamedNodeData to fetch the capacities
'qemuMonitorBlockStatsUpdateCapacityBlockdev' uses the same command
internally.

Upcoming patches will want to merge qemuMonitorBlockStatsUpdateCapacityBlockdev
into qemuMonitorGetAllBlockStatsInfo and qemuMigrationCookieAddNBD is
the only place that doesn't call qemuMonitorGetAllBlockStatsInfo.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-10-21 15:35:45 +02:00
Peter Krempa
58aa005f3e qemu: monitor: Rework qemuBlockStats into a g_object
Create the g_object boilerplate and store references in the hash table
instead of copies.

This will simplify upcoming code which will add allocated fields into
qemuBlockStats.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-10-21 15:35:45 +02:00
Peter Krempa
d35e519dca qemu_monitor_json.h: Use consistent function hader coding style
Convert the rest of the header file to the new prevailing coding style.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-10-21 15:35:45 +02:00
Peter Krempa
6773f77dad qemu_monitor_json.c: Use consistent function hader coding style
Convert the rest of the code to the new prevailing coding style. Commit
6e6a11bc0a did the same for the header file.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-10-21 15:35:45 +02:00
Peter Krempa
74ca46972f qemu: monitor: Remove qemuMonitorQueryBlockstats
Unused since v8.6.0-154-g75a0fbe420

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-10-21 15:35:45 +02:00
Peter Krempa
96980df098 virNetDevVlanParse: Refactor cleanup
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-10-21 15:33:54 +02:00
Peter Krempa
e412761206 virNetDevVlanParse: Use g_autofree for temporary variables
Automatically free the variables to prevent leaks when returning from
middle of the function.

Fixes: 1de6fd5edb
Closes: https://gitlab.com/libvirt/libvirt/-/issues/824
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-10-21 15:33:54 +02:00
Peter Krempa
40c4e4c847 virNetDevVlanParse: Don't clear data on failure
Clearing the data on failure is pointless as it's still cleared when
other parts of the parser fail.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-10-21 15:33:54 +02:00
Peter Krempa
4c32ad3469 qemuxmlconftest: Add example for "sgio='filtered'" disk option
The test suite validates only the error with the "sgio='unfiltered'"
setting which isn't supported by the qemu driver. Validate also the
'filtered' used explicitly (the default behaviour if unspecified is the
same as 'filtered').

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-10-21 15:33:21 +02:00
Peter Krempa
1ebee849db docs: snapshot: Add a note that blockjobs ought to be avoided with 'manual' snapshots
Using a blockjob will reactivate the block nodes in qemu and thus e.g.
qcow2 metadata such as bitmaps may become marked as dirty. Users of
'manual' snapshots ought to avoid those.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-10-21 15:32:40 +02:00
Peter Krempa
69e066c0ba qemu: snapshot: Allow snapshot consisting only of 'manual'-y handled disks
The 'manual' snapshot mode is meant for disks where the users wants to
take a snapshot via means outside of libvirt, e.g. on a SAN network.

Allow creating a snapshot which consists entirely of 'manual' disks. For
now this effectively means that the VM will be paused but in the future
more logic can be added to ensure consistency.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-10-21 15:32:40 +02:00
Peter Krempa
2e19e68093 qemu: snapshot: Deactivate block nodes on manually snapshotted disks
If the user wants to manually preserve state of the disk we need, apart
from pausing the machine to quiesce all writes, also deactivate the
block nodes of the device. This ensures that qemu writes out metadata
(e.g. block dirty bitmaps) which are normally stored only in memory,
thus allowing a consistent snapshot including the metadata.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-10-21 15:32:40 +02:00
Peter Krempa
f879d5f403 qemu: migration: Don't reactivate block nodes after migration failure any more
The other code paths which do want to issue block jobs can reactivate
the nodes when necessary so we don't need to do that unconditionally
after failed/cancelled migration.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-10-21 15:32:40 +02:00
Peter Krempa
7b5566ce67 qemu: Re-activate block nodes before storage operations
Upcoming patches will modify how we treat inactive block nodes so that
we can properly deactivate nodes for 'manual' disk snapshot mode.

Re-activate the nodes before operations requiring them. This includes
also query operations where we e.g. probe bitmaps.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-10-21 15:32:39 +02:00
Peter Krempa
84ad496494 qemu: block: Introduce helper function to ensure that block nodes are active
Upcoming changes to snapshot code will break the assumption that block
nodes are always active (if the function is able to acquire a modify
job).

Introduce qemuBlockNodesEnsureActive that checks if the block graph in
qemu contains any inactive nodes and if yes reactivates everything.

The function will be used on code paths such as blockjobs which require
the nodes to be active.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-10-21 15:32:39 +02:00
Peter Krempa
648b0ddb13 qemu: monitor: Track inactive state of block nodes in 'qemuBlockNamedNodeData'
New qemus report if given block node is active. We'll be using this data
to decide if we need to reactivate them prior to blockjobs. Extract the
data as 'inactive' as it's simpler to track and we care only about
inactive nodes.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-10-21 15:32:39 +02:00
Peter Krempa
ac6b351b42 qemuDomainGetStatsCpuProc: Use string constants for CPU stats
Commit 947306957e added the constants and fixed other uses but didn't
fix qemuDomainGetStatsCpuProc.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2025-10-21 15:31:39 +02:00
Michal Privoznik
0c1a1f9fd4 qemu: Drop reconnectBlockjobs from _qemuDomainObjPrivate struct
The 'reconnectBlockjobs' member of the _qemuDomainObjPrivate
struct is basically unused after v8.7.0-rc1~110. It's not even
formatted into the status XML, just parsed. This makes needless
noise.  Just drop the member.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2025-10-15 12:27:50 +02:00
Michal Privoznik
7353bc5fda NEWS: Document new host-model hyperv mode
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-15 10:04:12 +02:00
Michal Privoznik
8458bb521e qemu_process: Populate hyperv features for host-model
Pretty straightforward. The only "weird" thing here is that
'hv-time' enlightenment is exposed as a <timer/> under <clock/>
element. Since it's required by 'hv-stimer' and
'hv-stimer-direct' it needs to be enabled too.

Resolves: https://issues.redhat.com/browse/RHEL-114003
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-15 10:04:12 +02:00
Michal Privoznik
c181c7dd13 conf: Introduce hyperv host-model mode
So far we have two modes for hyperv features:

1) custom, where users have to enable features explicitly, and
2) passthrough, where hypervisor enables features automagically.

Problem with 'custom' mode is that some features are not plain
on/off switches but expect int/string value. Until very recently,
these were not reported in domcaps. And even if they were it's a
bit cumbersome.

Problem with 'passthrough' mode is that users don't get to see
the expanded list of enlightenments enabled.

Therefore, mimic what we're already doing with CPUs: have
'host-model' which gets expanded at domain startup and is fixed
throughout domain's run.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-15 10:04:12 +02:00
Michal Privoznik
4545827ba3 qemu_caps: Introduce virQEMUCapsGetHypervCapabilities()
We'll need to access hypervCapabilities memeber later on.
Introduce a getter function.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-15 10:04:12 +02:00
Michal Privoznik
ba011bebd9 qemu_capabilities: Fetch new hyperv domcaps
Now that everything is prepared, we can start storing the default
values for some hyperv features that are reported in domain
capabilities XML later.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-15 10:04:12 +02:00
Michal Privoznik
0141f6544c qemu_capabilities: Format and parse new hyperv domcaps members
After previous commit the virDomainCapsFeatureHyperv struct
gained new members. Since virQEMUCaps struct holds a pointer to
such struct we must format and parse it to/from capabilities XML.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-15 10:04:12 +02:00
Michal Privoznik
57d2f4a0f0 conf: Report default hyperv values in domain capabilities
So far the set of available Hyper-V enlightenments are reported
in domain capabilities. Well, some enlightenments are more than
just simple on/off switch. For instance, the 'spinlocks'
enlightenment expects a number, or 'vendor_id' expects a string.

All of these have some default values (at least in QEMU) and are
used when the passthrough mode is set.

Allow querying these defaults in domain capabilities XML.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-15 10:04:11 +02:00
Michal Privoznik
4cc4f0b04a docs: Drop remark on now unsupported version of QEMU
In formatdomaincaps.rst under section documenting hyperv features
there's a paragraph describing behaviour with QEMU older than
6.1.0. Well, as of v11.2.0-rc1~216 the minimum required version
is 6.2.0 rendering the paragraph needless. Drop it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-15 10:04:11 +02:00
Michal Privoznik
47271c204e conf: More hyperv related members into a single struct
So far, we have an array of integers (hyperv_features), an uint
(hyperv_spinlocks), a string (hyperv_vendor_id) and some tristate
switches scattered across virDomainDef. Soon, new knobs will be
introduced and keeping the current state would only worsen
readability.

Introduce virDomainHypervFeatures struct to place hyperv related
features there.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-15 10:04:11 +02:00
Michal Privoznik
064682ab33 libxl: Simplify setting HyperV features
Inside of libxlMakeDomBuildInfo() there's a huge switch() for
each virDomainHyperv case. Instead of checking whether feature is
enabled in each 'case', let's just check it at the beginning of
each loop.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-15 10:04:11 +02:00
Michal Privoznik
c66bbac8d5 qemu_command: Prefer virBufferAddLit() in qemuBuildCpuHypervCommandLine()
Using virBufferAsprintf() just to concatenate two literal strings
is excessive. Use virBufferAddLit().

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-15 10:04:11 +02:00
Michal Privoznik
8b316fac49 qemu_command: Move hyperv cmd line generation into a function
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-15 10:04:11 +02:00
Michal Privoznik
727c858d6a qemu_caps: Prefer VIR_DOMAIN_CAPS_ENUM_IS_SET()
While virDomainCapsEnum is in fact a bitmap, we also have a macro
to manipulate/query individual bits. Prefer it to make the code
more readable.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-15 10:04:11 +02:00
Michal Privoznik
c9716c0e09 domain_conf: Use virXMLFormatElement() to format hyperv features
Not only is it more modern that old virBufferAsprintf() of
opening and closing tag, it's also aware of child elements buffer
and thus formats a singleton properly.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-15 10:04:11 +02:00
Michal Privoznik
78aa096ae2 domain_conf: Move format of hyperv features into a function
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-15 10:04:11 +02:00
Michal Privoznik
5369f071e4 qemu: Use virXPathTristateBool()
There are two places in our code base which can use freshly
introduced virXPathTristateBool():
qemuStorageSourcePrivateDataParse() and
qemuDomainObjPrivateXMLParseBlockjobs().

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-15 10:04:07 +02:00
Michal Privoznik
e3e4c620f1 virxml: Introduce virXPathTristateBool()
Similarly to other virXPath* functions, let's have a helper that
evaluates an XPath and stores the value into virTristateBool.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2025-10-15 09:56:30 +02:00
Michal Privoznik
c689aa80c1 virxml: Introduce virXPathTristateSwitch()
Similarly to other virXPath* functions, let's have a helper that
evaluates an XPath and stores the value into virTristateSwitch.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-15 09:56:30 +02:00
Michal Privoznik
b42a12174c wireshark: Adapt to wireshark-4.6.0
The main difference is that wmem_packet_scope() is gone [1] but
the packet_info struct has 'pool` member which points to the
allocator used for given packet.

Unfortunately, while we were given pointer to packet_info at the
entry level to our dissector (dissect_libvirt() ->
tcp_dissect_pdus() -> dissect_libvirt_message()) it was never
propagated to generated/primitive dissectors.

But not all dissectors need to allocate memory, so mark the new
argument as unused. And while our generator could be rewritten so
that the argument is annotated as unused iff it's really unused,
I couldn't bother rewriting it. It's generated code after all.
Too much work for little gain.

Another significant change is that val_to_str() now requires new
argument: pointer to allocator to use because it always allocates
new memory [2][3].

1: 5ca5c9ca37
2: b635997624
3: 84799be215
Resolves: https://gitlab.com/libvirt/libvirt/-/issues/823
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2025-10-14 15:08:33 +02:00
Michal Privoznik
002b9f559d wireshark: Don't leak column strings
One of the problems of using val_to_str() is that it may return a
const string from given table ('vs'), OR return an allocated one.
Since the caller has no idea which case it is, it resides to safe
option and don't free returned string. But that might lead to a
memleak. This behaviour is fixed with wireshark-4.6.0 and support
for it will be introduced soon. But first, make vir_val_to_str()
behave like fixed val_to_str() from newer wireshark: just always
allocate the string.

Now, if val_to_str() needs to allocate new memory it obtains
allocator by calling wmem_packet_scope() which is what we may do
too.

Hand in hand with that, we need to free the memory using the
correct allocator, hence wmem_free(). But let's put it into a
wrapper vir_wmem_free() because just like val_to_str(), it'll
need additional argument when adapting to new wireshark.

Oh, and freeing the memory right after col_add_fstr() is safe as
it uses vsnprintf() under the hood to format passed args.

One last thing, the wmem.h file used to live under epan/wmem/ but
then in v3.5.0~240 [1] was moved to wsutil/wmem/.

1: 7f9c1f5f92
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2025-10-14 15:08:29 +02:00
Michal Privoznik
ba2c4bdd5c wireshark: Introduce and use vir_val_to_str()
Wireshark offers val_to_str() function which converts numeric
value to string by looking up value ('val') in an array ('vs') of
<val, string> pairs. If no corresponding string is found, then
the value is formatted using given 'fmt' string.

Starting from wireshark-4.6.0 not only this function gained
another argument but also returns a strdup()-ed string. To keep
our code simple, let's introduce a wrapper so which can be then
adjusted as needed.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2025-10-14 15:08:28 +02:00
Michal Privoznik
1086888f95 wireshark: Don't special case retval of get_program_data() in dissect_libvirt_message()
The get_program_data() function returns a pointer (in this
specific case to an array of procedure strings) which, if
non-NULL is then passed val_to_str(). Well, if val_to_str() sees
NULL it is treated gracefully, i.e. like if the numeric value
'proc' wasn't found in the array.

Therefore, there's no need to special case call to
col_append_fstr(). Both result into the same behaviour.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2025-10-14 15:08:28 +02:00
Michal Privoznik
7374c4ecbd wireshark: Fix int type of some virNetMessageHeader members
Our virNetMessageHeader is a struct that's declared as follows:

  struct virNetMessageHeader {
      unsigned prog;
      unsigned vers;
      int proc;
      virNetMessageType type;
      unsigned serial;
      virNetMessageStatus status;
  };

Now, per RFC 4506 enums are also encoded as signed integers. This
means, that only 'prog', 'vers' and 'serial' are really unsigned
integers. The others ('proc', 'type' and 'status') are encoded as
signed integers. Fix their type when dissecting.

While at it, also follow latest trend in wireshark and switch
from guint32 to uint32_t.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2025-10-14 15:08:27 +02:00
Michal Privoznik
02a0e78bf5 wireshark: Move WIRESHARK_VERSION macro definition
Soon, other parts of the wireshark code will need to
differentiate wrt wireshark version. Therefore, move the
WIRESHARK_VERSION macro definition among with its deps into
packet-libvirt.h.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2025-10-14 15:08:26 +02:00
Michal Privoznik
41d3b45797 wireshark: Switch header files to #pragma once
The genxdrstub.pl script generates some header files. But they
use the old pattern to guard against multiple inclusion:

  #ifndef SOMETHING_H
  #define SOMETHING_H
  ...
  #endif

Change the script to generate just '#pragma once' used everywhere
else in our code.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2025-10-14 15:08:25 +02:00
Michal Privoznik
b825bb556b wireshark: Drop needless declaration of proto_register_libvirt() and proto_reg_handoff_libvirt()
Both proto_register_libvirt() and proto_reg_handoff_libvirt() are
declared in packet-libvirt.h which is included from plugin.c.
There's no need to provide another declaration in plugin.c.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2025-10-14 15:08:23 +02:00
Michal Privoznik
235e265b41 NEWS: Document Hyper-V enlightenment validation
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-14 09:46:00 +02:00
Michal Privoznik
1d2873f9c6 qemu_validate: Reflect dependencies of hv-tlbflush-direct
Per QEMU documentation (docs/system/i386/hyperv.rst):

``hv-tlbflush-direct``
  The enlightenment is nested specific, it targets Hyper-V on KVM guests. <snip/>

  Requires: ``hv-vapic``

Reflect this dependency when validating domain definition.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-14 09:46:00 +02:00
Michal Privoznik
c6114de13c qemu_validate: Reflect dependencies of hv-evmcs
Per QEMU documentation (docs/system/i386/hyperv.rst):

``hv-evmcs``
  The enlightenment is nested specific, it targets Hyper-V on KVM guests. <snip/>

  Requires: ``hv-vapic``

Reflect this dependency when validating domain definition.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-14 09:46:00 +02:00
Michal Privoznik
f4557315f3 qemu_validate: Reflect dependencies of hv-ipi
Per QEMU documentation (docs/system/i386/hyperv.rst):

``hv-ipi``
  Enables paravirtualized IPI send mechanism. <snip/>

  Requires: ``hv-vpindex``

Reflect this dependency when validating domain definition.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-14 09:46:00 +02:00
Michal Privoznik
941af83360 qemu_validate: Reflect dependencies of hv-tlbflush
Per QEMU documentation (docs/system/i386/hyperv.rst):

``hv-tlbflush``
  Enables paravirtualized TLB shoot-down mechanism. <snip/>

  Requires: ``hv-vpindex``

Reflect this dependency when validating domain definition.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-14 09:46:00 +02:00
Michal Privoznik
da261327ea qemu_validate: Reflect dependencies of hv-stimer
Per QEMU documentation (docs/system/i386/hyperv.rst):

``hv-stimer``
  Enables Hyper-V synthetic timers. <snip/>

  Requires: ``hv-vpindex``, ``hv-synic``, ``hv-time``

Reflect these dependencies when validating domain definition.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-14 09:45:59 +02:00
Michal Privoznik
1822d030c3 qemu_validate: Reflect dependencies of hv-synic
Per QEMU documentation (docs/system/i386/hyperv.rst):

``hv-synic``
  Enables Hyper-V Synthetic interrupt controller <snip/>

  Requires: ``hv-vpindex``

Reflect this dependency when validating domain definition.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-14 09:45:59 +02:00
Michal Privoznik
da76c1e8fe qemuxmlconfdata: Adjust hv-stimer related tests
In QEMU, hv-stimer and hv-stimer-direct require hv-time. Reflect
this fact in our tests.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-14 09:45:59 +02:00
Michal Privoznik
359909749a conf: Introduce virDomainDefHasTimer()
This is a simple helper to tell whether domain definition has
certain type of timer or not.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-14 09:45:59 +02:00
Michal Privoznik
6b71d32779 src: Drop needless typecast to virDomainTimerNameType
This was missed in v8.10.0-rc1~229 which switched the 'name'
member of _virDomainTimerDef struct from int to
virDomainTimerNameType.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-14 09:45:59 +02:00
Roman Bogorodskiy
88225150be network: pf: split flush and rules commands
Current implementation uses a single command to flush the old rules and
create new ones. This is not optimal because if flush fails for some
non-critical reasons (e.g. because the anchor didn't previously exist),
it will block rules creation and network start.

Split this command into two: one for flush, and one for rules creation.
Also, don't fail if the flush command fails.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2025-10-08 18:24:17 +02:00
Peter Krempa
0756fefdc5 syntax-check: Prohibit the non-clearing 'g_new'
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2025-10-08 09:24:42 +02:00
Peter Krempa
a74b5bc37f Replace all use of 'g_new' with 'g_new0'
Always use the version which clears the allocated memory.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2025-10-08 09:24:42 +02:00
Peter Krempa
5bc43f95e5 qemu-replies-tool: Fix logic error when dumping device properties
In a recent refactor the block of code outputting device properties was
mis-indented causing it to only work on device properties which have no
'default-value'.

Fixes: 301e1ba244
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-08 09:24:26 +02:00
Peter Krempa
076545ef27 qemucapabilitiestest: Update 'caps_10.2.0_x86_64' to v10.1.0-1060-geb7abb4a71
Notable changes:
 - 10.2 machine types added
 - 'prefetchi' is now migratable on the detected cpu
 - 'cpr-exec-command' migration parameter added
 - 'inject-ghes-v2-error' command added (unstable)
 - 'amd-iommu' device gained 'dma-remap' and 'dma-translation' options
 - 'virtio-net-pci' device gained 'host_tunnel', 'host_tunnel_csum',
   'guest_tunnel', and 'guest_tunnel_csum' options

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2025-10-07 14:05:19 +02:00
Daniel P. Berrangé
31800ec2b1 locking: use & install test_libvirt_sanlock.sug for both QEMU & LibXL
The RPM specfile was referencing test_libvirt_sanlock.aug in the common
file list, for both QEMU and LibXL. This makes sense since the
sanlock.conf file is cloned for both drivers. The libvirt_sanlock.aug
file, however, was missing a reference to the LibXL copy of the config.

Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-10-06 17:28:46 +01:00
Daniel P. Berrangé
cfed8b9e55 Revert "rpm: disable sanlock when QEMU is disabled"
This reverts commit fefde61758.

The commit was mistaken, as sanlock is enabled for libxl too,
however, the install of test_libvirt_sanlock.aug was missing
when QEMU was disabled, causing the RPM build failure.

Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-10-06 17:28:46 +01:00
Andrea Bolognani
fcfd6f12c5 qemu: Don't add memballoon by default on RISC-V
The idea of adding devices such as USB controllers or memory
balloons by default comes from attempting to match QEMU's own
defaults at a time when x86 was the only game in town.

The unfortunate consequence of this is that, if the user does
NOT want the device in question to be present, they have to
create a special XML element with model=none to stop libvirt.
This is counter-intuitive.

For architectures for which we've added support more recently,
such as aarch64 and loongarch64, we've generally chosen to do
the sensible thing and create very minimal guests by default.
The user is of course still able to ask for additional hardware
if they so desire.

When adding RISC-V support, we accidentally forgot to skip the
creation of the default memory balloon. Address that oversight.

This is technically a breaking change, but it's fairly safe to
apply it because:

  * it doesn't affect existing guests;
  * virt-manager will automatically add the memballoon device
    by default anyway;
  * RISC-V is still not widely used.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2025-10-06 18:12:41 +02:00
Andrea Bolognani
574d797f59 news: Update for USB controller model selection improvements
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-06 11:16:36 +02:00
Andrea Bolognani
436485cb7c qemu: Remove use of piix3-uhci for non-x86
There are still a couple of scenarios in which we end up
using the Intel-specific piix3-uhci (USB1) controller for
non-x86 guests.

Remove these uses, leaving the generic pci-ohci (USB1)
controller as either the fallback or default for situations
where no better choice can be made.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-06 11:16:34 +02:00
Andrea Bolognani
198e68197c qemu: Remove fallback to piix3-uhci for Arm virt guests
This is another case where the current behavior can be traced
back to the fact that x86 was the only architecture to really
be taken into account for a long time: in reality, using an
Intel-specific USB1 controller for a modern, PCIe-native,
virtualization-friendly Arm guest just doesn't make any sense.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-06 11:16:32 +02:00
Andrea Bolognani
21e584a4fb qemu: Don't special-case realview/versatilebp for USB
We have special behavior for these two machine types, and
more specifically for the USB controller that they get added
by default - something that doesn't generally happen on Arm.

Not only this is inconsistent with other machine types for
the architecture, it also means that the model for the USB
controller that gets added automatically (pci-ohci, USB1) is
worse than the default one for user-added USB controllers
(qemu-xhci, USB3) which is just silly.

Bring these machine types in line with the rest of the
architecture.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-06 11:16:29 +02:00
Andrea Bolognani
bfe1aca211 qemu: Unify USB controllers across Arm architectures
Currently we differentiate between 64-bit and 32-bit
architectures, which doesn't seem very reasonable
considering that the same machine types are available
in both cases. Remove this inconsistency.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-06 11:16:27 +02:00
Andrea Bolognani
d9add4c3f1 qemu: Use qemu-xhci with no fallback on RISC-V
Similar to loongarch64, the current behavior is a result
of the way the existing code was written rather than a
consequence of an intentional choice. Make the two
architectures behave the same way, as they should have
from the start.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-06 11:16:25 +02:00
Andrea Bolognani
a618b9e1cd qemu: Use qemu-xhci with no fallback on loongarch64
The architecture was introduced at a time when USB3 in
general, and qemu-xhci in particular, had already been
well established for years. Having USB1 controllers as a
fallback was something that happened by mistake due to
the way the pre-existing code was organized rather than
because of a conscious decision. Make things work the
way they should have in the first place.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-06 11:16:23 +02:00
Andrea Bolognani
c7365dd157 qemu: Clean up qemuDomainDefaultUSBControllerModelAutoAdded()
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-06 11:16:20 +02:00
Andrea Bolognani
8bb0f4275a qemu: Clean up qemuDomainDefaultUSBControllerModel()
Switch from the current approach, in which an initial and
likely poor default is picked and then a better one later
overwrites it, to the more common and easy to reason about
pattern where the value is returned directly as soon as
possible.

To make things easier to understand and more maintainable,
the various architectures for which we have explicit
handling are each taken care of separately, with no falling
through to the default behavior.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-06 11:16:18 +02:00
Andrea Bolognani
44a63c2188 qemu: Add qemuDomainDefaultUSBControllerModelAutoAdded()
In addition to the code in qemuDomainControllerDefPostParse(),
which we have just factored into its own function, we also have
some code in qemuDomainDefAddDefaultDevices() that deals with
choosing the USB controller model for a couple of specific
machine types.

Once again, extract the logic to a dedicated helper. The
behavior is unchanged.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-06 11:16:16 +02:00
Andrea Bolognani
25be83dbfc qemu: Add qemuDomainDefaultUSBControllerModel()
Extract the logic from qemuDomainControllerDefPostParse() to
a dedicated helper. The behavior is unchanged.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-06 11:16:13 +02:00
Andrea Bolognani
45eab0181e qemu: Validate USB controllers earlier
Right now we call qemuValidateDomainDeviceDefControllerUSB()
quite late, just as we're generating the QEMU command line.

The original intention was likely to prevent configurations
from being rejected, even though a default USB controller
model could not be found, because using -usb could be used
as a last resort.

As it turns out, this premise was always flawed: in order
for -usb to work, the underlying device still needs to be
compiled into QEMU, and if that was the case then the
earlier code would have detected its presence and set the
model name accordingly.

More recently, we have dropped the use of -usb altogether
so there's simply no longer anything to fall back to.

With all this in mind, we can move the validation step much
earlier, making for a better user experience as any issues
will be reported when the domain is defined rather than when
an attempt is made to start it.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-06 11:16:10 +02:00
Andrea Bolognani
5050039e30 qemu: Skip USB controller validation when model=none
This is not useful right now, because the function is simply
not called at all for model=none USB controllers, but that's
going to change in a moment, when we start calling the
function during validation instead of command line generation.
Making this change ahead of time means that we can simply
move the code verbatim later.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-06 11:16:08 +02:00
Andrea Bolognani
dc6e5b676d qemu: Validate PCI support for USB controllers
Attempting to use a USB controller that's a PCI device with
a machine type that doesn't support PCI should result in an
error.

Note that, while all USB controllers supported by the libvirt
QEMU driver today are PCI devices, QEMU itself implements
machine types that come with non-PCI USB controllers. Having
a separate helper with a switch/case statement ensures that
things will need to be updated accordingly if libvirt will
ever grow support for those USB controllers.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-06 11:16:06 +02:00
Andrea Bolognani
2bbfcd2042 qemu: Rename function argument
This makes the signature consistent with that of other
qemuValidateDomainDeviceDefController*() functions, which
are passed a virDomainDef along with the existing
virDomainControllerDef. Later changes to this function
will require access to the additional data structure.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-06 11:16:03 +02:00
Andrea Bolognani
d069531a57 qemu: Fold check into qemuBuildSkipController()
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-06 11:16:01 +02:00
Andrea Bolognani
de797a86e1 qemu: Drop skip for USB controllers on s390x
We have just changed PostParse so that MODEL_USB_NONE will be
used instead of MODEL_USB_DEFAULT, so this code is no longer
doing anything.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-06 11:15:57 +02:00
Andrea Bolognani
bed1112bbb qemu: Don't generate alias for model=none USB controllers
That obviously doesn't make sense, since the value is used
to indicate the absence of a USB controller.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-06 11:15:54 +02:00
Andrea Bolognani
ec1848975c qemu: Always default to no USB controller on s390x
When support for s390x was introduced in libvirt, it naturally
followed the conventions established at the time for x86, which
were to have a USB controller added by default.

Later, in 2013, commit 3a82f628a9 made the default USB
controller model for s390x VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE,
effectively overriding the architecture-independent default.

However, an exception was carved out at the time: if the USB
controller had an address assigned to it, then it would be left
alone.

A couple of years later, commit 09ab9dcc85 changed things
again in two ways: for starters, libvirt would no longer
automatically attempt to add a USB controller to newly-defined
s390x guests; moreover, the command line generator was changed
so that the legacy USB controller (-usb) would never be used
on s390x.

In other words, unless a model name is explicitly provided for
the USB controller, which is something that only actually works
when using a recent QEMU version (see commit f9ed4d385a),
s390x guests will never have USB controllers attached to them.

Remove the exception carved out a decade ago and always
reflect this fact accurately in the guest XML.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-06 11:15:51 +02:00
Andrea Bolognani
519cc637e8 qemu: Add sanity checks for auto-added PCI controllers
These checks enforce some expectations that were, until now,
documented solely through comments or not spelled out at all.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-06 11:15:49 +02:00
Andrea Bolognani
956253d1cd qemu: Update qemuDomainSupportsPCI()
The sparc architecture doesn't support PCI, and neither do the
isapc and microvm machine types on x86 architectures.

One of the isapc/microvm tests starts failing as a consequence
of this change, which is expected; somewhat surprisingly,
another test for the same machine types goes from an early/hard
failure (PARSE_ERROR) to a late/soft one (FAILURE) instead.
This will be rectified by a later commit.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-06 11:15:47 +02:00
Andrea Bolognani
2ad21cd97f qemu: Validate presence of PCI support
The qemuValidateDomainDeviceDefControllerPCI() function is
called if PCI controllers are present in the domain
configuration, which shouldn't happen if the machine type
doesn't support PCI. If we somehow find ourselves in that
scenario, reporting an error would be the right thing to do.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-06 11:15:44 +02:00
Andrea Bolognani
fa46554957 qemu: Prevent use of PCI devices when PCI is not supported
At the moment, we check whether the machine type supports PCI
before attempting to allocate PCI addresses, and if it does
not, we simply skip the step entirely.

This means that an attempt to use a PCI device with a machine
type that has no PCI support won't be rejected by libvirt, and
only once the QEMU process is started the problem will be made
apparent.

Validate things ahead of time instead, rejecting any such
configurations.

Note that we only do this for new domains, because otherwise
existing domains that are configured incorrectly would disappear
and we generally try really hard to avoid that.

A few tests start failing after this change, demonstrating that
things are now working as desired.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-06 11:15:41 +02:00
Andrea Bolognani
a66db76447 qemu: Introduce qemuDomainNetIsPCI()
This centralizes the knowledge about which network interface
models are PCI devices and thus need to have a PCI address
allocated by libvirt, and expands said knowledge to include
the fact that models such as spapr-vlan and smc91c111 are
not PCI devices.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-06 11:15:39 +02:00
Andrea Bolognani
c60d168605 qemu: Don't add PCI, USB or memballoon to microvm
The microvm machine type doesn't support PCI, so adding PCI
controllers to it doesn't make sense, nor does adding a
USB controller or a memballon since both are PCI devices.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-06 11:15:38 +02:00
Andrea Bolognani
80eb60354e qemu: Don't add memballoon to isapc
The isapc machine type doesn't support PCI, so adding a
memballoon (which is a PCI device) to it doesn't make sense.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-06 11:15:35 +02:00
Andrea Bolognani
205e131f97 tests: Add coverage for PCI use with isapc and microvm
Neither machine type supports PCI, so attempting to add a
PCI controller should fail. It currently doesn't, and we're
going to address that in an upcoming commit.

Note that the domain gets a PCI memballoon device added
automatically. That also shouldn't happen, and will similarly
be fixed.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-06 11:15:33 +02:00
Andrea Bolognani
b38fb62e2e qemu: Fix PCI/USB handling for Arm realview boards
Only the -eb variants of the realview board support PCI
devices, so those are the only ones that should automatically
get a USB controller (addDefaultUSB). libvirt will currently
add one for the other realview variants too, but that will
result in QEMU reporting an error due to lack of PCI support
as soon as the domain is started.

Additionally, they should get a PCI controller added
automatically (addPCIRoot) too, same as versatilepb.

Finally, qemuDomainSupportsPCI() should correctly report the
fact that these machine types support PCI.

As a consequence of these fixes, the USB controllers now
correctly get assigned PCI addresses across the board.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-06 11:15:31 +02:00
Andrea Bolognani
30e3efad52 tests: Use realview-eb instead of realview-pbx-a9
QEMU implements 4 different "realview" machine types:

  $ qemu-system-aarch64 -machine help 2>&1 | grep realview
  realview-eb          ARM RealView Emulation Baseboard (ARM926EJ-S)
  realview-eb-mpcore   ARM RealView Emulation Baseboard (ARM11MPCore)
  realview-pb-a8       ARM RealView Platform Baseboard for Cortex-A8
  realview-pbx-a9      ARM RealView Platform Baseboard Explore for Cortex-A9

Of these, only the -eb variants support PCI devices and are
thus relevant when it comes to USB controllers.

Our logic treats all these machine types the same, which is
incorrect. An upcoming commit will fix the issue; in
preparation for that, make some adjustments to the test suite.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-06 11:15:29 +02:00
Andrea Bolognani
a416ccfb98 qemu: Check for pci-ohci availability
We assign the USB controller model without first checking
whether the corresponding QEMU device is available, and that
results in a late error instead of an early one.

Be consistent with how we do things in all other cases and
check the presence of the capability before attempting to set
the model.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-06 11:15:26 +02:00
Andrea Bolognani
4005d83a9a tests: Fix some usb-controller-*-unavailable cases
These tests are intended to show what happens when the device
that libvirt would use by default is not available in QEMU by
dropping the corresponding capabilities, but we're not doing
that correctly at the moment and so we still get the default
USB controller instead of a failure.

Specifically, we should be dropping all capabilities related
to devices that might be used as default or automatic USB
controllers for the machine type so that libvirt will report
an error, but for these few tests we are currently only
listing a subset of the capabilities that we should be
dropping.

Note that the usb-controller-automatic-unavailable tests are
still behaving the same despite dropping all the expected
capabilities: the reason is that, for that scenario, we're
not currently checking whether the device is available before
using it. That's a separate issue that will be addressed in an
upcoming commit.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-06 11:15:23 +02:00
Andrea Bolognani
9a3ff406b7 tests: Expand coverage for automatic/default USB controllers
We're missing a significant number of scenarios, including
those involving fairly common machine types and architectures.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-06 11:15:21 +02:00
Andrea Bolognani
b5956b30aa tests: Rename usb-controller-implicit-*
To usb-controller-automatic-*.

This matches the existing q35 test, and in general makes more
sense as a name since these tests are providing coverage for
USB controllers getting automatically added by libvirt for new
domains, rather than implicit (i.e. built-in, non-removable)
devices.

Note that, in the case of physical i440fx machines, the USB
controller is actually part of the chipset and would thus
qualify as implicit; the corresponding QEMU machine type,
however, allows for it to be removed, so the new name is still
more appropriate when discussing virtual hardware.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-06 11:15:18 +02:00
Andrea Bolognani
2a9bdeb0d5 tests: Minimize usb-controller tests
These tests are all about USB controllers and anything else
is a distraction that we can happily live without.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-06 11:15:15 +02:00
Andrea Bolognani
b00c8f4b5f tests: Don't set PCI address in usb-controller-default tests
We want to ensure that libvirt will automatically allocate the
PCI address, and setting it ourselves ahead of time will
prevent that from happening.

In the case of q35, this change will cause additional PCI
controllers to show up. That's desirable, as it demonstrates
the behavior libvirt users will actually see.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-06 11:15:13 +02:00
Andrea Bolognani
6448293933 tests: Don't use memballoon=none for minimal tests
It's redundant (these machine types don't get a memballoon added
automatically anyway), plus the test is supposed to show what
happens when a minimal configuration is fed to libvirt and
including additional elements goes against that.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-06 11:15:12 +02:00
Andrea Bolognani
fab45749f8 tests: Drop coverage for versatilepb on aarch64
We already test the machine type on armv7l and realview on
aarch64, so these handful of test cases can be dropped without
negatively impacting our coverage.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-06 11:15:10 +02:00
Andrea Bolognani
58d555fae7 tests: Fix typo in usb-controller-nec-xhci-autoassign
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-10-06 11:15:06 +02:00
Daniel P. Berrangé
f61b083f3d tests: validate an XML config with USB vendor/product set
The USB vendor/product is usually translated into a device/bus at
startup using the hostdev logic. We don't run the latter in the
unit test suite, but we can fake it by hardcoding a translation.
This demonstrates that we format the command line with the normal
device/bus properties, even when vendor/product is set.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-10-03 12:33:48 +01:00
Daniel P. Berrangé
fefde61758 rpm: disable sanlock when QEMU is disabled
The meson.build rules skip sanlock when QEMU is disabled, so the RPM
must not try to create the -sanlock sub-RPM.

Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-10-03 12:19:02 +01:00
Daniel P. Berrangé
f101e3432d rpc: fix race against dtrace probe generator
The virt_socket_lib library has a dep on dtrace_gen_headers, but
the virprobe.h file (which includes the libvirt_probes.h) is also
used from virnetserverclient.c and virkeepalive.c files which do
not directly depend on virt_socket_lib. Thus it is possible for
the latter files to be built before the libvirt_probes.h file
has had its content written.

Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-10-03 12:10:02 +01:00
Jiri Denemark
eb99bbaf2e Post-release version bump to 11.9.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2025-10-01 12:50:43 +02:00
806 changed files with 100089 additions and 19524 deletions

175
NEWS.rst
View File

@@ -8,6 +8,181 @@ the changes introduced by each of them.
For a more fine-grained view, use the `git log`_.
v11.10.0 (2025-12-01)
=====================
* **Security**
* CVE-2025-12748: Denial of service by some ACL-limited accounts
Parsing of user provided XMLs in APIs which needed the identification
information from those XML definitions was done in full before ACL checks
were performed. Some valid, but useless, definitions could cause allocation
of too much memory, leading to denial of service. APIs which do equate to
full root access (such as ``domain:write``), and were parsing XML
definitions in full before performing ACL checks could, potentially, be
exploited in a way that would allow users (which were about to be denied the
API call) to cause aforementioned overallocation even before the ACL checks
were performed.
A change was made so that parsing before ACL checks are done only for the
identification parts of the XML definition (which is needed to perform the
checks) and full parsing is done only after checking all ACLs.
* CVE-2025-13193: Incorrect permissions on images after external snapshot of an inactive VM
The overlay ``qcow2`` images which are created as part of creation of an
external snapshot of an inactive VM had world-readable (644) permissions
which would allow unauthorized users to see contents of blocks written by
the VM after snapshot was taken. Libvirt now sets proper umask so that
the images are created with 600 mode.
* **New features**
* Hyper-V virttype support for Qemu domains
Libvirt now supports Hyper-V virttype while lauching QEMU domains. This
feature requires Qemu version 10.2.0 or later and is available on Linux
hosts where the /dev/mshv is present.
* Add more statistics for block devices on QEMU domains
The block devices now report optimal access request sizes as well as
statistics such as the queue depth.
* **Improvements**
* bhyve: VNC ``wait`` attribute support
Bhyve guests can now be configured to wait for a VNC connection before
booting.
* remote: multiple certificate support
The remote daemon and client can be configured to load multiple x509
certificate identities. This facilitates a transition to certificates
supporting Post-Quantum Crytographic algorithms.
* tools: improved virt-host-validate output
The virt-host-validate tool will now report extra details when certain
checks pass.
* qemu: Allow backup jobs to continue if guest OS shuts down
When starting a backup job users can now use a flag which prevents the VM
to be completely cleaned up if the guest OS shuts down while the backup is
running so that the backup can be finalized.
* **Bug fixes**
* ch: Use correct domain definition in chDomainGetXMLDesc()
Cloud-Hypervisor driver claims to support ``VIR_DOMAIN_XML_INACTIVE`` but
in fact it never formatted the inactive XML. This is now fixed.
* esx: Allow disk images in subdirectories
If a domain has a disk image that's not in a datastore path but in a
subdirectory, the ESX driver would have failed to parse that and an error
was reported when obtaining domain XML. This is now fixed.
* qemu: Fix incoming migration to QEMU 10.0.0 and newer
Due to a change in the way QEMU 10.0.0 reports the state of "ht" CPU
feature, incoming migration of a domain with multiple CPU threads would
fail with "guest CPU doesn't match specification: extra features: ht"
error.
* qemu: fix incorrect reporting of the TDX launch security type
The TDX launch security type was incorrectly reported on all platforms
if the QEMU binary had it built-in. It is now limited to only platforms
with the TDX kernel feature available for use.
* qemu: set ``detect_zeroes`` for all backing chain layers
Some block jobs (snapshots, block commit) could modify the backing chain in
a way where ``detect_zeroes`` would no longer be honoured. We now set
it for all images in the backing chain, so that it will behave correctly
even after those operations.
v11.9.0 (2025-11-03)
====================
* **New features**
* Introduce Hyper-V ``host-model`` mode
Similarly to CPUs, ``host-model`` mode expands available Hyper-V
enlightenments at domain startup into the live XML so that's obvious which
enlightenments are enabled.
* Add support for Hyper-V ``spinlocks`` "never notify" mechanism
The ``retries`` attribute - which defines after how many failed
acquisition attempts to notify the hypervisor - can now hold the
special value of 4294967295 which means to never notify the
hypervisor.
If the ``retries`` attribute is omitted this value is used.
* ch: Network hotplug Support
Users can now attach and detach network interfaces of Cloud Hypervisor
domains at runtime.
* bhyve: NVMe device support
Domain XMLs now can use NVMe devices::
<disk type='file'>
<driver name='file' type='raw'/>
<source file='/path/to/disk.img'/>
<target dev='nvme0n1' bus='nvme'/>
</disk>
* **Improvements**
* qemu: Improvements to USB controller model selection
Virtualization-friendly USB3 controllers are now used in more situations,
Intel-specific USB controllers are relegated to x86 guests, and model
selection overall behaves more consistently across architectures.
* qemu: Validate Hyper-V enlightenment dependencies
Some Hyper-V enlightenments may require some other enlightenments to be
turned on. Libvirt now validates these for new domains.
* qemu: Introduce virtio options for virtio memory models
Both virtio-mem and virtio-pmem memory models are virtio devices and as
such now support setting various virtio knobs (iommu, ats, packed,
page_per_vq) common to other virtio devices.
* wireshark: Adapt to wireshark-4.6.0
Libvirt's wireshark dissector plugin adapted to changes made to wireshark
dissector API in its 4.6.0 release.
* qemu: 'manual' disk snapshot mode improvements
The 'manual' snapshot mode now ensures that also metadata of the images is
written out to disk so that user can take snapshots of e.g. qcow2 image
safely.
* **Bug fixes**
* ch: Load ``ch.conf`` from ``SYSCONFDIR``
Previously, the ``ch.conf`` file for ``ch:///system`` URI was mistakenly
loaded from a path under ``LOCALSTATEDIR`` (``/var/...``). This is now
fixed and the configuration file is loaded from the ``SYSCONFDIR``
(``/etc/...``) location where it's also installed.
v11.8.0 (2025-10-01)
====================

View File

@@ -92,7 +92,7 @@ sc_prohibit_raw_virclassnew:
# Avoid raw malloc and free, except in documentation comments.
sc_prohibit_raw_allocation:
@prohibit='^.[^*].*\<((m|c|re)alloc|free|g_malloc) *\([^)]' \
@prohibit='^.[^*].*\<((m|c|re)alloc|free|g_malloc|g_new) *\([^)]' \
halt='use g_new0/g_malloc0/g_free instead of malloc/free/g_malloc' \
$(_sc_search_regexp)

View File

@@ -0,0 +1,93 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
function install_buildenv() {
dnf update -y
dnf install 'dnf-command(config-manager)' -y
dnf config-manager --set-enabled -y crb
dnf install -y epel-release
dnf install -y \
audit-libs-devel \
augeas \
bash-completion \
ca-certificates \
ccache \
clang \
compiler-rt \
cpp \
cyrus-sasl-devel \
device-mapper-devel \
diffutils \
dwarves \
ebtables \
firewalld-filesystem \
fuse3-devel \
gcc \
gettext \
git \
glib2-devel \
glibc-devel \
glibc-langpack-en \
gnutls-devel \
grep \
json-c-devel \
libacl-devel \
libattr-devel \
libblkid-devel \
libcap-ng-devel \
libcurl-devel \
libnbd-devel \
libnl3-devel \
libpcap-devel \
libpciaccess-devel \
librbd-devel \
libselinux-devel \
libssh-devel \
libssh2-devel \
libtirpc-devel \
libwsman-devel \
libxml2 \
libxml2-devel \
libxslt \
make \
meson \
ninja-build \
numactl-devel \
parted-devel \
perl-base \
pkgconfig \
python3 \
python3-docutils \
python3-pip \
python3-pytest \
python3-setuptools \
python3-wheel \
qemu-img \
readline-devel \
rpm-build \
sanlock-devel \
sed \
systemd-devel \
systemd-rpm-macros \
systemtap-sdt-devel \
systemtap-sdt-dtrace \
wireshark-devel
rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED
rpm -qa | sort > /packages.txt
mkdir -p /usr/libexec/ccache-wrappers
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/clang
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
/usr/bin/pip3 install \
black \
flake8
}
export CCACHE_WRAPPERSDIR="/usr/libexec/ccache-wrappers"
export LANG="en_US.UTF-8"
export MAKE="/usr/bin/make"
export NINJA="/usr/bin/ninja"
export PYTHON="/usr/bin/python3"

View File

@@ -24,7 +24,7 @@ function install_buildenv() {
dwarves \
ebtables \
firewalld-filesystem \
fuse-devel \
fuse3-devel \
gcc \
gettext \
git \

View File

@@ -22,7 +22,7 @@ function install_buildenv() {
cyrus-sasl-dev \
diffutils \
eudev-dev \
fuse-dev \
fuse3-dev \
gcc \
gettext \
git \

View File

@@ -22,7 +22,7 @@ function install_buildenv() {
cyrus-sasl-dev \
diffutils \
eudev-dev \
fuse-dev \
fuse3-dev \
gcc \
gettext \
git \

View File

@@ -0,0 +1,92 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
function install_buildenv() {
dnf distro-sync -y
dnf install 'dnf-command(config-manager)' -y
dnf config-manager --set-enabled -y crb
dnf install -y epel-release
dnf install -y \
audit-libs-devel \
augeas \
bash-completion \
ca-certificates \
ccache \
clang \
compiler-rt \
cpp \
cyrus-sasl-devel \
device-mapper-devel \
diffutils \
dwarves \
ebtables \
firewalld-filesystem \
fuse3-devel \
gcc \
gettext \
git \
glib2-devel \
glibc-devel \
glibc-langpack-en \
gnutls-devel \
grep \
json-c-devel \
libacl-devel \
libattr-devel \
libblkid-devel \
libcap-ng-devel \
libcurl-devel \
libnbd-devel \
libnl3-devel \
libpcap-devel \
libpciaccess-devel \
librbd-devel \
libselinux-devel \
libssh-devel \
libssh2-devel \
libtirpc-devel \
libwsman-devel \
libxml2 \
libxml2-devel \
libxslt \
make \
meson \
ninja-build \
numactl-devel \
parted-devel \
perl-base \
pkgconfig \
python3 \
python3-docutils \
python3-pip \
python3-pytest \
python3-setuptools \
python3-wheel \
qemu-img \
readline-devel \
rpm-build \
sanlock-devel \
sed \
systemd-devel \
systemd-rpm-macros \
systemtap-sdt-devel \
wireshark-devel
rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED
rpm -qa | sort > /packages.txt
mkdir -p /usr/libexec/ccache-wrappers
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/clang
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
/usr/bin/pip3 install \
black \
flake8
}
export CCACHE_WRAPPERSDIR="/usr/libexec/ccache-wrappers"
export LANG="en_US.UTF-8"
export MAKE="/usr/bin/make"
export NINJA="/usr/bin/ninja"
export PYTHON="/usr/bin/python3"

View File

@@ -25,7 +25,7 @@ function install_buildenv() {
dwarves \
ebtables \
firewalld-filesystem \
fuse-devel \
fuse3-devel \
gcc \
gettext \
git \

View File

@@ -58,7 +58,7 @@ function install_buildenv() {
libcap-ng-dev:arm64 \
libcurl4-gnutls-dev:arm64 \
libdevmapper-dev:arm64 \
libfuse-dev:arm64 \
libfuse3-dev:arm64 \
libglib2.0-dev:arm64 \
libglusterfs-dev:arm64 \
libgnutls28-dev:arm64 \

View File

@@ -58,7 +58,7 @@ function install_buildenv() {
libcap-ng-dev:armel \
libcurl4-gnutls-dev:armel \
libdevmapper-dev:armel \
libfuse-dev:armel \
libfuse3-dev:armel \
libglib2.0-dev:armel \
libglusterfs-dev:armel \
libgnutls28-dev:armel \

View File

@@ -58,7 +58,7 @@ function install_buildenv() {
libcap-ng-dev:armhf \
libcurl4-gnutls-dev:armhf \
libdevmapper-dev:armhf \
libfuse-dev:armhf \
libfuse3-dev:armhf \
libglib2.0-dev:armhf \
libglusterfs-dev:armhf \
libgnutls28-dev:armhf \

View File

@@ -58,7 +58,7 @@ function install_buildenv() {
libcap-ng-dev:i386 \
libcurl4-gnutls-dev:i386 \
libdevmapper-dev:i386 \
libfuse-dev:i386 \
libfuse3-dev:i386 \
libglib2.0-dev:i386 \
libglusterfs-dev:i386 \
libgnutls28-dev:i386 \

View File

@@ -58,7 +58,7 @@ function install_buildenv() {
libcap-ng-dev:mips64el \
libcurl4-gnutls-dev:mips64el \
libdevmapper-dev:mips64el \
libfuse-dev:mips64el \
libfuse3-dev:mips64el \
libglib2.0-dev:mips64el \
libglusterfs-dev:mips64el \
libgnutls28-dev:mips64el \

View File

@@ -58,7 +58,7 @@ function install_buildenv() {
libcap-ng-dev:mipsel \
libcurl4-gnutls-dev:mipsel \
libdevmapper-dev:mipsel \
libfuse-dev:mipsel \
libfuse3-dev:mipsel \
libglib2.0-dev:mipsel \
libglusterfs-dev:mipsel \
libgnutls28-dev:mipsel \

View File

@@ -58,7 +58,7 @@ function install_buildenv() {
libcap-ng-dev:ppc64el \
libcurl4-gnutls-dev:ppc64el \
libdevmapper-dev:ppc64el \
libfuse-dev:ppc64el \
libfuse3-dev:ppc64el \
libglib2.0-dev:ppc64el \
libglusterfs-dev:ppc64el \
libgnutls28-dev:ppc64el \

View File

@@ -58,7 +58,7 @@ function install_buildenv() {
libcap-ng-dev:s390x \
libcurl4-gnutls-dev:s390x \
libdevmapper-dev:s390x \
libfuse-dev:s390x \
libfuse3-dev:s390x \
libglib2.0-dev:s390x \
libglusterfs-dev:s390x \
libgnutls28-dev:s390x \

View File

@@ -36,7 +36,7 @@ function install_buildenv() {
libclang-rt-dev \
libcurl4-gnutls-dev \
libdevmapper-dev \
libfuse-dev \
libfuse3-dev \
libglib2.0-dev \
libglusterfs-dev \
libgnutls28-dev \

View File

@@ -58,7 +58,7 @@ function install_buildenv() {
libcap-ng-dev:arm64 \
libcurl4-gnutls-dev:arm64 \
libdevmapper-dev:arm64 \
libfuse-dev:arm64 \
libfuse3-dev:arm64 \
libglib2.0-dev:arm64 \
libglusterfs-dev:arm64 \
libgnutls28-dev:arm64 \

View File

@@ -58,7 +58,7 @@ function install_buildenv() {
libcap-ng-dev:armel \
libcurl4-gnutls-dev:armel \
libdevmapper-dev:armel \
libfuse-dev:armel \
libfuse3-dev:armel \
libglib2.0-dev:armel \
libgnutls28-dev:armel \
libiscsi-dev:armel \

View File

@@ -58,7 +58,7 @@ function install_buildenv() {
libcap-ng-dev:armhf \
libcurl4-gnutls-dev:armhf \
libdevmapper-dev:armhf \
libfuse-dev:armhf \
libfuse3-dev:armhf \
libglib2.0-dev:armhf \
libgnutls28-dev:armhf \
libiscsi-dev:armhf \

View File

@@ -58,7 +58,7 @@ function install_buildenv() {
libcap-ng-dev:i386 \
libcurl4-gnutls-dev:i386 \
libdevmapper-dev:i386 \
libfuse-dev:i386 \
libfuse3-dev:i386 \
libglib2.0-dev:i386 \
libgnutls28-dev:i386 \
libiscsi-dev:i386 \

View File

@@ -58,7 +58,7 @@ function install_buildenv() {
libcap-ng-dev:mips64el \
libcurl4-gnutls-dev:mips64el \
libdevmapper-dev:mips64el \
libfuse-dev:mips64el \
libfuse3-dev:mips64el \
libglib2.0-dev:mips64el \
libglusterfs-dev:mips64el \
libgnutls28-dev:mips64el \

View File

@@ -58,7 +58,7 @@ function install_buildenv() {
libcap-ng-dev:ppc64el \
libcurl4-gnutls-dev:ppc64el \
libdevmapper-dev:ppc64el \
libfuse-dev:ppc64el \
libfuse3-dev:ppc64el \
libglib2.0-dev:ppc64el \
libglusterfs-dev:ppc64el \
libgnutls28-dev:ppc64el \

View File

@@ -58,7 +58,7 @@ function install_buildenv() {
libcap-ng-dev:s390x \
libcurl4-gnutls-dev:s390x \
libdevmapper-dev:s390x \
libfuse-dev:s390x \
libfuse3-dev:s390x \
libglib2.0-dev:s390x \
libglusterfs-dev:s390x \
libgnutls28-dev:s390x \

View File

@@ -36,7 +36,7 @@ function install_buildenv() {
libclang-rt-dev \
libcurl4-gnutls-dev \
libdevmapper-dev \
libfuse-dev \
libfuse3-dev \
libglib2.0-dev \
libglusterfs-dev \
libgnutls28-dev \

View File

@@ -23,7 +23,7 @@ function install_buildenv() {
dwarves \
ebtables \
firewalld-filesystem \
fuse-devel \
fuse3-devel \
gcc \
gettext \
git \

View File

@@ -23,7 +23,7 @@ function install_buildenv() {
dwarves \
ebtables \
firewalld-filesystem \
fuse-devel \
fuse3-devel \
gcc \
gettext \
git \

View File

@@ -24,7 +24,7 @@ function install_buildenv() {
dwarves \
ebtables \
firewalld-filesystem \
fuse-devel \
fuse3-devel \
gcc \
gettext \
git \

View File

@@ -24,7 +24,7 @@ function install_buildenv() {
diffutils \
dwarves \
ebtables \
fuse-devel \
fuse3-devel \
gcc \
gettext-runtime \
git \

View File

@@ -23,7 +23,7 @@ function install_buildenv() {
diffutils \
dwarves \
ebtables \
fuse-devel \
fuse3-devel \
gcc \
gettext-runtime \
git \

View File

@@ -36,7 +36,7 @@ function install_buildenv() {
libclang-dev \
libcurl4-gnutls-dev \
libdevmapper-dev \
libfuse-dev \
libfuse3-dev \
libglib2.0-dev \
libglusterfs-dev \
libgnutls28-dev \

View File

@@ -36,7 +36,7 @@ function install_buildenv() {
libclang-rt-dev \
libcurl4-gnutls-dev \
libdevmapper-dev \
libfuse-dev \
libfuse3-dev \
libglib2.0-dev \
libglusterfs-dev \
libgnutls28-dev \

View File

@@ -11,6 +11,6 @@ MAKE='/usr/local/bin/gmake'
NINJA='/usr/local/bin/ninja'
PACKAGING_COMMAND='pkg'
PIP3='/usr/local/bin/pip-3.8'
PKGS='augeas bash-completion ca_root_nss ccache4 codespell cppi curl cyrus-sasl diffutils fusefs-libs gettext git glib gmake gnugrep gnutls gsed json-c libpcap libpciaccess libssh libssh2 libxml2 libxslt meson ninja perl5 pkgconf py311-black py311-docutils py311-flake8 py311-pytest python3 qemu readline'
PKGS='augeas bash-completion ca_root_nss ccache4 codespell cppi curl cyrus-sasl diffutils fusefs-libs3 gettext git glib gmake gnugrep gnutls gsed json-c libpcap libpciaccess libssh libssh2 libxml2 libxslt meson ninja perl5 pkgconf py311-black py311-docutils py311-flake8 py311-pytest python3 qemu readline'
PYPI_PKGS=''
PYTHON='/usr/local/bin/python3'

View File

@@ -11,6 +11,6 @@ MAKE='/usr/local/bin/gmake'
NINJA='/usr/local/bin/ninja'
PACKAGING_COMMAND='pkg'
PIP3='/usr/local/bin/pip'
PKGS='augeas bash-completion ca_root_nss ccache4 codespell cppi curl cyrus-sasl diffutils fusefs-libs gettext git glib gmake gnugrep gnutls gsed json-c libpcap libpciaccess libssh libssh2 libxml2 libxslt meson ninja perl5 pkgconf py311-black py311-docutils py311-flake8 py311-pytest python3 qemu readline'
PKGS='augeas bash-completion ca_root_nss ccache4 codespell cppi curl cyrus-sasl diffutils fusefs-libs3 gettext git glib gmake gnugrep gnutls gsed json-c libpcap libpciaccess libssh libssh2 libxml2 libxslt meson ninja perl5 pkgconf py311-black py311-docutils py311-flake8 py311-pytest python3 qemu readline'
PYPI_PKGS=''
PYTHON='/usr/local/bin/python3'

View File

@@ -0,0 +1,96 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
FROM docker.io/library/almalinux:10
RUN dnf update -y && \
dnf install 'dnf-command(config-manager)' -y && \
dnf config-manager --set-enabled -y crb && \
dnf install -y epel-release && \
dnf install -y \
audit-libs-devel \
augeas \
bash-completion \
ca-certificates \
ccache \
clang \
compiler-rt \
cpp \
cyrus-sasl-devel \
device-mapper-devel \
diffutils \
dwarves \
ebtables \
firewalld-filesystem \
fuse3-devel \
gcc \
gettext \
git \
glib2-devel \
glibc-devel \
glibc-langpack-en \
gnutls-devel \
grep \
json-c-devel \
libacl-devel \
libattr-devel \
libblkid-devel \
libcap-ng-devel \
libcurl-devel \
libnbd-devel \
libnl3-devel \
libpcap-devel \
libpciaccess-devel \
librbd-devel \
libselinux-devel \
libssh-devel \
libssh2-devel \
libtirpc-devel \
libwsman-devel \
libxml2 \
libxml2-devel \
libxslt \
make \
meson \
ninja-build \
numactl-devel \
parted-devel \
perl-base \
pkgconfig \
python3 \
python3-docutils \
python3-pip \
python3-pytest \
python3-setuptools \
python3-wheel \
qemu-img \
readline-devel \
rpm-build \
sanlock-devel \
sed \
systemd-devel \
systemd-rpm-macros \
systemtap-sdt-devel \
systemtap-sdt-dtrace \
wireshark-devel && \
dnf autoremove -y && \
dnf clean all -y && \
rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED && \
rpm -qa | sort > /packages.txt && \
mkdir -p /usr/libexec/ccache-wrappers && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/clang && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
RUN /usr/bin/pip3 install \
black \
flake8
ENV CCACHE_WRAPPERSDIR="/usr/libexec/ccache-wrappers"
ENV LANG="en_US.UTF-8"
ENV MAKE="/usr/bin/make"
ENV NINJA="/usr/bin/ninja"
ENV PYTHON="/usr/bin/python3"

View File

@@ -25,7 +25,7 @@ RUN dnf update -y && \
dwarves \
ebtables \
firewalld-filesystem \
fuse-devel \
fuse3-devel \
gcc \
gettext \
git \

View File

@@ -23,7 +23,7 @@ RUN apk update && \
cyrus-sasl-dev \
diffutils \
eudev-dev \
fuse-dev \
fuse3-dev \
gcc \
gettext \
git \

View File

@@ -23,7 +23,7 @@ RUN apk update && \
cyrus-sasl-dev \
diffutils \
eudev-dev \
fuse-dev \
fuse3-dev \
gcc \
gettext \
git \

View File

@@ -0,0 +1,95 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
FROM quay.io/centos/centos:stream10
RUN dnf distro-sync -y && \
dnf install 'dnf-command(config-manager)' -y && \
dnf config-manager --set-enabled -y crb && \
dnf install -y epel-release && \
dnf install -y \
audit-libs-devel \
augeas \
bash-completion \
ca-certificates \
ccache \
clang \
compiler-rt \
cpp \
cyrus-sasl-devel \
device-mapper-devel \
diffutils \
dwarves \
ebtables \
firewalld-filesystem \
fuse3-devel \
gcc \
gettext \
git \
glib2-devel \
glibc-devel \
glibc-langpack-en \
gnutls-devel \
grep \
json-c-devel \
libacl-devel \
libattr-devel \
libblkid-devel \
libcap-ng-devel \
libcurl-devel \
libnbd-devel \
libnl3-devel \
libpcap-devel \
libpciaccess-devel \
librbd-devel \
libselinux-devel \
libssh-devel \
libssh2-devel \
libtirpc-devel \
libwsman-devel \
libxml2 \
libxml2-devel \
libxslt \
make \
meson \
ninja-build \
numactl-devel \
parted-devel \
perl-base \
pkgconfig \
python3 \
python3-docutils \
python3-pip \
python3-pytest \
python3-setuptools \
python3-wheel \
qemu-img \
readline-devel \
rpm-build \
sanlock-devel \
sed \
systemd-devel \
systemd-rpm-macros \
systemtap-sdt-devel \
wireshark-devel && \
dnf autoremove -y && \
dnf clean all -y && \
rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED && \
rpm -qa | sort > /packages.txt && \
mkdir -p /usr/libexec/ccache-wrappers && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/clang && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
RUN /usr/bin/pip3 install \
black \
flake8
ENV CCACHE_WRAPPERSDIR="/usr/libexec/ccache-wrappers"
ENV LANG="en_US.UTF-8"
ENV MAKE="/usr/bin/make"
ENV NINJA="/usr/bin/ninja"
ENV PYTHON="/usr/bin/python3"

View File

@@ -26,7 +26,7 @@ RUN dnf distro-sync -y && \
dwarves \
ebtables \
firewalld-filesystem \
fuse-devel \
fuse3-devel \
gcc \
gettext \
git \

View File

@@ -69,7 +69,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libcap-ng-dev:arm64 \
libcurl4-gnutls-dev:arm64 \
libdevmapper-dev:arm64 \
libfuse-dev:arm64 \
libfuse3-dev:arm64 \
libglib2.0-dev:arm64 \
libglusterfs-dev:arm64 \
libgnutls28-dev:arm64 \

View File

@@ -69,7 +69,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libcap-ng-dev:armel \
libcurl4-gnutls-dev:armel \
libdevmapper-dev:armel \
libfuse-dev:armel \
libfuse3-dev:armel \
libglib2.0-dev:armel \
libglusterfs-dev:armel \
libgnutls28-dev:armel \

View File

@@ -69,7 +69,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libcap-ng-dev:armhf \
libcurl4-gnutls-dev:armhf \
libdevmapper-dev:armhf \
libfuse-dev:armhf \
libfuse3-dev:armhf \
libglib2.0-dev:armhf \
libglusterfs-dev:armhf \
libgnutls28-dev:armhf \

View File

@@ -69,7 +69,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libcap-ng-dev:i386 \
libcurl4-gnutls-dev:i386 \
libdevmapper-dev:i386 \
libfuse-dev:i386 \
libfuse3-dev:i386 \
libglib2.0-dev:i386 \
libglusterfs-dev:i386 \
libgnutls28-dev:i386 \

View File

@@ -69,7 +69,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libcap-ng-dev:mips64el \
libcurl4-gnutls-dev:mips64el \
libdevmapper-dev:mips64el \
libfuse-dev:mips64el \
libfuse3-dev:mips64el \
libglib2.0-dev:mips64el \
libglusterfs-dev:mips64el \
libgnutls28-dev:mips64el \

View File

@@ -69,7 +69,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libcap-ng-dev:mipsel \
libcurl4-gnutls-dev:mipsel \
libdevmapper-dev:mipsel \
libfuse-dev:mipsel \
libfuse3-dev:mipsel \
libglib2.0-dev:mipsel \
libglusterfs-dev:mipsel \
libgnutls28-dev:mipsel \

View File

@@ -69,7 +69,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libcap-ng-dev:ppc64el \
libcurl4-gnutls-dev:ppc64el \
libdevmapper-dev:ppc64el \
libfuse-dev:ppc64el \
libfuse3-dev:ppc64el \
libglib2.0-dev:ppc64el \
libglusterfs-dev:ppc64el \
libgnutls28-dev:ppc64el \

View File

@@ -69,7 +69,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libcap-ng-dev:s390x \
libcurl4-gnutls-dev:s390x \
libdevmapper-dev:s390x \
libfuse-dev:s390x \
libfuse3-dev:s390x \
libglib2.0-dev:s390x \
libglusterfs-dev:s390x \
libgnutls28-dev:s390x \

View File

@@ -38,7 +38,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libclang-rt-dev \
libcurl4-gnutls-dev \
libdevmapper-dev \
libfuse-dev \
libfuse3-dev \
libglib2.0-dev \
libglusterfs-dev \
libgnutls28-dev \

View File

@@ -69,7 +69,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libcap-ng-dev:arm64 \
libcurl4-gnutls-dev:arm64 \
libdevmapper-dev:arm64 \
libfuse-dev:arm64 \
libfuse3-dev:arm64 \
libglib2.0-dev:arm64 \
libglusterfs-dev:arm64 \
libgnutls28-dev:arm64 \

View File

@@ -69,7 +69,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libcap-ng-dev:armel \
libcurl4-gnutls-dev:armel \
libdevmapper-dev:armel \
libfuse-dev:armel \
libfuse3-dev:armel \
libglib2.0-dev:armel \
libgnutls28-dev:armel \
libiscsi-dev:armel \

View File

@@ -69,7 +69,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libcap-ng-dev:armhf \
libcurl4-gnutls-dev:armhf \
libdevmapper-dev:armhf \
libfuse-dev:armhf \
libfuse3-dev:armhf \
libglib2.0-dev:armhf \
libgnutls28-dev:armhf \
libiscsi-dev:armhf \

View File

@@ -69,7 +69,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libcap-ng-dev:i386 \
libcurl4-gnutls-dev:i386 \
libdevmapper-dev:i386 \
libfuse-dev:i386 \
libfuse3-dev:i386 \
libglib2.0-dev:i386 \
libgnutls28-dev:i386 \
libiscsi-dev:i386 \

View File

@@ -69,7 +69,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libcap-ng-dev:mips64el \
libcurl4-gnutls-dev:mips64el \
libdevmapper-dev:mips64el \
libfuse-dev:mips64el \
libfuse3-dev:mips64el \
libglib2.0-dev:mips64el \
libglusterfs-dev:mips64el \
libgnutls28-dev:mips64el \

View File

@@ -69,7 +69,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libcap-ng-dev:ppc64el \
libcurl4-gnutls-dev:ppc64el \
libdevmapper-dev:ppc64el \
libfuse-dev:ppc64el \
libfuse3-dev:ppc64el \
libglib2.0-dev:ppc64el \
libglusterfs-dev:ppc64el \
libgnutls28-dev:ppc64el \

View File

@@ -69,7 +69,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libcap-ng-dev:s390x \
libcurl4-gnutls-dev:s390x \
libdevmapper-dev:s390x \
libfuse-dev:s390x \
libfuse3-dev:s390x \
libglib2.0-dev:s390x \
libglusterfs-dev:s390x \
libgnutls28-dev:s390x \

View File

@@ -38,7 +38,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libclang-rt-dev \
libcurl4-gnutls-dev \
libdevmapper-dev \
libfuse-dev \
libfuse3-dev \
libglib2.0-dev \
libglusterfs-dev \
libgnutls28-dev \

View File

@@ -34,7 +34,7 @@ exec "$@"\n' > /usr/bin/nosync && \
dwarves \
ebtables \
firewalld-filesystem \
fuse-devel \
fuse3-devel \
gcc \
gettext \
git \

View File

@@ -4,7 +4,7 @@
#
# https://gitlab.com/libvirt/libvirt-ci
FROM registry.fedoraproject.org/fedora:42
FROM registry.fedoraproject.org/fedora:43
RUN dnf install -y nosync && \
printf '#!/bin/sh\n\

View File

@@ -4,7 +4,7 @@
#
# https://gitlab.com/libvirt/libvirt-ci
FROM registry.fedoraproject.org/fedora:42
FROM registry.fedoraproject.org/fedora:43
RUN dnf install -y nosync && \
printf '#!/bin/sh\n\

View File

@@ -4,7 +4,7 @@
#
# https://gitlab.com/libvirt/libvirt-ci
FROM registry.fedoraproject.org/fedora:41
FROM registry.fedoraproject.org/fedora:43
RUN dnf install -y nosync && \
printf '#!/bin/sh\n\
@@ -34,7 +34,7 @@ exec "$@"\n' > /usr/bin/nosync && \
dwarves \
ebtables \
firewalld-filesystem \
fuse-devel \
fuse3-devel \
gcc \
gettext \
git \

View File

@@ -35,7 +35,7 @@ exec "$@"\n' > /usr/bin/nosync && \
dwarves \
ebtables \
firewalld-filesystem \
fuse-devel \
fuse3-devel \
gcc \
gettext \
git \

View File

@@ -25,7 +25,7 @@ RUN zypper update -y && \
diffutils \
dwarves \
ebtables \
fuse-devel \
fuse3-devel \
gcc \
gettext-runtime \
git \

View File

@@ -24,7 +24,7 @@ RUN zypper dist-upgrade -y && \
diffutils \
dwarves \
ebtables \
fuse-devel \
fuse3-devel \
gcc \
gettext-runtime \
git \

View File

@@ -38,7 +38,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libclang-dev \
libcurl4-gnutls-dev \
libdevmapper-dev \
libfuse-dev \
libfuse3-dev \
libglib2.0-dev \
libglusterfs-dev \
libgnutls28-dev \

View File

@@ -38,7 +38,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libclang-rt-dev \
libcurl4-gnutls-dev \
libdevmapper-dev \
libfuse-dev \
libfuse3-dev \
libglib2.0-dev \
libglusterfs-dev \
libgnutls28-dev \

View File

@@ -33,6 +33,32 @@ x86_64-almalinux-9-clang:
TARGET_BASE_IMAGE: docker.io/library/almalinux:9
x86_64-almalinux-10:
extends: .native_build_job
needs:
- job: x86_64-almalinux-10-container
optional: true
allow_failure: false
variables:
JOB_OPTIONAL: 1
NAME: almalinux-10
RPM: skip
TARGET_BASE_IMAGE: docker.io/library/almalinux:10
x86_64-almalinux-10-clang:
extends: .native_build_job
needs:
- job: x86_64-almalinux-10-container
optional: true
allow_failure: false
variables:
CC: clang
NAME: almalinux-10
RPM: skip
TARGET_BASE_IMAGE: docker.io/library/almalinux:10
x86_64-alpine-322:
extends: .native_build_job
needs:
@@ -70,6 +96,21 @@ x86_64-centos-stream-9:
- libvirt-rpms
x86_64-centos-stream-10:
extends: .native_build_job
needs:
- job: x86_64-centos-stream-10-container
optional: true
allow_failure: false
variables:
NAME: centos-stream-10
TARGET_BASE_IMAGE: quay.io/centos/centos:stream10
artifacts:
expire_in: 1 day
paths:
- libvirt-rpms
x86_64-debian-12:
extends: .native_build_job
needs:
@@ -103,21 +144,6 @@ x86_64-debian-sid:
TARGET_BASE_IMAGE: docker.io/library/debian:sid-slim
x86_64-fedora-41:
extends: .native_build_job
needs:
- job: x86_64-fedora-41-container
optional: true
allow_failure: false
variables:
NAME: fedora-41
TARGET_BASE_IMAGE: registry.fedoraproject.org/fedora:41
artifacts:
expire_in: 1 day
paths:
- libvirt-rpms
x86_64-fedora-42:
extends: .native_build_job
needs:
@@ -133,6 +159,21 @@ x86_64-fedora-42:
- libvirt-rpms
x86_64-fedora-43:
extends: .native_build_job
needs:
- job: x86_64-fedora-43-container
optional: true
allow_failure: false
variables:
NAME: fedora-43
TARGET_BASE_IMAGE: registry.fedoraproject.org/fedora:43
artifacts:
expire_in: 1 day
paths:
- libvirt-rpms
x86_64-fedora-rawhide:
extends: .native_build_job
needs:
@@ -416,29 +457,29 @@ s390x-debian-sid:
TARGET_BASE_IMAGE: docker.io/library/debian:sid-slim
mingw32-fedora-42:
mingw32-fedora-43:
extends: .cross_build_job
needs:
- job: mingw32-fedora-42-container
- job: mingw32-fedora-43-container
optional: true
allow_failure: false
variables:
CROSS: mingw32
JOB_OPTIONAL: 1
NAME: fedora-42
TARGET_BASE_IMAGE: registry.fedoraproject.org/fedora:42
NAME: fedora-43
TARGET_BASE_IMAGE: registry.fedoraproject.org/fedora:43
mingw64-fedora-42:
mingw64-fedora-43:
extends: .cross_build_job
needs:
- job: mingw64-fedora-42-container
- job: mingw64-fedora-43-container
optional: true
allow_failure: false
variables:
CROSS: mingw64
NAME: fedora-42
TARGET_BASE_IMAGE: registry.fedoraproject.org/fedora:42
NAME: fedora-43
TARGET_BASE_IMAGE: registry.fedoraproject.org/fedora:43
mingw32-fedora-rawhide:

View File

@@ -14,6 +14,13 @@ x86_64-almalinux-9-container:
NAME: almalinux-9
x86_64-almalinux-10-container:
extends: .container_job
allow_failure: false
variables:
NAME: almalinux-10
x86_64-alpine-322-container:
extends: .container_job
allow_failure: false
@@ -35,6 +42,13 @@ x86_64-centos-stream-9-container:
NAME: centos-stream-9
x86_64-centos-stream-10-container:
extends: .container_job
allow_failure: false
variables:
NAME: centos-stream-10
x86_64-debian-12-container:
extends: .container_job
allow_failure: false
@@ -49,13 +63,6 @@ x86_64-debian-sid-container:
NAME: debian-sid
x86_64-fedora-41-container:
extends: .container_job
allow_failure: false
variables:
NAME: fedora-41
x86_64-fedora-42-container:
extends: .container_job
allow_failure: false
@@ -63,6 +70,13 @@ x86_64-fedora-42-container:
NAME: fedora-42
x86_64-fedora-43-container:
extends: .container_job
allow_failure: false
variables:
NAME: fedora-43
x86_64-fedora-rawhide-container:
extends: .container_job
allow_failure: true
@@ -220,19 +234,19 @@ s390x-debian-sid-container:
NAME: debian-sid-cross-s390x
mingw32-fedora-42-container:
mingw32-fedora-43-container:
extends: .container_job
allow_failure: false
variables:
JOB_OPTIONAL: 1
NAME: fedora-42-cross-mingw32
NAME: fedora-43-cross-mingw32
mingw64-fedora-42-container:
mingw64-fedora-43-container:
extends: .container_job
allow_failure: false
variables:
NAME: fedora-42-cross-mingw64
NAME: fedora-43-cross-mingw64
mingw32-fedora-rawhide-container:

View File

@@ -29,23 +29,23 @@ centos-stream-9-tests:
# and libvirt-python CI jobs, so the new target needs to be introduced
# there before it can be used here. The VM template for the target
# also needs to be created on the runner host.
fedora-41-tests:
fedora-43-tests:
extends: .integration_tests
variables:
# needed by libvirt-gitlab-executor
DISTRO: fedora-41
DISTRO: fedora-43
# can be overridden in forks to set a different runner tag
LIBVIRT_CI_INTEGRATION_RUNNER_TAG: redhat-vm-host
tags:
- $LIBVIRT_CI_INTEGRATION_RUNNER_TAG
needs:
- x86_64-fedora-41
- x86_64-fedora-43
- project: libvirt/libvirt-perl
job: x86_64-fedora-41
job: x86_64-fedora-43
ref: master
artifacts: true
- project: libvirt/libvirt-python
job: x86_64-fedora-41
job: x86_64-fedora-43
ref: master
artifacts: true
@@ -53,22 +53,22 @@ fedora-41-tests:
# and libvirt-python CI jobs, so the new target needs to be introduced
# there before it can be used here. The VM template for the target
# also needs to be created on the runner host.
.fedora-41-upstream-qemu-tests:
.fedora-43-upstream-qemu-tests:
extends: .integration_tests
variables:
# needed by libvirt-gitlab-executor
DISTRO: fedora-41
DISTRO: fedora-43
# can be overridden in forks to set a different runner tag
LIBVIRT_CI_INTEGRATION_RUNNER_TAG: redhat-vm-host
tags:
- $LIBVIRT_CI_INTEGRATION_RUNNER_TAG
needs:
- x86_64-fedora-41
- x86_64-fedora-43
- project: libvirt/libvirt-perl
job: x86_64-fedora-41
job: x86_64-fedora-43
ref: master
artifacts: true
- project: libvirt/libvirt-python
job: x86_64-fedora-41
job: x86_64-fedora-43
ref: master
artifacts: true

View File

@@ -19,7 +19,7 @@ packages:
- ebtables
- firewalld-filesystem
- flake8
- fuse
- fuse3
- gcc
- gettext
- gettext-native

View File

@@ -19,6 +19,19 @@ targets:
RPM: skip
CC: clang
almalinux-10:
jobs:
- arch: x86_64
builds: false
variables:
RPM: skip
- arch: x86_64
suffix: -clang
variables:
RPM: skip
CC: clang
alpine-322: x86_64
alpine-edge:
@@ -34,6 +47,14 @@ targets:
paths:
- libvirt-rpms
centos-stream-10:
jobs:
- arch: x86_64
artifacts:
expire_in: 1 day
paths:
- libvirt-rpms
debian-12:
jobs:
- arch: x86_64
@@ -104,7 +125,7 @@ targets:
containers: false
builds: false
fedora-41:
fedora-42:
jobs:
- arch: x86_64
artifacts:
@@ -112,7 +133,7 @@ targets:
paths:
- libvirt-rpms
fedora-42:
fedora-43:
jobs:
- arch: x86_64
artifacts:

View File

@@ -185,6 +185,10 @@ Infrastructure as a Service (IaaS)
software-defined datacenter. The key strengths of ZStack in terms of
management are scalability, performance, and a fast, user-friendly
deployment.
`Apache CloudStack <https://cloudstack.apache.org/>`__
Apache CloudStack™ is an open-source software system designed to
deploy and manage large networks of virtual machines, as a highly available,
highly scalable Infrastructure as a Service (IaaS) cloud computing platform.
Libraries
---------

3
docs/css/local.css Normal file
View File

@@ -0,0 +1,3 @@
@import url(libvirt.css);
@import url(libvirt-api.css);
@import url(mobile-libvirt.css);

View File

@@ -1,7 +1,5 @@
@import url(fonts.css);
@import url(generic.css);
@import url(libvirt.css);
@import url(libvirt-api.css);
@import url(libvirt-template.css);
@import url(mobile-template.css);
@import url(mobile-libvirt.css);
@import url(local.css);

View File

@@ -4,6 +4,7 @@ docs_css_files = [
'libvirt.css',
'libvirt-api.css',
'libvirt-template.css',
'local.css',
'main.css',
'mobile-template.css',
'mobile-libvirt.css',

View File

@@ -393,7 +393,7 @@ exposed to the guest using the ``vgaconf`` attribute:
If not specified, bhyve's default mode for ``vgaconf`` will be used. Please
refer to the
`bhyve(8) <https://www.freebsd.org/cgi/man.cgi?query=bhyve&sektion=8&manpath=FreeBSD+12-current>`__
`bhyve(8) <https://www.freebsd.org/cgi/man.cgi?query=bhyve&sektion=8>`__
manual page and the `bhyve wiki <https://wiki.freebsd.org/bhyve>`__ for more
details on using the ``vgaconf`` option.
@@ -429,6 +429,16 @@ Note: VNC password authentication is known to be cryptographically weak.
Additionally, the password is passed as a command line argument in clear text.
Make sure you understand the risks associated with this feature before using it.
:since:`Since 11.10.0`, the guest can be configured to wait for an incoming
VNC connection before booting:
::
<graphics type='vnc' port='5904' wait='yes'>
<listen type='address' address='127.0.0.1'/>
</graphics>
Clock configuration
~~~~~~~~~~~~~~~~~~~
@@ -638,3 +648,64 @@ Example:
Note: there's no direct way to check if the actual ``bhyve`` binary supports
the TCP console. Thus, libvirt always assumes it's supported. Please
refer to the ``bhyve(1)`` manual page to make sure.
NVMe device
~~~~~~~~~~~
:since:`Since 11.9.0`, it's possible to use NVMe device.
Example:
::
...
<disk type='file'>
<driver name='file' type='raw'/>
<source file='/tmp/freebsd.img'/>
<target dev='nvme0n1' bus='nvme'/>
</disk>
...
As ``bhyve(1)`` uses one NVMe device per PCI address, it's modeled in a way
that there is one device per controller. That is, if using more than one
NVMe device, for device name users should increment controller number rather
than namespace number, i.e.: ``nvme0n1``, ``nvme1n1``, etc.
Device passthrough
~~~~~~~~~~~~~~~~~~
:since:`Since 11.10.0`, it is possible to passthrough PCI devices.
Example:
::
...
<hostdev mode='subsystem' type='pci' managed='no'>
<source>
<address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
</source>
</hostdev>
...
Using passthrough devices requires wiring guest memory, see `Wiring guest memory`_.
Note: currently, the `nodedev <drvnodedev.html>`_ driver is not supported
on FreeBSD.
Users must configure the device for passthrough manually either by
using ``devctl(8)`` or by setting ``pptdevs`` in ``loader.conf(5)``.
Please refer to the ``vmm(4)`` manual page for more details.
Guest-specific considerations
-----------------------------
Windows
~~~~~~~
For Windows guests, it is recommended to have the LPC controller on slot 31.
As the libvirt driver allocates slot 1 for the LPC controller by default,
the address must be specified explicitly:
::
<controller type='isa' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x0'/>
</controller>

View File

@@ -12,17 +12,40 @@ customers inside a cloud provider. For our purposes this means modern
operating systems with most I/O handled by paravirtualised devices
(i.e. virtio), no requirement for legacy devices, and 64-bit CPUs.
The libvirt Cloud Hypervisor driver is intended to be run as a session
driver without privileges. The cloud-hypervisor binary itself should be
``setcap cap_net_admin+ep`` (in order to create tap interfaces).
The libvirt Cloud Hypervisor (CH) driver is intended to be run as a
session driver without privileges. The cloud-hypervisor binary itself
should be ``setcap cap_net_admin+ep`` (in order to create tap
interfaces). Though, system-wide connection URI is also supported.
Expected connection URI would be
``ch:///session``
::
ch:///session (local access to per-user instance)
ch:///system (local access to system instance)
But all other transport modes are supported too
(see `documentation <uri.html#remote-uris>`__).
Location of configuration files
-------------------------------
The CH driver comes with sane default values. However, during its
initialization it reads a configuration file which offers system
administrator or an user to override some of that default. The location
of the file depends on the connection URI, as follows:
=================== ======================================
``ch:///system`` ``/etc/libvirt/ch.conf``
``ch:///session`` ``$XDG_CONFIG_HOME/libvirt/ch/ch.conf``
=================== ======================================
If ``$XDG_CONFIG_HOME`` is not set in the environment, it defaults to
``$HOME/.config``.
Example guest domain XML configurations
=======================================
---------------------------------------
The Cloud Hypervisor driver in libvirt is in its early stage under active
development only supporting a limited number of Cloud Hypervisor features.

View File

@@ -2155,7 +2155,10 @@ are:
=============== ====================================================================== ============================================ ========================================================================
relaxed Relax constraints on timers on, off :since:`1.0.0 (QEMU 2.0), 11.3.0 (Xen, always on)`
vapic Enable virtual APIC on, off :since:`1.1.0 (QEMU 2.0), 11.3.0 (Xen)`
spinlocks Enable spinlock support on, off; retries - at least 4095 :since:`1.1.0 (QEMU 2.0)`
spinlocks Enable spinlock support - retries attribute defines after how many on, off; :since:`1.1.0 (QEMU 2.0), never-notify mode 11.9.0 (QEMU 2.0)`
failed acquisition attempts to notify the hypervisor retries - between 4095 and 4294967295, the
special value 4294967295 means to never
notify the hypervisor (default if omitted)
vpindex Virtual processor index on, off :since:`1.3.3 (QEMU 2.5), 11.3.0 (Xen, always on)`
runtime Processor time spent on running guest code and on behalf of guest code on, off :since:`1.3.3 (QEMU 2.5)`
synic Enable Synthetic Interrupt Controller (SynIC) on, off :since:`1.3.3 (QEMU 2.6), 11.3.0 (Xen)`
@@ -2189,6 +2192,12 @@ are:
virtual CPU may or may not contain features which may block migration
even to an identical host.
``host-model``
Similar to the ``passthrough`` mode, except libvirt detects which
enlightenments are supported by hypervisor and expands them on domain
startup into the live XML. In a sense, this is similar to ``host-model``
CPU mode (See `CPU model and topology`_). :since:`Since 11.9.0`
The ``mode`` attribute can be omitted and will default to ``custom``.
``pvspinlock``
@@ -3369,6 +3378,11 @@ paravirtualized driver is specified via the ``disk`` element.
:since:`since after 0.4.4`; "sata" attribute value :since:`since 0.9.7`;
"removable" attribute value :since:`since 1.1.3`;
"rotation_rate" attribute value :since:`since 7.3.0`
The optional attribute ``dpofua`` (:since:`Since 11.10.0, only QEMU driver`)
controls the support of DPO(Disable Page Out) and FUA(Force Unit Access)
properties of a SCSI disk cache access (both must be present or absent).
If the value is omitted hypervisor default is applied (which may depend on
the machine type version) and is the suggested setting.
``throttlefilters``
The optional ``throttlefilters`` element provides the ability to provide additional
per-device throttle chain :since:`Since 11.2.0`
@@ -3588,6 +3602,23 @@ paravirtualized driver is specified via the ``disk`` element.
</iothreads>
</driver>
- The optional ``statistics`` sub-element allows configuring statistics
collection in configurable intervals for the given disk. Intervals are
configured by ``<statistic>`` sub-elements with ``interval`` attribute
configuring the collection window duration in seconds. The statistics
are available via the bulk statistics API.
Example::
<driver name='qemu'>
<statistics>
<statistic interval='1'/>
<statistic interval='10'/>
</statistics>
</driver>
:since:`Since 11.9.0 (QEMU 10.2, virtio, ide, scsi disks only)`.
- The optional ``queues`` attribute specifies the number of virt queues for
virtio-blk ( :since:`Since 3.9.0` ) or vhost-user-blk
( :since:`Since 7.1.0` )
@@ -6876,6 +6907,10 @@ interaction with the admin.
ID is specified, then the default audio backend will be used.
:since:`Since 7.2.0, qemu`.
The optional ``wait`` attribute, when set to ``yes``, causes the guest
to wait for an incoming VNC connection before booting.
:since:`Since 11.10.0, bhyve`.
``spice`` :since:`Since 0.8.6`
Starts a SPICE server. The ``port`` attribute specifies the TCP port
number (with -1 as legacy syntax indicating that it should be
@@ -8350,8 +8385,8 @@ The watchdog device requires an additional driver and management daemon in the
guest. Just enabling the watchdog in the libvirt configuration does not do
anything useful on its own.
Currently libvirt does not support notification when the watchdog fires. This
feature is planned for a future version of libvirt.
:since:`Since 0.8.0`, a notification is available when the watchdog fires, using
the event ID ``VIR_DOMAIN_EVENT_ID_WATCHDOG``.
Having multiple watchdogs is usually not something very common, but be aware
that this might happen, for example, when an implicit watchdog device is added
@@ -9212,6 +9247,10 @@ Example:
Enable x2APIC mode. Useful for higher number of guest CPUs.
:since:`Since 11.5.0` (QEMU/KVM and ``amd`` model only)
``pciBus``
The ``pciBus`` attribute notes the index of the controller that an
IOMMU device is attached to. (QEMU/KVM and ``smmuv3`` model only)
The ``virtio`` IOMMU devices can further have ``address`` element as described
in `Device addresses`_ (address has to by type of ``pci``).

View File

@@ -869,11 +869,10 @@ Hyper-V Enlightenments
Report which features improving behavior of guests running Microsoft Windows
are supported. The ``features`` enum corresponds to the ``<hyperv/>`` element
(well, its children) as documented in `Hypervisor features
<formatdomain.html#hypervisor-features>`__.
Please note that depending on the QEMU version some capabilities might be
missing even though QEMU does support them. This is because prior to QEMU-6.1.0
not all features were reported by QEMU.
<formatdomain.html#hypervisor-features>`__. The ``defaults`` element then
contains child elements describing default values as reported by hypervisor,
e.g. whether direct or extended TLB flushes are available. :since:`(since
11.9.0)`
Launch security
^^^^^^^^^^^^^^^

View File

@@ -127,9 +127,12 @@ The top-level ``domainsnapshot`` element may contain the following elements:
:since:`Since 8.2.0` the ``snapshot`` attribute supports the ``manual``
value which instructs the hypervisor to create the snapshot and keep a
synchronized state by pausing the VM which allows to snapshot disk
synchronized state by pausing the VM (and where supported deactivating
the storage backends of the hypervisor), which allows to snapshot disk
storage from outside of the hypervisor if the storage provider supports
it. The caller is responsible for resuming a VM paused by requesting a
it. VM operations requiring the storage (e.g. blockjobs, migration) should
be avoided to ensure that the storage backends can stay deactivated.
The caller is responsible for resuming a VM paused by requesting a
``manual`` snapshot. When reverting such snapshot, the expectation is that
the storage is configured in a way where the hypervisor will see the
correct image state.

View File

@@ -33,7 +33,9 @@ foreach data : html_xslt_gen
'--stringparam', 'pagesrc', data.get('source', ''),
'--stringparam', 'builddir', meson.project_build_root(),
'--stringparam', 'timestamp', docs_timestamp,
'--stringparam', 'href_base', data.get('href_base', ''),
'--stringparam', 'link_href_base', data.get('href_base', ''),
'--stringparam', 'asset_href_base', data.get('href_base', ''),
'--stringparam', 'edit_href_base', 'https://gitlab.com/libvirt/libvirt/-/blob/master/',
'--nonet',
site_xsl,
'@INPUT@',

View File

@@ -101,7 +101,9 @@ foreach data : html_xslt_gen
'--stringparam', 'pagesrc', data.get('source', ''),
'--stringparam', 'builddir', meson.project_build_root(),
'--stringparam', 'timestamp', docs_timestamp,
'--stringparam', 'href_base', data.get('href_base', ''),
'--stringparam', 'link_href_base', data.get('href_base', ''),
'--stringparam', 'asset_href_base', data.get('href_base', ''),
'--stringparam', 'edit_href_base', 'https://gitlab.com/libvirt/libvirt/-/blob/master/',
'--nonet',
site_xsl,
'@INPUT@',

View File

@@ -34,7 +34,8 @@ Quick Links
Already a regular open source contributor and have git set up? Have a quick
look at how to propose your changes to libvirt correctly
`Security vulnerabilities <securityprocess.html>`__
View security notices and report vulnerabilities to the libvirt security
View `security notices <https://security.libvirt.org>`__ and
`report vulnerabilities <securityprocess.html>`__ to the libvirt security
response team
`Bug reporting <bugs.html>`__
View and report bugs in libvirt packages

View File

@@ -42,7 +42,9 @@ foreach data : html_xslt_gen
'--stringparam', 'pagesrc', data.get('source', ''),
'--stringparam', 'builddir', meson.project_build_root(),
'--stringparam', 'timestamp', docs_timestamp,
'--stringparam', 'href_base', data.get('href_base', ''),
'--stringparam', 'link_href_base', data.get('href_base', ''),
'--stringparam', 'asset_href_base', data.get('href_base', ''),
'--stringparam', 'edit_href_base', 'https://gitlab.com/libvirt/libvirt/-/blob/master/',
'--nonet',
site_xsl,
'@INPUT@',

View File

@@ -1,3 +1,5 @@
.. role:: since
===============================
Efficient live full disk backup
===============================
@@ -84,6 +86,24 @@ This requires libvirt-7.2.0 and QEMU-4.2, or higher versions.
15M -rw-r--r--. 1 qemu qemu 15M May 10 12:22 vm1.qcow2
21M -rw-------. 1 root root 21M May 10 12:23 vm1.qcow2.1620642185
Shutdown of the guest OS during backup
--------------------------------------
The backup job is a long running job, potentially copying a lot of data, which
requires the VM to be active (The backup is done by the qemu process) and
can't be continued if the VM shuts down. This includes shut down initiated by
the guest OS itself.
:since:`Since libvirt-11.10` the ``virDomainBackupBegin()`` supports the
``VIR_DOMAIN_BACKUP_BEGIN_PRESERVE_SHUTDOWN_DOMAIN`` flag
(``virsh backup-begin --preserve-domain-on-shutdown``) which instructs libvirt
to avoid termination of the VM if the guest OS shuts down while the backup is
still running. The VM is in that scenario reset and paused instead of terminated
allowing the backup to finish. Once the backup finishes the VM process is
terminated. Users can resume the VM (e.g. ``virsh resume``) which causes it
to boot normally using the existing VM process and will continue to run after
completion of the backup job.
Full backup with older libvirt versions
=======================================

View File

@@ -53,7 +53,9 @@ foreach data : html_xslt_gen
'--stringparam', 'pagesrc', data.get('source', ''),
'--stringparam', 'builddir', meson.project_build_root(),
'--stringparam', 'timestamp', docs_timestamp,
'--stringparam', 'href_base', data.get('href_base', ''),
'--stringparam', 'link_href_base', data.get('href_base', ''),
'--stringparam', 'asset_href_base', data.get('href_base', ''),
'--stringparam', 'edit_href_base', 'https://gitlab.com/libvirt/libvirt/-/blob/master/',
'--nonet',
site_xsl,
'@INPUT@',

View File

@@ -75,6 +75,25 @@ in the path specified, otherwise the connection will fail with a fatal error. If
- For the root user, the global default locations will always be used.
Multiple parallel certificate identities
----------------------------------------
Any scenario that requires a certificate identify (``servercert.pem`` /
``serverkey.pem`` and ``clientcert.pem`` / ``clientkey.pem``) can optionally
provide multiple parallel identities via a new indexed file naming
scheme. The new filenames are ``servercertNN.pem`` / ``serverkeyNN.pem``
and ``clientcertNN.pem`` / ``clientkeyNN.pem``, for values of ``NN`` between
0 and 3 inclusive.
The new naming can be used instead of the old naming, or concurrently
with the old naming. The old file names will be loaded first (if
present), followed by the indexed file names. Loading will stop at
the first missing index value. ie if ``servercert1.pem`` is not present,
then no attempt will be made to load ``servercert2.pem`` or ``servercert3.pem``.
If multiple CA certificates are required they must all be concatenated
into the single ``cacert.pem`` file.
Background to TLS certificates
------------------------------
@@ -326,6 +345,75 @@ briefly cover the steps.
cp clientkey.pem /etc/pki/libvirt/private/clientkey.pem
cp clientcert.pem /etc/pki/libvirt/clientcert.pem
Configuring for Post-Quantum Cryptography
-----------------------------------------
Given a new enough gnutls release, suitably integrated & configured with the
operating system crypto policies, libvirt is able to support post-quantum
crytography on TLS enabled services, either exclusively or in a hybrid mode.
In exclusive mode, only a single set of certificates need to be configured
for libvirt, with PQC compliant algorithms. Such a libvirt configuration will
only be able to interoperate with other libvirt daemons that also have PQC
enabled. This can result in compatibility concerns during the period of
transition over to PQC compliant algorithms.
In hybrid mode, multiple sets of certificates need to be configured for libvirt,
at least one set with traditional (non-PQC compliant) algorithms, and at least
one other set with modern (PQC compliant) algorithms. At time of the TLS
handshake, the GNUTLS algorithm priorities should ensure that PQC compliant
algorithms are negotiated if both sides of the connection support PQC. If one
side lacks PQC, the TLS handshake should fallback to the non-PQC algorithms.
This can assist with interoperability during the transition to PQC, but has a
potential weakness wrt downgrade attacks forcing use of non-PQC algorithms.
Exclusive PQC mode should be preferred where both peers in the TLS connections
are known to support PQC.
Key generation parameters
^^^^^^^^^^^^^^^^^^^^^^^^^
To create certificates with PQC compliant algorithms, the ``--key-type``
argument must be passed to ``certtool`` when creating private keys. No
extra arguments are required for the other ``certtool`` commands, as
their behaviour will be determined by the private key type.
The typical PQC compliant algorithms to use are ``ML-DSA-44``, ``ML-DSA-65``
and ``ML-DSA-87``, with ``ML-DSA-65`` being a suitable default choice in
the absence of explicit requirements.
Taking the example earlier, for creating a key for a client certificate,
to use ``ML-DSA-65`` the command line would be modified to look like::
# certtool --generate-privkey --key-type=mldsa65 > clientkey.pem
The equivalent modification applies to the creation of the private keys
used for server certs, or root/intermediate CA certs.
For hybrid mode, the additional indexed certificate naming must be used.
If multiple configured certificates are compatible with the mutually
supported crypto algorithms between the client and server, then the
first matching certificate will be used.
IOW, to ensure that PQC certificates are preferred, they must use a
non-index based filename, or use an index that is smaller than any
non-PQC certificates. ie, ``servercert.pem`` for PQC and ``servercert0.pem``
for non-PQC, or ``servercert0.pem`` for PQC and ``servercert1.pem`` for
non-PQC.
Force disabling PQC via crypto priority
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If the OS configuration for system crypto algorithm priorities has
enabled PQC, this can (optionally) be overriden in libvirt server
configuration. To disable use of PQC set the ``tls_priority``
parameter in the ``libvirtd.conf`` / ``virtproxyd.conf`` files:
tls_priority = "@SYSTEM:-SIGN-ML-DSA-65:-SIGN-ML-DSA-44:-SIGN-ML-DSA-87:-GROUP-X25519-MLKEM768:-GROUP-SECP256R1-MLKEM768:-GROUP-SECP384R1-MLKEM1024"
On the client side this can be overriden using the ``tls_priority``
URI parameter in the libvirt connection address.
Troubleshooting TLS certificate problems
----------------------------------------

View File

@@ -62,7 +62,9 @@ foreach data : html_xslt_gen
'--stringparam', 'pagesrc', data.get('source', ''),
'--stringparam', 'builddir', meson.project_build_root(),
'--stringparam', 'timestamp', docs_timestamp,
'--stringparam', 'href_base', data.get('href_base', ''),
'--stringparam', 'link_href_base', data.get('href_base', ''),
'--stringparam', 'asset_href_base', data.get('href_base', ''),
'--stringparam', 'edit_href_base', 'https://gitlab.com/libvirt/libvirt/-/blob/master/',
'--nonet',
site_xsl,
'@INPUT@',

View File

@@ -152,7 +152,9 @@ foreach data : html_xslt_gen
'--stringparam', 'pagesrc', data.get('source', ''),
'--stringparam', 'builddir', meson.project_build_root(),
'--stringparam', 'timestamp', docs_timestamp,
'--stringparam', 'href_base', data.get('href_base', ''),
'--stringparam', 'link_href_base', data.get('href_base', ''),
'--stringparam', 'asset_href_base', data.get('href_base', ''),
'--stringparam', 'edit_href_base', 'https://gitlab.com/libvirt/libvirt/-/blob/master/',
'--nonet',
site_xsl,
'@INPUT@',

View File

@@ -2186,6 +2186,7 @@ backup-begin
::
backup-begin domain [backupxml] [checkpointxml] [--reuse-external]
[--preserve-domain-on-shutdown]
Begin a new backup job. If *backupxml* is omitted, this defaults to a full
backup using a push model to filenames generated by libvirt; supplying XML
@@ -2199,6 +2200,11 @@ libvirt. For more information on backup XML, see:
If *--reuse-external* is used it instructs libvirt to reuse temporary
and output files provided by the user in *backupxml*.
When the *--preserve-domain-on-shutdown* flag is used libvirt will not
terminate the VM if the guest OS shuts down while the backup is running. The VM
will be instead kept in VIR_DOMAIN_PAUSED state until the backup job finishes.
The vm can be also resumed in order to boot again.
If *checkpointxml* is specified, a second file with a top-level
element of *domaincheckpoint* is used to create a simultaneous
checkpoint, for doing a later incremental backup relative to the time
@@ -2751,6 +2757,60 @@ Information listed includes:
* ``block.<num>.physical`` - physical size of source file in bytes
* ``block.<num>.threshold`` - threshold (in bytes) for delivering the
VIR_DOMAIN_EVENT_ID_BLOCK_THRESHOLD event. See domblkthreshold.
* ``block.<num>.limits.request_alignment`` - Alignment requirement for requests
in bytes
* ``block.<num>.limits.discard_max`` - Maximum number of bytes that can be
discarded at once
* ``block.<num>.limits.discard_alignment`` - Optimal alignment for discard
requests in bytes
* ``block.<num>.limits.write_zeroes_max`` - Maximum number of bytes that can be
zeroed out at once
* ``block.<num>.limits.write_zeroes_alignment`` - Optimal alignment for
write_zeroes requests in bytes
* ``block.<num>.limits.transfer_optimal`` - Optimal transfer length in bytes
* ``block.<num>.limits.transfer_max`` - Maximal transfer length in bytes
* ``block.<num>.limits.transfer_hw_max`` - Maximal hardware transfer length of
requests bypassing kernel IO scheduler in bytes
* ``block.<num>.limits.iov_max`` - Maximum number of scatter/gather elements
* ``block.<num>.limits.iov_hw_max`` - Maximal number of scatter/gather elements
of requests bypassing kernel IO scheduler
* ``block.<num>.limits.memory_alignment_minimal`` - memory alignment in bytes so
that no bounce buffer is needed
* ``block.<num>.limits.memory_alignment_optimal`` - memory alignment in bytes
that is used for bounce buffers
* ``block.<num>.timed_group.count`` - number of blocks of timed group statistics
* ``block.<num>.timed_group.<num>.interval_length`` - The time interval in
seconds for which the statistics in this group were collected.
* ``block.<num>.timed_group.<num>.rd_latency_min`` - minimum latency of read
operations in the defined interval in nanoseconds
* ``block.<num>.timed_group.<num>.rd_latency_max`` - maximum latency of read
operations in the defined interval in nanoseconds
* ``block.<num>.timed_group.<num>.rd_latency_avg`` - average latency of read
operations in the defined interval in nanoseconds
* ``block.<num>.timed_group.<num>.wr_latency_min`` - minimum latency of write
operations in the defined interval in nanoseconds
* ``block.<num>.timed_group.<num>.wr_latency_max`` - maximum latency of write
operations in the defined interval in nanoseconds
* ``block.<num>.timed_group.<num>.wr_latency_avg`` - average latency of write
operations in the defined interval in nanoseconds
* ``block.<num>.timed_group.<num>.zone_append_latency_min`` - minimum latency
of zone append operations in the defined interval in nanoseconds
* ``block.<num>.timed_group.<num>.zone_append_latency_max`` - maximum latency
of zone append operations in the defined interval in nanoseconds
* ``block.<num>.timed_group.<num>.zone_append_latency_avg`` - average latency
of zone append operations in the defined interval in nanoseconds
* ``block.<num>.timed_group.<num>.flush_latency_min`` - minimum latency
of flush operations in the defined interval in nanoseconds
* ``block.<num>.timed_group.<num>.flush_latency_max`` - maximum latency of flush
operations in the defined interval in nanoseconds
* ``block.<num>.timed_group.<num>.flush_latency_avg`` - average latency of flush
operations in the defined interval in nanoseconds
* ``block.<num>.timed_group.<num>.rd_queue_depth_avg`` - average number of
pending read operations in the defined interval
* ``block.<num>.timed_group.<num>.wr_queue_depth_avg`` - average number of
pending write operations in the defined interval
* ``block.<num>.timed_group.<num>.zone_append_queue_depth_avg`` - average number
of pending zone append operations in the defined interval
*--iothread* returns information about IOThreads on the running guest

View File

@@ -301,7 +301,9 @@ foreach data : html_xslt_gen
'--stringparam', 'pagesrc', data.get('source', ''),
'--stringparam', 'builddir', meson.project_build_root(),
'--stringparam', 'timestamp', docs_timestamp,
'--stringparam', 'href_base', data.get('href_base', ''),
'--stringparam', 'link_href_base', data.get('href_base', ''),
'--stringparam', 'asset_href_base', data.get('href_base', ''),
'--stringparam', 'edit_href_base', 'https://gitlab.com/libvirt/libvirt/-/blob/master/',
'--nonet',
site_xsl,
'@INPUT@',

View File

@@ -19,6 +19,7 @@
<xsl:param name="timestamp"/>
<xsl:param name="link_href_base"/>
<xsl:param name="asset_href_base"/>
<xsl:param name="edit_href_base"/>
<xsl:text disable-output-escaping="yes">&lt;!DOCTYPE html&gt;
</xsl:text>
<html lang="en" data-sourcedoc="{$pagesrc}">
@@ -105,11 +106,11 @@
<li><a href="https://serverfault.com/questions/tagged/libvirt">serverfault</a></li>
</ul>
</div>
<xsl:if test="$pagesrc != ''">
<xsl:if test="$pagesrc != '' and $edit_href_base != ''">
<div id="contribute">
<h3>Contribute</h3>
<ul>
<li><a href="https://gitlab.com/libvirt/libvirt/-/blob/master/{$pagesrc}">edit this page</a></li>
<li><a href="{$edit_href_base}{$pagesrc}">edit this page</a></li>
</ul>
</div>
</xsl:if>

View File

@@ -28,8 +28,9 @@
<xsl:apply-templates select="." mode="page">
<xsl:with-param name="pagesrc" select="$pagesrc"/>
<xsl:with-param name="timestamp" select="$timestamp"/>
<xsl:with-param name="link_href_base" select="$href_base"/>
<xsl:with-param name="asset_href_base" select="$href_base"/>
<xsl:with-param name="link_href_base" select="$link_href_base"/>
<xsl:with-param name="asset_href_base" select="$asset_href_base"/>
<xsl:with-param name="edit_href_base" select="$edit_href_base"/>
</xsl:apply-templates>
</xsl:template>

View File

@@ -180,6 +180,9 @@ eventDetailToString(int event,
case VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY_FAILED:
return "Post-copy Error";
case VIR_DOMAIN_EVENT_SUSPENDED_GUEST_SHUTDOWN:
return "guest OS shutdown";
case VIR_DOMAIN_EVENT_SUSPENDED_LAST:
break;
}

View File

@@ -3488,6 +3488,332 @@ struct _virDomainStatsRecord {
*/
# define VIR_DOMAIN_STATS_BLOCK_SUFFIX_THRESHOLD ".threshold"
/**
* VIR_DOMAIN_STATS_BLOCK_SUFFIX_LIMITS_REQUEST_ALIGNMENT:
*
* limits represent constraints on individual operations as imposed by the
* backing file storage technology.
*
* Alignment requirement, in bytes, for offset/length of I/O requests, as
* unsigned long long.
*
* Since: 11.10.0
*/
# define VIR_DOMAIN_STATS_BLOCK_SUFFIX_LIMITS_REQUEST_ALIGNMENT ".limits.request_alignment"
/**
* VIR_DOMAIN_STATS_BLOCK_SUFFIX_LIMITS_DISCARD_MAX:
*
* limits represent constraints on individual operations as imposed by the
* backing file storage technology.
*
* Maximum number of bytes that can be discarded at once, as unsigned long long.
*
* Since: 11.10.0
*/
# define VIR_DOMAIN_STATS_BLOCK_SUFFIX_LIMITS_DISCARD_MAX ".limits.discard_max"
/**
* VIR_DOMAIN_STATS_BLOCK_SUFFIX_LIMITS_DISCARD_ALIGNMENT:
*
* limits represent constraints on individual operations as imposed by the
* backing file storage technology.
*
* Optimal alignment for discard requests in bytes, as unsigned long long.
*
* Since: 11.10.0
*/
# define VIR_DOMAIN_STATS_BLOCK_SUFFIX_LIMITS_DISCARD_ALIGNMENT ".limits.discard_alignment"
/**
* VIR_DOMAIN_STATS_BLOCK_SUFFIX_LIMITS_WRITE_ZEROES_MAX:
*
* limits represent constraints on individual operations as imposed by the
* backing file storage technology.
*
* Maximum number of bytes that can be zeroed out at once, as unsigned long long.
*
* Since: 11.10.0
*/
# define VIR_DOMAIN_STATS_BLOCK_SUFFIX_LIMITS_WRITE_ZEROES_MAX ".limits.write_zeroes_max"
/**
* VIR_DOMAIN_STATS_BLOCK_SUFFIX_LIMITS_WRITE_ZEROES_ALIGNMENT:
*
* limits represent constraints on individual operations as imposed by the
* backing file storage technology.
*
* Optimal alignment for write_zeroes requests in bytes, as unsigned long long.
*
* Since: 11.10.0
*/
# define VIR_DOMAIN_STATS_BLOCK_SUFFIX_LIMITS_WRITE_ZEROES_ALIGNMENT ".limits.write_zeroes_alignment"
/**
* VIR_DOMAIN_STATS_BLOCK_SUFFIX_LIMITS_TRANSFER_OPTIMAL:
*
* limits represent constraints on individual operations as imposed by the
* backing file storage technology.
*
* Optimal transfer length in bytes, as unsigned long long.
*
* Since: 11.10.0
*/
# define VIR_DOMAIN_STATS_BLOCK_SUFFIX_LIMITS_TRANSFER_OPTIMAL ".limits.transfer_optimal"
/**
* VIR_DOMAIN_STATS_BLOCK_SUFFIX_LIMITS_TRANSFER_MAX:
*
* limits represent constraints on individual operations as imposed by the
* backing file storage technology.
*
* Maximal transfer length in bytes, as unsigned long long.
*
* Since: 11.10.0
*/
# define VIR_DOMAIN_STATS_BLOCK_SUFFIX_LIMITS_TRANSFER_MAX ".limits.transfer_max"
/**
* VIR_DOMAIN_STATS_BLOCK_SUFFIX_LIMITS_TRANSFER_HW_MAX:
*
* limits represent constraints on individual operations as imposed by the
* backing file storage technology.
*
* Maximal hardware transfer length of requests bypassing kernel IO scheduler
* in bytes, as unsigned long long.
*
* Since: 11.10.0
*/
# define VIR_DOMAIN_STATS_BLOCK_SUFFIX_LIMITS_TRANSFER_HW_MAX ".limits.transfer_hw_max"
/**
* VIR_DOMAIN_STATS_BLOCK_SUFFIX_LIMITS_IOV_MAX:
*
* limits represent constraints on individual operations as imposed by the
* backing file storage technology.
*
* Maximum number of scatter/gather elements, as unsigned long long.
*
* Since: 11.10.0
*/
# define VIR_DOMAIN_STATS_BLOCK_SUFFIX_LIMITS_IOV_MAX ".limits.iov_max"
/**
* VIR_DOMAIN_STATS_BLOCK_SUFFIX_LIMITS_IOV_HW_MAX:
*
* limits represent constraints on individual operations as imposed by the
* backing file storage technology.
*
* Maximal number of scatter/gather elements of requests bypassing kernel IO
* scheduler, as unsigned long long.
*
* Since: 11.10.0
*/
# define VIR_DOMAIN_STATS_BLOCK_SUFFIX_LIMITS_IOV_HW_MAX ".limits.iov_hw_max"
/**
* VIR_DOMAIN_STATS_BLOCK_SUFFIX_LIMITS_MEMORY_ALIGNMENT_MINIMAL:
*
* limits represent constraints on individual operations as imposed by the
* backing file storage technology.
*
* memory alignment in bytes so that no bounce buffer is needed, as
* unsigned long long.
*
* Since: 11.10.0
*/
# define VIR_DOMAIN_STATS_BLOCK_SUFFIX_LIMITS_MEMORY_ALIGNMENT_MINIMAL ".limits.memory_alignment_minimal"
/**
* VIR_DOMAIN_STATS_BLOCK_SUFFIX_LIMITS_MEMORY_ALIGNMENT_OPTIMAL:
*
* limits represent constraints on individual operations as imposed by the
* backing file storage technology.
*
* memory alignment in bytes that is used for bounce buffers, as
* unsigned long long.
*
* Since: 11.10.0
*/
# define VIR_DOMAIN_STATS_BLOCK_SUFFIX_LIMITS_MEMORY_ALIGNMENT_OPTIMAL ".limits.memory_alignment_optimal"
/**
* VIR_DOMAIN_STATS_BLOCK_SUFFIX_TIMED_GROUP_COUNT:
*
* Number of groups of statistics accounted in a configured time intervals as
* unsigned long long.
*
* Since: 11.10.0
*/
# define VIR_DOMAIN_STATS_BLOCK_SUFFIX_TIMED_GROUP_COUNT ".timed_group.count"
/**
* VIR_DOMAIN_STATS_BLOCK_SUFFIX_TIMED_GROUP_PREFIX:
*
* The parameter name prefix to access each group of timed stats. Concatenate the
* prefix, the entry number formatted as an unsigned integer and one of the
* timed group suffix parameters to form a complete paramter name.
*
* Since: 11.10.0
*/
# define VIR_DOMAIN_STATS_BLOCK_SUFFIX_TIMED_GROUP_PREFIX ".timed_group."
/**
* VIR_DOMAIN_STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_INTERVAL:
*
* The time interval in seconds as unsigned long long for which the statistics
* in this group were collected.
*
* Since: 11.10.0
*/
# define VIR_DOMAIN_STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_INTERVAL ".interval"
/**
* VIR_DOMAIN_STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_RD_LATENCY_MIN:
*
* Minimum latency of read operations in the defined interval, in nanoseconds as
* unsigned long long.
*
* Since: 11.10.0
*/
# define VIR_DOMAIN_STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_RD_LATENCY_MIN ".rd_latency_min"
/**
* VIR_DOMAIN_STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_RD_LATENCY_MAX:
*
* Maximum latency of read operations in the defined interval, in nanoseconds as
* unsigned long long.
*
* Since: 11.10.0
*/
# define VIR_DOMAIN_STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_RD_LATENCY_MAX ".rd_latency_max"
/**
* VIR_DOMAIN_STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_RD_LATENCY_AVG:
*
* Average latency of read operations in the defined interval, in nanoseconds as
* unsigned long long.
*
* Since: 11.10.0
*/
# define VIR_DOMAIN_STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_RD_LATENCY_AVG ".rd_latency_avg"
/**
* VIR_DOMAIN_STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_WR_LATENCY_MIN:
*
* Minimum latency of write operations in the defined interval, in nanoseconds
* as unsigned long long.
*
* Since: 11.10.0
*/
# define VIR_DOMAIN_STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_WR_LATENCY_MIN ".wr_latency_min"
/**
* VIR_DOMAIN_STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_WR_LATENCY_MAX:
*
* Maximum latency of write operations in the defined interval, in nanoseconds
* as unsigned long long.
*
* Since: 11.10.0
*/
# define VIR_DOMAIN_STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_WR_LATENCY_MAX ".wr_latency_max"
/**
* VIR_DOMAIN_STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_WR_LATENCY_AVG:
*
* Average latency of write operations in the defined interval, in nanoseconds
* as unsigned long long.
*
* Since: 11.10.0
*/
# define VIR_DOMAIN_STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_WR_LATENCY_AVG ".wr_latency_avg"
/**
* VIR_DOMAIN_STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_ZONE_APPEND_LATENCY_MIN:
* Minimum latency of zone append operations in the defined interval, in
* nanoseconds as unsigned long long.
*
* Since: 11.10.0
*/
# define VIR_DOMAIN_STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_ZONE_APPEND_LATENCY_MIN ".zone_append_latency_min"
/**
* VIR_DOMAIN_STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_ZONE_APPEND_LATENCY_MAX:
*
* Maximum latency of zone append operations in the defined interval, in
* nanoseconds as unsigned long long.
*
* Since: 11.10.0
*/
# define VIR_DOMAIN_STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_ZONE_APPEND_LATENCY_MAX ".zone_append_latency_max"
/**
* VIR_DOMAIN_STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_ZONE_APPEND_LATENCY_AVG:
*
* Average latency of zone append operations in the defined interval, in
* nanoseconds as unsigned long long.
*
* Since: 11.10.0
*/
# define VIR_DOMAIN_STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_ZONE_APPEND_LATENCY_AVG ".zone_append_latency_avg"
/**
* VIR_DOMAIN_STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_FLUSH_LATENCY_MIN:
*
* Minimum latency of flush operations in the defined interval, in nanoseconds
* as unsigned long long.
*
* Since: 11.10.0
*/
# define VIR_DOMAIN_STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_FLUSH_LATENCY_MIN ".flush_latency_min"
/**
* VIR_DOMAIN_STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_FLUSH_LATENCY_MAX:
*
* Maximum latency of flush operations in the defined interval, in nanoseconds
* as unsigned long long.
*
* Since: 11.10.0
*/
# define VIR_DOMAIN_STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_FLUSH_LATENCY_MAX ".flush_latency_max"
/**
* VIR_DOMAIN_STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_FLUSH_LATENCY_AVG:
*
* Average latency of flush operations in the defined interval, in nanoseconds
* as unsigned long long.
*
* Since: 11.10.0
*/
# define VIR_DOMAIN_STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_FLUSH_LATENCY_AVG ".flush_latency_avg"
/**
* VIR_DOMAIN_STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_RD_QUEUE_DEPTH_AVG:
*
* Average number of pending read operations in the defined interval as double.
*
* Since: 11.10.0
*/
# define VIR_DOMAIN_STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_RD_QUEUE_DEPTH_AVG ".rd_queue_depth_avg"
/**
* VIR_DOMAIN_STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_WR_QUEUE_DEPTH_AVG:
*
* Average number of pending write operations in the defined interval as double.
*
* Since: 11.10.0
*/
# define VIR_DOMAIN_STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_WR_QUEUE_DEPTH_AVG ".wr_queue_depth_avg"
/**
* VIR_DOMAIN_STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_ZONE_APPEND_QUEUE_DEPTH_AVG:
*
* Average number of pending zone append operations in the defined interval as
* double.
*
* Since: 11.10.0
*/
# define VIR_DOMAIN_STATS_BLOCK_SUFFIX_TIMED_GROUP_SUFFIX_ZONE_APPEND_QUEUE_DEPTH_AVG ".zone_append_queue_depth_avg"
/**
* VIR_DOMAIN_STATS_PERF_CMT:
@@ -5075,6 +5401,7 @@ typedef enum {
VIR_DOMAIN_EVENT_SUSPENDED_API_ERROR = 6, /* Some APIs (e.g., migration, snapshot) internally need to suspend a domain. This event detail is used when resume operation at the end of such API fails. (Since: 1.0.1) */
VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY = 7, /* suspended for post-copy migration (Since: 1.3.3) */
VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY_FAILED = 8, /* suspended after failed post-copy (Since: 1.3.3) */
VIR_DOMAIN_EVENT_SUSPENDED_GUEST_SHUTDOWN = 9, /* suspended after guest os shut-down (a long running job is preserving the VM until completion) (Since: 11.10.0) */
# ifdef VIR_ENUM_SENTINELS
VIR_DOMAIN_EVENT_SUSPENDED_LAST /* (Since: 0.9.10) */
@@ -8191,8 +8518,10 @@ int virDomainAgentSetResponseTimeout(virDomainPtr domain,
* Since: 6.0.0
*/
typedef enum {
VIR_DOMAIN_BACKUP_BEGIN_REUSE_EXTERNAL = (1 << 0), /* reuse separately
provided images (Since: 6.0.0) */
/* reuse separately provided images (Since: 6.0.0) */
VIR_DOMAIN_BACKUP_BEGIN_REUSE_EXTERNAL = (1 << 0),
/* preserve the domain if the guest OS shuts down while the backup is running (Since: 11.10.0) */
VIR_DOMAIN_BACKUP_BEGIN_PRESERVE_SHUTDOWN_DOMAIN = (1 << 1),
} virDomainBackupBeginFlags;
int virDomainBackupBegin(virDomainPtr domain,

View File

@@ -6,7 +6,7 @@
%define min_rhel 9
%define min_fedora 41
%define arches_qemu_kvm %{ix86} x86_64 %{power64} %{arm} aarch64 s390x riscv64
%define arches_qemu_kvm %{ix86} x86_64 %{power64} aarch64 s390x riscv64
%if 0%{?rhel}
%if 0%{?rhel} >= 10
%define arches_qemu_kvm x86_64 aarch64 s390x riscv64
@@ -32,12 +32,22 @@
%define arches_ch x86_64 aarch64
# The hypervisor drivers that run in libvirtd
%define with_qemu 0%{!?_without_qemu:1}
%define with_lxc 0%{!?_without_lxc:1}
%define with_libxl 0%{!?_without_libxl:1}
%define with_vbox 0%{!?_without_vbox:1}
%define with_ch 0%{!?_without_ch:1}
%ifarch %{arches_64bit}
%define with_qemu 0%{!?_without_qemu:1}
%else
# QEMU drops 32-bit in Fedora 44
%if %{?fedora} > 43
%define with_qemu 0
%else
%define with_qemu 0%{!?_without_qemu:1}
%endif
%endif
%ifarch %{arches_qemu_kvm}
%define with_qemu_kvm %{with_qemu}
%else
@@ -76,8 +86,10 @@
%define with_storage_gluster 0
%endif
# Fedora had zfs-fuse until F43
%if 0%{?fedora} && 0%{?fedora} < 43
# On Fedora 43, the 'zfs-fuse' package was removed, but is obtainable via
# other means. Build the backend, but it's no longer considered to be part
# of 'daemon-driver-storage'.
%if 0%{?fedora}
%define with_storage_zfs 0%{!?_without_storage_zfs:1}
%else
%define with_storage_zfs 0
@@ -91,7 +103,6 @@
# Other optional features
%define with_numactl 0%{!?_without_numactl:1}
%define with_userfaultfd_sysctl 0%{!?_without_userfaultfd_sysctl:1}
# A few optional bits off by default, we enable later
%define with_fuse 0
@@ -259,12 +270,6 @@
%define enable_werror -Dwerror=false -Dgit_werror=disabled
%endif
# Fedora and RHEL-9 are new enough to support /dev/userfaultfd, which
# does not require enabling vm.unprivileged_userfaultfd sysctl.
%if 0%{?fedora} || 0%{?rhel}
%define with_userfaultfd_sysctl 0
%endif
%define tls_priority "@LIBVIRT,SYSTEM"
# libvirt 8.1.0 stops distributing any sysconfig files.
@@ -404,7 +409,7 @@ BuildRequires: numactl-devel
%endif
BuildRequires: libcap-ng-devel >= 0.5.0
%if %{with_fuse}
BuildRequires: fuse-devel >= 2.8.6
BuildRequires: fuse3-devel
%endif
%if %{with_libssh2}
BuildRequires: libssh2-devel >= 1.3.0
@@ -674,9 +679,6 @@ Requires: /usr/bin/qemu-img
Obsoletes: libvirt-daemon-driver-storage-rbd < 5.2.0
%endif
Obsoletes: libvirt-daemon-driver-storage-sheepdog < 8.8.0
%if !%{with_storage_zfs}
Obsoletes: libvirt-daemon-driver-storage-zfs < 11.4.0
%endif
%description daemon-driver-storage-core
The storage driver plugin for the libvirtd daemon, providing
@@ -777,9 +779,13 @@ volumes using the ceph protocol.
Summary: Storage driver plugin for ZFS
Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
Requires: libvirt-libs = %{version}-%{release}
# Support any conforming implementation of zfs
# Starting with Fedora 43 the 'zfs-fuse' is no longer shipped but obtainable
# externally. The package builds fine without these. Users will have to provide
# their own implementation.
%if 0%{?fedora} && 0%{?fedora} < 43
Requires: /sbin/zfs
Requires: /sbin/zpool
%endif
%description daemon-driver-storage-zfs
The storage driver backend adding implementation of the storage APIs for
@@ -803,7 +809,10 @@ Requires: libvirt-daemon-driver-storage-gluster = %{version}-%{release}
%if %{with_storage_rbd}
Requires: libvirt-daemon-driver-storage-rbd = %{version}-%{release}
%endif
%if %{with_storage_zfs}
# Starting with Fedora 43 the 'zfs-fuse' is no longer shipped but obtainable
# externally. We do not want to install this as part of 'daemon-driver-storage'
# any more.
%if %{with_storage_zfs} && 0%{?fedora} && 0%{?fedora} < 43
Requires: libvirt-daemon-driver-storage-zfs = %{version}-%{release}
%endif
@@ -1329,12 +1338,6 @@ exit 1
%define arg_remote_mode -Dremote_default_mode=legacy
%endif
%if %{with_userfaultfd_sysctl}
%define arg_userfaultfd_sysctl -Duserfaultfd_sysctl=enabled
%else
%define arg_userfaultfd_sysctl -Duserfaultfd_sysctl=disabled
%endif
%define when %(date +"%%F-%%T")
%define where %(hostname)
%define who %{?packager}%{!?packager:Unknown}
@@ -1418,7 +1421,6 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/libvirt.spec)
-Dqemu_datadir=%{qemu_datadir} \
-Dtls_priority=%{tls_priority} \
-Dsysctl_config=enabled \
%{?arg_userfaultfd_sysctl} \
-Dssh_proxy=enabled \
%{?enable_werror} \
-Dexpensive_tests=enabled \
@@ -1506,7 +1508,6 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/libvirt.spec)
-Dstorage_vstorage=disabled \
-Dstorage_zfs=disabled \
-Dsysctl_config=disabled \
-Duserfaultfd_sysctl=disabled \
-Dssh_proxy=disabled \
-Dtests=disabled \
-Dudev=disabled \
@@ -2314,9 +2315,6 @@ exit 0
%if %{with_qemu}
%files daemon-driver-qemu
%config(noreplace) %{_sysconfdir}/libvirt/virtqemud.conf
%if %{with_userfaultfd_sysctl}
%config(noreplace) %{_prefix}/lib/sysctl.d/60-qemu-postcopy-migration.conf
%endif
%{_datadir}/augeas/lenses/virtqemud.aug
%{_datadir}/augeas/lenses/tests/test_virtqemud.aug
%{_unitdir}/virtqemud.service

View File

@@ -1,6 +1,6 @@
project(
'libvirt', 'c',
version: '11.8.0',
version: '11.10.0',
license: 'LGPLv2+',
meson_version: '>= 0.57.0',
default_options: [
@@ -1365,6 +1365,26 @@ if wireshark_dep.found()
if cc.check_header('wireshark/ws_version.h')
conf.set('WITH_WS_VERSION', 1)
endif
# Find wmem.h
# But it's not as easy as you'd think. Ubuntu 20.04 has split parts of
# libwireshark.so into libwsutil.so but:
# a) wireshark.pc never mentions it,
# b) libwsutil-dev package doesn't install pkg-config file.
# Fortunately, it's fixed in 24.04.
if cc.check_header('wireshark/epan/wmem/wmem.h', dependencies: wireshark_dep)
conf.set('WITH_WS_EPAN_WMEM', 1)
elif cc.check_header('wireshark/wsutil/wmem/wmem.h', dependencies: wireshark_dep)
conf.set('WITH_WS_WSUTIL_WMEM', 1)
else
error('Unable to locate wmem.h file')
endif
# TODO: drop wsutil dep once support for Ubuntu 20.04 is dropped
wsutil_dep = dependency('', required: false)
if not cc.has_function('wmem_free', dependencies: wireshark_dep)
wsutil_dep = cc.find_library('wsutil', required: true)
endif
endif
# generic build dependencies checks
@@ -2009,13 +2029,18 @@ elif get_option('sysctl_config').enabled()
error('sysctl configuration is supported only on linux')
endif
if not get_option('userfaultfd_sysctl').disabled() and conf.has('WITH_SYSCTL')
conf.set('WITH_USERFAULTFD_SYSCTL', 1)
elif get_option('userfaultfd_sysctl').enabled()
error('userfaultfd_sysctl option requires sysctl_config to be enabled')
prio = get_option('tls_priority')
if prio == 'auto'
# If local OS has 'crypto-policies' then default to that
policy = '/etc/crypto-policies/config'
if get_option('system') and \
run_command('test', '-f', policy, check: false).returncode() == 0
prio = '@LIBVIRT,SYSTEM'
else
prio = 'NORMAL'
endif
endif
conf.set_quoted('TLS_PRIORITY', get_option('tls_priority'))
conf.set_quoted('TLS_PRIORITY', prio)
# test options
@@ -2314,7 +2339,6 @@ misc_summary = {
'sysctl config': conf.has('WITH_SYSCTL'),
'tests': tests_enabled,
'TLS priority': conf.get_unquoted('TLS_PRIORITY'),
'userfaultfd sysctl': conf.has('WITH_USERFAULTFD_SYSCTL'),
'virt-host-validate': conf.has('WITH_HOST_VALIDATE'),
'virt-login-shell': conf.has('WITH_LOGIN_SHELL'),
'Warning Flags': supported_cc_flags,

View File

@@ -132,6 +132,4 @@ option('nbdkit_config_default', type: 'feature', value: 'auto', description: 'Wh
option('pm_utils', type: 'feature', value: 'auto', description: 'use pm-utils for power management')
option('ssh_proxy', type: 'feature', value: 'auto', description: 'Build ssh-proxy for ssh over vsock')
option('sysctl_config', type: 'feature', value: 'auto', description: 'Whether to install sysctl configs')
# dep:sysctl_config
option('userfaultfd_sysctl', type: 'feature', value: 'auto', description: 'Whether to install sysctl config for enabling unprivileged userfaultfd')
option('tls_priority', type: 'string', value: 'NORMAL', description: 'set the default TLS session priority string')
option('tls_priority', type: 'string', value: 'auto', description: 'set the default TLS session priority string')

Some files were not shown because too many files have changed in this diff Show More