]> git.ipfire.org Git - thirdparty/libvirt.git/log
thirdparty/libvirt.git
5 weeks agoqemuDomainQemuMonitorCommand: Add top-level flag validation
Peter Krempa [Thu, 2 Apr 2026 14:46:46 +0000 (16:46 +0200)] 
qemuDomainQemuMonitorCommand: Add top-level flag validation

The implementation uses 'qemuDomainQemuMonitorCommandWithFiles'
internally. To have a top level flag validation for the upcoming flag
introspection export the supported flags as a macro and add a
'virCheckFlags'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 weeks agoqemuDomainManagedSaveDefineXML: Add top-level flag validation
Peter Krempa [Thu, 2 Apr 2026 14:46:46 +0000 (16:46 +0200)] 
qemuDomainManagedSaveDefineXML: Add top-level flag validation

The implementation for managed save uses 'qemuDomainSaveImageDefineXML'
internally which validates the flags. To have a top level flag
validation for the upcoming flag introspection export the supported
flags as a macro and add a 'virCheckFlags' to
'qemuDomainManagedSaveDefineXML'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 weeks agoqemuDomainDetachDeviceAlias: Move 'flags' validation to top level
Peter Krempa [Thu, 2 Apr 2026 14:28:23 +0000 (16:28 +0200)] 
qemuDomainDetachDeviceAlias: Move 'flags' validation to top level

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 weeks agoqemuDomainGetLaunchSecurityInfo: Move flag check to top level
Peter Krempa [Thu, 2 Apr 2026 14:27:13 +0000 (16:27 +0200)] 
qemuDomainGetLaunchSecurityInfo: Move flag check to top level

The flag check inside 'qemuDomainGetSEVInfo' makes no sense because it
only validates the 'VIR_TYPED_PARAM_STRING_OKAY' which is not actually
used.

Remove the 'flags parameter from 'qemuDomainGetSEVInfo' and validate
flags at 'qemuDomainGetLaunchSecurityInfo'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 weeks agoqemu: snapshot: Move flag checks to top level functions
Peter Krempa [Thu, 2 Apr 2026 14:20:57 +0000 (16:20 +0200)] 
qemu: snapshot: Move flag checks to top level functions

Move the 'virCheckFlags' invocations to the top level driver function so
that they become available for introspection.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 weeks agoqemuDomainRestore(Flags|Params): Refactor flag checking
Peter Krempa [Thu, 2 Apr 2026 14:19:21 +0000 (16:19 +0200)] 
qemuDomainRestore(Flags|Params): Refactor flag checking

Create QEMU_DOMAIN_RESTORE_FLAGS define which collects all the flags
used by either of the implementations of the 'Restore' API and move the
flag checking into the implementation function so that it's available
later for introspection.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 weeks agoqemu: checkpoint: Move 'virCheckFlags' to top level functions
Peter Krempa [Thu, 2 Apr 2026 13:41:24 +0000 (15:41 +0200)] 
qemu: checkpoint: Move 'virCheckFlags' to top level functions

Move the flag check to the top level to allow programatic introspection
of supported flags.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 weeks agoqemu: dump: Move 'virCheckFlags' to top level functions
Peter Krempa [Thu, 2 Apr 2026 13:41:24 +0000 (15:41 +0200)] 
qemu: dump: Move 'virCheckFlags' to top level functions

Move the flag check to the top level to allow programatic introspection
of supported flags.

Extract the supported flags as a macro so that they can be reused in
both coredump APIs.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 weeks agoqemu: attach/detach device: Move 'virCheckFlags' to top level functions
Peter Krempa [Thu, 2 Apr 2026 13:41:24 +0000 (15:41 +0200)] 
qemu: attach/detach device: Move 'virCheckFlags' to top level functions

Move the flag check to the top level to allow programatic introspection
of supported flags.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 weeks agoqemu: backup: Move 'virCheckFlags' to top level functions
Peter Krempa [Thu, 2 Apr 2026 13:41:24 +0000 (15:41 +0200)] 
qemu: backup: Move 'virCheckFlags' to top level functions

Move the flag check to the top level to allow programatic introspection
of supported flags.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 weeks agovirNodeSuspend: Remove unused 'flags'
Peter Krempa [Thu, 2 Apr 2026 14:45:06 +0000 (16:45 +0200)] 
virNodeSuspend: Remove unused 'flags'

Remove the unused argument and bump the 'virCheckFlags' calls to the top
level.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 weeks agovirHostMemGet(Stats|Parameters): Remove unused 'flags'
Peter Krempa [Thu, 2 Apr 2026 14:44:25 +0000 (16:44 +0200)] 
virHostMemGet(Stats|Parameters): Remove unused 'flags'

The utility functions which get memory stats don't actually use the
flags. Remove the argument and move the 'virCheckFlags' to driver
implementation.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 weeks agovirHostCPUGet(Map|Stats): Remove unused 'flags'
Peter Krempa [Thu, 2 Apr 2026 14:44:25 +0000 (16:44 +0200)] 
virHostCPUGet(Map|Stats): Remove unused 'flags'

The utility functions which get CPU map and stats don't actually use the
flags. Remove the argument and move the 'virCheckFlags' to driver
implementation.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 weeks agoscripts: check-symfile: Allow also symbols in 'readonly' section
Peter Krempa [Mon, 27 Apr 2026 10:05:06 +0000 (12:05 +0200)] 
scripts: check-symfile: Allow also symbols in 'readonly' section

Validate also variables exported as 'extern' e.g. from the util
submodule.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 weeks agoutil: typedparam: Refactor and fix typed param validation
Peter Krempa [Wed, 22 Apr 2026 12:48:46 +0000 (14:48 +0200)] 
util: typedparam: Refactor and fix typed param validation

'virTypedParamsValidate' has special logic to handle the internal
VIR_TYPED_PARAM_UNSIGNED type, but unfortunately the implementation of
the error which is reported is flawed as it only updated the
'expecttype' string when the type actually matched. In cases when it
didn't we'd report the following error:

  error: invalid argument: invalid type 'string' for parameter 'poll_shrink', expected '(null)'

To fix it we can re-implement the validation part by using
virTypedParamValidateType simply by adding the VIR_TYPED_PARAM_UNSIGNED
to 'virTypedParameterTypeToString' handling which is now private and
adding logic to allow either one of the unsigned types, which allows us
to use the same function in both cases, simplifying the code.

Fixes: 07652410a7af98ca03281c4bfe20415ced26a44a
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 weeks agoutil: typedparam: Unexport virTypedParameterTypeFromString/virTypedParameterTypeToString
Peter Krempa [Wed, 22 Apr 2026 12:39:27 +0000 (14:39 +0200)] 
util: typedparam: Unexport virTypedParameterTypeFromString/virTypedParameterTypeToString

The enum handler implementation has already some special values,
upcoming patches will add more so keep the only internal to avoid
surprises.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 weeks agoutil: Replace open-coded internals of VIR_TYPED_PARAMS_DEBUG with 'virTypedParamDebugstr'
Peter Krempa [Wed, 22 Apr 2026 12:36:22 +0000 (14:36 +0200)] 
util: Replace open-coded internals of VIR_TYPED_PARAMS_DEBUG with 'virTypedParamDebugstr'

Replace the internals of the macro by a function so that
'virTypedParameterToString' doesn't need to be exported as it also
adds mappings for values which don't exist in the public API.

This change also prevents a NULL to be passed to string formatters in
case when the caller sends an unknown typed parameter type as we now
also make sure that the type is in range.

Fixes: 54dd75fd97339dd49a54554e9327e5680c72132b
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 weeks agoutil: virTypedParamValidateType: Don't report unknown typed parameter type as '(null)'
Peter Krempa [Wed, 22 Apr 2026 09:58:07 +0000 (11:58 +0200)] 
util: virTypedParamValidateType: Don't report unknown typed parameter type as '(null)'

If the actual type of the typed parameter is an invalid number the type
checker would still attempt to convert it to a string resulting in an
attempt to print a NULL string. libc saves us from the crash but the
error message is still wrong. Fix it.

Fixes: 54dd75fd97339dd49a54554e9327e5680c72132b
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 weeks agoutil: typedparam: Convert VIR_TYPED_PARAM_CHECK_TYPE into a function
Peter Krempa [Wed, 22 Apr 2026 09:54:35 +0000 (11:54 +0200)] 
util: typedparam: Convert VIR_TYPED_PARAM_CHECK_TYPE into a function

Create 'virTypedParamValidateType' which will use the same logic
encapsulated in a function. Use the error message wording from
'virTypedParamsValidate' as it contains less fluff.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 weeks agoqemu: driver: Unify coding style
Peter Krempa [Thu, 2 Apr 2026 13:22:41 +0000 (15:22 +0200)] 
qemu: driver: Unify coding style

Reformat qemu_driver.c to use the contemporary coding style. It will
help also for the upcoming script for generating list of supported flags
for APIs.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 weeks agoremote_protocol-structs: fix mis-aligned 'remote_domain_set_throttle_group_args'
Peter Krempa [Mon, 20 Apr 2026 08:13:05 +0000 (10:13 +0200)] 
remote_protocol-structs: fix mis-aligned 'remote_domain_set_throttle_group_args'

Fixes: a10b3ffebb6c498b357fd546c737d152cdf3e77d
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 weeks agovirStorageSource: note that capacity/allocation/physical are stale caches
Denis V. Lunev [Mon, 11 May 2026 21:55:24 +0000 (23:55 +0200)] 
virStorageSource: note that capacity/allocation/physical are stale caches

These three fields are cached values that do not reflect reality unless
the caller refreshes them. 'allocation' is in addition ultra-unreliable:
any guest write into a previously unallocated part of a sparse image
invalidates it, even right after a refresh.

Document this on the struct so new callers do not trust the values.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
5 weeks agoAPI/qemu: add async unplug flag to virDomainSetVcpu
Akash Kulhalli via Devel [Wed, 29 Apr 2026 12:13:29 +0000 (17:43 +0530)] 
API/qemu: add async unplug flag to virDomainSetVcpu

Add VIR_DOMAIN_SETVCPU_ASYNC_UNPLUG for virDomainSetVcpu().

Define a dedicated virDomainSetVcpuBehaviour flag type and wire the
new flag through the QEMU driver. As with setvcpus async unplug,
success indicates request acceptance while final completion is
reported by the vcpu-removed event.

Update the API documentation and add virsh support for the async path to
the setvcpu subcommand.

Signed-off-by: Akash Kulhalli <akash.kulhalli@oracle.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
5 weeks agoAPI/qemu: add async unplug flag to virDomainSetVcpusFlags
Akash Kulhalli via Devel [Wed, 29 Apr 2026 12:13:28 +0000 (17:43 +0530)] 
API/qemu: add async unplug flag to virDomainSetVcpusFlags

Add VIR_DOMAIN_VCPU_ASYNC_UNPLUG for virDomainSetVcpusFlags().

With this flag, success indicates that QEMU accepted the unplug
request, while final completion is reported by the vcpu-removed
event. Rejected requests continue to be reported by the
device-removal-failed event.

Wire the flag through the QEMU driver, document its semantics, and
add virsh support for the async path in the setvcpus subcommand.

Signed-off-by: Akash Kulhalli <akash.kulhalli@oracle.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
5 weeks agoqemu: thread async vcpu unplug through internal helpers
Akash Kulhalli via Devel [Wed, 29 Apr 2026 12:13:27 +0000 (17:43 +0530)] 
qemu: thread async vcpu unplug through internal helpers

Thread an async_unplug flag through the internal QEMU vCPU unplug
helpers.

When set, the unplug path returns after QEMU accepts the device
deletion request and leaves final completion to the existing
DEVICE_DELETED handling routines.

All callers still pass false, so this does not change behaviour yet.

Signed-off-by: Akash Kulhalli <akash.kulhalli@oracle.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
5 weeks agoqemu: emit vcpu-removed event on unplug completion
Akash Kulhalli via Devel [Wed, 29 Apr 2026 12:13:26 +0000 (17:43 +0530)] 
qemu: emit vcpu-removed event on unplug completion

Emit the vcpu-removed event when QEMU vCPU unplug completes.

Hook this into qemuDomainRemoveVcpu(), which covers both the
synchronous completion path and the DEVICE_DELETED-driven alias
removal path.

Some architectures may have multiple vcpus grouped under a single qemu
vcpu object; on those platforms a `vcpu-removed` event will be emitted
for each vcpu that is removed from this group.

Signed-off-by: Akash Kulhalli <akash.kulhalli@oracle.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
5 weeks agoconf,remote: add vcpu-removed domain event
Akash Kulhalli via Devel [Wed, 29 Apr 2026 12:13:25 +0000 (17:43 +0530)] 
conf,remote: add vcpu-removed domain event

Add a new domain event for completed vCPU removal.

Wire the event through the internal event framework and extend the
remote protocol so remote clients can receive it. Update virsh and
the event-test example accordingly.

The event is not emitted anywhere yet.

Signed-off-by: Akash Kulhalli <akash.kulhalli@oracle.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
5 weeks agotest: qemu: Fix error message when populating fd groups
Peter Krempa [Thu, 7 May 2026 10:37:17 +0000 (12:37 +0200)] 
test: qemu: Fix error message when populating fd groups

The 'new->fds' array is not yet initialized at the point where the check
if the FD is occupied happens so the error would always report that FD
'0' is in use. Use 'new->testfds' instead.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
5 weeks agosyntax-check: Enforce no linebreaks in VIR_WARN messages
Peter Krempa [Mon, 11 May 2026 12:40:10 +0000 (14:40 +0200)] 
syntax-check: Enforce no linebreaks in VIR_WARN messages

Since VIR_WARN doesn't use translatable messages, the
'sc_prohibit_error_message_on_multiple_lines' check doesn't catch those.

Introduce another check for VIR_WARN.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
5 weeks agoDon't break up strings for VIR_WARN messages
Peter Krempa [Mon, 11 May 2026 12:40:24 +0000 (14:40 +0200)] 
Don't break up strings for VIR_WARN messages

The 'warn' level messages are logged in the default settings so may end
up in something which the user looks for. Random line breaks prevent
grepping for the message.

Similarly to 'error' level messages remove the arbitrary line breaks in
the source to make the messages greppable in the source.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
6 weeks agosync_qemu_models_i386: add new features for nested virtualization
Paolo Bonzini [Thu, 30 Apr 2026 13:08:38 +0000 (15:08 +0200)] 
sync_qemu_models_i386: add new features for nested virtualization

These features do not appear yet in the CPU models, but
will be added soon:

https://lore.kernel.org/qemu-devel/20260330193428.1663253-2-jon@nutanix.com/
https://lore.kernel.org/qemu-devel/20260330193428.1663253-4-jon@nutanix.com/

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
6 weeks agoqemu: capabilities: Bump minimum qemu to qemu-7.2
Michal Privoznik [Tue, 5 May 2026 12:06:59 +0000 (14:06 +0200)] 
qemu: capabilities: Bump minimum qemu to qemu-7.2

Following minimum versions are needed based on our support policy:

           Alpine Linux 3.23: 9.0
             CentOS Stream 9: 10.1
                   Debian 12: 7.2
                   Fedora 43: 10.1
          openSUSE Leap 15.6: 8.2
                Ubuntu 24.04: 8.2
               FreeBSD ports: 11.0
              macOS homebrew: 11.0
              macOS macports: 11.0

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
6 weeks agoqemucapabilitiesdata: domaincapsdata: Drop old capabilities
Michal Privoznik [Tue, 5 May 2026 12:30:43 +0000 (14:30 +0200)] 
qemucapabilitiesdata: domaincapsdata: Drop old capabilities

Soon the minimal version is going to be bumped to QEMU-7.2. Drop
older capabilities, which are unused anyways, thanks to previous
cleanups.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
6 weeks agoqemuxmlconftest: Switch sgx-epc to 11.0.0
Michal Privoznik [Tue, 5 May 2026 14:59:16 +0000 (16:59 +0200)] 
qemuxmlconftest: Switch sgx-epc to 11.0.0

The sgx-epc test case is currently pinned to capabilities of that
QEMU-7.0. Well, soon the minimal version of QEMU is going to be
bumped. But thanks to previous commit the capabilities of 11.0.0
version support SGX too. Switch the test case to the newer
capabilities.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
6 weeks agoqemucapabilitiesdata: Add SGX support to caps_11.0.0_x86_64
Michal Privoznik [Tue, 5 May 2026 14:08:59 +0000 (16:08 +0200)] 
qemucapabilitiesdata: Add SGX support to caps_11.0.0_x86_64

Detecting SGX support is done in two ways and both have to
succeed in order for caps to have the capability:

  1) the sgx-epc device needs to be present,
  2) the query-sgx-capabilities command needs to return data
     instead of an error.

So far, the only caps file that meets both requirements is
caps_7.0.0_x86_64. Soon the minimal version is going to be bumped
to QEMU-7.2. But caps_11.0.0_x86_64 has the device and the only
thing missing is the proper reply to the monitor command.
Therefore, create new qemu_11.0.0_x86_64+sgx capabilities with
reply to query-sgx-capabilities command copied from caps_7.0.0.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
6 weeks agoqemuxmlconftest: Drop ppc64-default-cpu-kvm-pseries-2.7 test cases
Michal Privoznik [Tue, 5 May 2026 13:44:07 +0000 (15:44 +0200)] 
qemuxmlconftest: Drop ppc64-default-cpu-kvm-pseries-2.7 test cases

Both ppc64-default-cpu-kvm-pseries-2.7 and
ppc64-default-cpu-tcg-pseries-2.7 test cases rely on pseries-2.7
machine type. It was removed in QEMU-7.2. Soon the minimal
version is going to be bumped to QEMU-7.2 rendering those tests
obsolete. Drop them.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
6 weeks agoqemuxmlconftest: Drop old cpu model expansion tests
Michal Privoznik [Tue, 5 May 2026 12:44:13 +0000 (14:44 +0200)] 
qemuxmlconftest: Drop old cpu model expansion tests

Soon the minimal version is going to be bumped to QEMU-7.2. Drop
older cpu model expansion test cases (6.2.0, 7.0.0, 7.1.0).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
6 weeks agoqemuxmlconftest: Drop disk-network-tlsx509-nbd-hostname test for 6.2.0
Michal Privoznik [Tue, 5 May 2026 12:34:53 +0000 (14:34 +0200)] 
qemuxmlconftest: Drop disk-network-tlsx509-nbd-hostname test for 6.2.0

Setting TLS hostname for NBD disks was introduced in QEMU-7.0.0.
Soon the minimal version is going to be bumped to QEMU-7.2. Drop
old test.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
6 weeks agoqemuxmlconftest: Drop machine-i8042-{on/off} tests for 6.2.0
Michal Privoznik [Tue, 5 May 2026 12:30:53 +0000 (14:30 +0200)] 
qemuxmlconftest: Drop machine-i8042-{on/off} tests for 6.2.0

Toggling PS/2 state is available from QEMU-7.0 onwards. Soon the
minimal version is going to be bumped to QEMU-7.2. Drop old
tests.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
6 weeks agoci: regenerate with 'lcitool manifest'
Michal Privoznik [Wed, 6 May 2026 07:47:18 +0000 (09:47 +0200)] 
ci: regenerate with 'lcitool manifest'

This picks up a fix of FreeBSD 15 image name.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
6 weeks agoqemuxmlconftest: Add new cpu host model expansions tests
Michal Privoznik [Tue, 5 May 2026 12:44:36 +0000 (14:44 +0200)] 
qemuxmlconftest: Add new cpu host model expansions tests

In qemuxmlconftest there's a section which aim on testing
'host-model' cpu mode expansion. Since this depends on what QEMU
reports (and thus can change with its version) we have a test
case for each QEMU version supported. Unfortunately, when adding
capabilities for new QEMUs this section was forgotten. Add
missing test cases (10.2.0 and 11.0.0).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
6 weeks agoci: regenerate with 'lcitool manifest'
Michal Privoznik [Tue, 5 May 2026 10:31:22 +0000 (12:31 +0200)] 
ci: regenerate with 'lcitool manifest'

Notable changes:
- Drop Fedora 42, add Fedora 44
- Drop Freebsd 13, add Freebsd 15
- Drop Ubuntu 22.04, add Ubuntu 26.04

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
6 weeks agotests: Add capabilities for QEMU 11.0.0 on s390x
Shalini Chellathurai Saroja [Mon, 4 May 2026 11:40:02 +0000 (13:40 +0200)] 
tests: Add capabilities for QEMU 11.0.0 on s390x

Introduce the qemu capabilities files for QEMU 11.0.0 on s390x.

Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
6 weeks agovirNetDevOpenvswitchInterfaceStats: Add 'ifname' to error messages
Peter Krempa [Tue, 28 Apr 2026 06:47:20 +0000 (08:47 +0200)] 
virNetDevOpenvswitchInterfaceStats: Add 'ifname' to error messages

Report the interface name which caused the error.

Resolves: https://redhat.atlassian.net/browse/RHEL-170993
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
6 weeks agovsh: cmdComplete: Don't exit when connecting to the daemon fails
Peter Krempa [Wed, 29 Apr 2026 10:22:35 +0000 (12:22 +0200)] 
vsh: cmdComplete: Don't exit when connecting to the daemon fails

Invoke the 'connHandler' without checking return value. 'virsh complete'
can provide useful completions even when the daemon connection is
broken.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 weeks agovsh: Suppress attempts to write to stderr when it was closed in 'cmdComplete'
Peter Krempa [Wed, 29 Apr 2026 10:15:34 +0000 (12:15 +0200)] 
vsh: Suppress attempts to write to stderr when it was closed in 'cmdComplete'

The completer closes stderr to suppress anything polluting the shell
when completion would cause any errors.

Since 'virshReconnect' would call 'vshError' on connection failure this
causes vshError to be killed by SIGPIPE and not provide any completions
if the connection is not possible.

To avoid this add a flag called 'stderr_closed' to vshControl and use it
to suppress output in 'vshPrintStderr'. Keep only the log.

Prior to this patch, attempt to run completion on a host with all
daemons shut down would result in:

 # virsh complete -- "start" "--doma" ; echo $?
 141
 #

With this patch the completion will still fail but the return code will
be 1. Further patch will allow completion.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 weeks agovirProcessGetStatInfo: Improve debug message
Peter Krempa [Wed, 29 Apr 2026 09:34:46 +0000 (11:34 +0200)] 
virProcessGetStatInfo: Improve debug message

Label the 'pid'/'tid' field. Use proper typecast also for 'tid'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 weeks agoqemuDomainGetStatsCpuProc: Don't fetch stats for inactive VMs
Peter Krempa [Wed, 29 Apr 2026 09:27:17 +0000 (11:27 +0200)] 
qemuDomainGetStatsCpuProc: Don't fetch stats for inactive VMs

CPU stats for inactive VM make no sense. In this case it's especially
misleading because 'vm->pid' of an inactive VM is '0' so
virProcessGetStat returns stats for virtqemud itself.

Fixes: 044b8744d65f8571038f85685b3c4b241162977b
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 weeks agodocs: bhyve: document virtio-console and blkiotune
Roman Bogorodskiy [Sat, 2 May 2026 11:42:18 +0000 (13:42 +0200)] 
docs: bhyve: document virtio-console and blkiotune

Add sections describing usage of the virtio-console device
and about block I/O tuning.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
6 weeks agoremote: install the secrets unit only for systemd
Roman Bogorodskiy [Sun, 3 May 2026 07:56:02 +0000 (09:56 +0200)] 
remote: install the secrets unit only for systemd

Install the secrets unit only when the init script is systemd.

Fixes: 2db552dc6ac17596720071fa91181055db7b82ee
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
6 weeks agovmx: Add support for NVRAM configuration
Surya Gupta via Devel [Fri, 24 Apr 2026 13:53:25 +0000 (19:23 +0530)] 
vmx: Add support for NVRAM configuration

Some VMware guests specify NVRAM storage using the 'nvram' parameter.
If found, parse it and store it in the domain's os.loader.nvram field,
which gets formatted as:

  <os>
    <type arch='x86_64'>hvm</type>
    <nvram>[datastore] directory/dokuwiki.nvram</nvram>
  </os>

The NVRAM path uses the same transformation functions as disk paths
(ctx->parseFileName and ctx->formatFileName) to ensure consistent
handling of datastore-qualified paths.
The NVRAM is stored as a virStorageSource with type VIR_STORAGE_TYPE_FILE
to ensure compatibility with libvirt's existing firmware handling
infrastructure.

Signed-off-by: Surya Gupta <surygupt@redhat.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
6 weeks agovmx: configure TPM device in the XML
Srihari Parimi via Devel [Thu, 23 Apr 2026 12:18:17 +0000 (17:48 +0530)] 
vmx: configure TPM device in the XML

Parses vtpm.present from VMX files and converts to libvirt TPM
device with CRB model and emulator backend. VMware vTPM uses
TPM 2.0 as specified in the document below

https://techdocs.broadcom.com/us/en/vmware-cis/vsphere/vsphere/8-0/vsphere-security/securing-virtual-machines-with-virtual-trusted-platform-module/vtpm-overview.html

implement support for formatting TPM devices in virVMXFormatConfig

Signed-off-by: Srihari Parimi <sparimi@redhat.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
6 weeks agovircgroup: Fix fallback implementation of 'virCgroupGetFreezerState'
Peter Krempa [Mon, 4 May 2026 09:34:25 +0000 (11:34 +0200)] 
vircgroup: Fix fallback implementation of 'virCgroupGetFreezerState'

Fix the implementation according to the change to the declaration.

Fixes: 289e69d95e6fc843499d15003365596fbfe3500a
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
6 weeks agovirt-host-validate: Suggest different resolution for 'devices' and non-root user
Michal Privoznik [Thu, 23 Apr 2026 13:49:43 +0000 (15:49 +0200)] 
virt-host-validate: Suggest different resolution for 'devices' and non-root user

Here's the deal: the 'devices' controller as such does not exist
in CGroupsV2. The alternative is to load eBPF program that mimics
the controller's behavior from CGroupsV1. But, only privileged
user can load such program. This means that virt-host-validate
(when ran as a regular user) claims 'devices' controller missing
(rightfully so), and suggests enabling it in Kconfig. This last
bit might be misleading to users [1].

Now, to fix this ideally, all three conditions should be checked
(CGroupsV2, 'devices' controller and regular user), but our
virCgroup module deliberately hides the version of CGroups. So
check for the other two conditions.

1: https://lists.libvirt.org/archives/list/users@lists.libvirt.org/thread/USDFFRJK74GYHRGMXOE2FSAA4PQD23RE/
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <pavel@hrdina.info>
6 weeks agovircgroupv2: Implement freezer controller
Michal Privoznik [Thu, 23 Apr 2026 10:05:59 +0000 (12:05 +0200)] 
vircgroupv2: Implement freezer controller

With CGroupsV2 the freezer controller is split into two files:

1) cgroup.freeze where an integer is written to thaw(0)/freeze(1)
   processes within the cgroup, and
2) cgroup.events where the frozen status can be read.

Now, freezing/thawing a cgroup is as simple as writing
corresponding integer into cgroup.freeze. But similarly to
CGroupsV1, it may take some time to actually freeze all processes
inside the cgroup. So read both file and map combination of their
values according to this table:

              | frozen from cgroup.events
cgroup.freeze |     0      |     1
--------------+------------+-------------
            0 |   THAWED   |    N/A
            --+------------+-------------
            1 |  FREEZING  |   FROZEN

Resolves: https://gitlab.com/libvirt/libvirt/-/work_items/870
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <pavel@hrdina.info>
6 weeks agovircgroupv2: Freezer controller is implicit
Michal Privoznik [Thu, 23 Apr 2026 10:05:44 +0000 (12:05 +0200)] 
vircgroupv2: Freezer controller is implicit

The freezer controller in CGroupsV2 is always present (under
cgroup.freeze file). Make our vircgroupv2 backend aware of it.

NB, because of the way our backends are ordered (v2 is prefered)
the v1 freezer is never going to be used when CGroupsV2 are
detected. Hence the change to tests.

NB2, this also fixes output of virt-host-validate which complains
that the 'freezer' controller is not present for LXC driver.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <pavel@hrdina.info>
6 weeks agosrc: Introduce virCgroupFreezerState enum
Michal Privoznik [Thu, 23 Apr 2026 10:43:53 +0000 (12:43 +0200)] 
src: Introduce virCgroupFreezerState enum

So far, only vircgroupv1 implements freezer controller related
callbacks and both work with strings ("THAWED", "FROZEN",
"FREEZING"). This works well with v1 but with CGroupsV2 there are
just two states and they are represented by a number.

Therefore, introduce an enum and implement enum <-> string
conversion for each backend separately.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <pavel@hrdina.info>
6 weeks agostorage: zfs: fix incorrect volsize,refreservation on zvol creation
George Melikov [Tue, 28 Apr 2026 14:40:56 +0000 (17:40 +0300)] 
storage: zfs: fix incorrect volsize,refreservation on zvol creation

Reproduce:
```bash
root@minime:~# virsh vol-list rpool
 Name                                   Path
----------------------------------------------------------------------------------------------------
 da52bdd9-eb75-5746-a2ce-a511067914f5   /dev/zvol/rpool/disks/da52bdd9-eb75-5746-a2ce-a511067914f5
 faafd0f9-33c8-5b23-990c-fa7b4bfe8dcf   /dev/zvol/rpool/disks/faafd0f9-33c8-5b23-990c-fa7b4bfe8dcf

root@minime:~# cat > /tmp/vol
<volume>
  <name>eeee</name>
  <capacity>4294967296</capacity>
  <allocation>4294967296</allocation>
</volume>

root@minime:~# virsh vol-create rpool /tmp/vol
Vol eeee created from /tmp/vol

root@minime:~# virsh vol-list rpool
 Name                                   Path
----------------------------------------------------------------------------------------------------
 da52bdd9-eb75-5746-a2ce-a511067914f5   /dev/zvol/rpool/disks/da52bdd9-eb75-5746-a2ce-a511067914f5
 eeee                                   /dev/zvol/rpool/disks/eeee
 faafd0f9-33c8-5b23-990c-fa7b4bfe8dcf   /dev/zvol/rpool/disks/faafd0f9-33c8-5b23-990c-fa7b4bfe8dcf

root@minime:~# virsh vol-info --pool rpool eeee
Name:           eeee
Type:           block
Capacity:       10.00 GiB
Allocation:     0.00 B

root@minime:~# virsh pool-refresh --pool rpool
Pool rpool refreshed

root@minime:~# virsh vol-info --pool rpool eeee
Name:           eeee
Type:           block
Capacity:       4.00 GiB
Allocation:     4.06 GiB
```

Fix is trivial: check zvol by name and return early if this is different
zvol.

Signed-off-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
6 weeks agobhyve: improve ISA controller validation error reporting
Roman Bogorodskiy [Tue, 21 Apr 2026 18:21:31 +0000 (20:21 +0200)] 
bhyve: improve ISA controller validation error reporting

Report error in case when incorrect index is specified for
the ISA controller.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
6 weeks agobhyve: add virtio-console support
Roman Bogorodskiy [Sat, 28 Mar 2026 13:36:21 +0000 (14:36 +0100)] 
bhyve: add virtio-console support

Bhyve supports virtio-console devices using the following syntax:

 -s 2:0,virtio-console,org.qemu.guest_agent.0=/path/to/unix/socket,other.port=/other/socket,...

There are two details about that to consider.

The first one is that only up to 16 ports per console is supported. This
is different from the default (31), so update the code to manually add
the virtio-serial controllers with 16 ports. For the existing
controllers, make sure to set max ports to 16 or error out if ports
count greater than 16 was specified.

The second one is that bhyve does not clean up UNIX sockets for these
devices. So update virBhyveProcessStop() to remove leftover sockets.

Not adding capabilities probing as the virtio-console device is
available on all supported FreeBSD versions and on all supported arches.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
6 weeks agobhyve: fix virBhyveProcessStop()
Roman Bogorodskiy [Thu, 23 Apr 2026 12:44:18 +0000 (14:44 +0200)] 
bhyve: fix virBhyveProcessStop()

Currently, there are two (at least) issues in virBhyveProcessStop().

Before going into details, a quick overview of the bhyve shutdown
process. It is a two stage process: first, the main bhyve
process gets destroyed (either via an external command or within the
guest), then the resources need to be cleaned up using the bhyvectl(8)
tool.

The first issue is that if virCommandRun() for bhyvectl(8) fails,
virBhyveProcessStop() jumps to the 'cleanup' label and misses cleaning
of some resources.

The second issue is more serious. Currently, monitor is closed only
after running of the bhyvectl(8) command. That means that the monitor
could catch the domain destroy event and try to run
virBhyveProcessStop() on the same domain again, resulting in trying
to release already released resources, such as the monitor itself.

Address by:

 * Making virCommandRun() on bhyvectl(8) non-critical. Even if it
   fails, we try to clean up all resources. We consider the function
   failed (return value 1) though.

 * Close monitor before running bhyvectl(8)

Additionally, do not verify that virBhyveProcessBuildDestroyCmd()
returns non-NULL, there could be only allocation errors.
And with 'glib' they result in an abort() so no need
to worry about those.

Reported-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
6 weeks agoPost-release version bump to 12.4.0
Jiri Denemark [Fri, 1 May 2026 22:06:30 +0000 (00:06 +0200)] 
Post-release version bump to 12.4.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
6 weeks agoRelease of libvirt-12.3.0 v12.3.0
Jiri Denemark [Fri, 1 May 2026 22:02:41 +0000 (00:02 +0200)] 
Release of libvirt-12.3.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
7 weeks agoNEWS: Mention apparmor fix, new memory stats and block resize improvement
Peter Krempa [Tue, 28 Apr 2026 09:49:49 +0000 (11:49 +0200)] 
NEWS: Mention apparmor fix, new memory stats and block resize improvement

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
7 weeks agoNEWS: multi pci root bus complex support v12.3.0-rc2
Bruno Martins [Wed, 29 Apr 2026 12:09:22 +0000 (12:09 +0000)] 
NEWS: multi pci root bus complex support

Signed-off-by: Bruno Martins <ehanoc@protonmail.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
7 weeks agoNEWS: Document features/improvements/bug fixes I've participated in
Michal Privoznik [Tue, 28 Apr 2026 12:49:29 +0000 (14:49 +0200)] 
NEWS: Document features/improvements/bug fixes I've participated in

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

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 weeks agoNEWS: document new bhyve features for 12.3.0
Roman Bogorodskiy [Sun, 26 Apr 2026 11:20:08 +0000 (13:20 +0200)] 
NEWS: document new bhyve features for 12.3.0

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
7 weeks agopo: Refresh potfile for v12.3.0 v12.3.0-rc1
Jiri Denemark [Fri, 24 Apr 2026 15:17:18 +0000 (17:17 +0200)] 
po: Refresh potfile for v12.3.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 weeks agoutil: Allow for PCI root buses not numbered "0"
Bruno Martins [Wed, 25 Feb 2026 10:35:37 +0000 (10:35 +0000)] 
util: Allow for PCI root buses not numbered "0"

virPCIDeviceReset() and virPCIDeviceIsBehindSwitchLackingACS() both
used a hardcoded check for bus != 0 to determine if a device is
attached directly to a "root bus". This breaks on systems with more
than one root bus, where at least one of the buses is necessarily
not 0! (for example Intel Arrow Lake based systems
where the CPU's root complex is bus 0x00 and the PCH root complex is
bus 0x80).

Update both functions to use virPCIDeviceIsOnRootBus(), which detects
root bus attachment via the canonicalized sysfs device link in
/sys/devices/*, making it work correctly for all root buses, not just
those numbered 0.

Discussion of the issue here:

https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread/NE62XCNHTWTFN4SFNTTSLI2W6BGGM64W/

Resolves: https://github.com/QubesOS/qubes-issues/issues/10393

Signed-off-by: Bruno Martins <ehanoc@protonmail.com>
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Bruno Martins <ehanoc@protonmail.com>
Tested-by: Bruno Martins <ehanoc@protonmail.com>
8 weeks agoqemu: fix potential hang in qemuMigrationSrcCancelUnattended during reconnect
Denis V. Lunev [Wed, 22 Apr 2026 09:34:27 +0000 (11:34 +0200)] 
qemu: fix potential hang in qemuMigrationSrcCancelUnattended during reconnect

When libvirtd reconnects to a running QEMU process that had an
in-progress migration, qemuProcessReconnect first connects the
monitor and only later recovers the migration job. During this window
the async job is VIR_ASYNC_JOB_NONE, so any MIGRATION status events
from QEMU are silently dropped by qemuProcessHandleMigrationStatus.

If the migration was already cancelled or completed by QEMU during
this window, no further events will be emitted. When
qemuMigrationSrcCancelUnattended later restores the async job and
calls qemuMigrationSrcCancel with wait=true, the wait loop calls
qemuDomainObjWait (virCondWait with no timeout) and blocks forever
waiting for an event that will never arrive.

qemuProcessRecoverMigration already queries QEMU for the current
migration state via qemuMigrationAnyRefreshStatus and passes the
result to qemuProcessRecoverMigrationOut as migStatus. Plumb that
value one level further into qemuMigrationSrcCancelUnattended and,
when it indicates the migration has already reached a terminal
state (VIR_DOMAIN_JOB_STATUS_CANCELED), skip restoring the async
job and the qemuMigrationSrcCancel/virDomainObjEndAsyncJob pair
entirely.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Suggested-by: Jiri Denemark <jdenemar@redhat.com>
CC: Peter Krempa <pkrempa@redhat.com>
CC: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
8 weeks agoqemucapabilitiestest: Update capabilities for release of qemu-11.0 on aarch64
Peter Krempa [Wed, 22 Apr 2026 15:05:16 +0000 (17:05 +0200)] 
qemucapabilitiestest: Update capabilities for release of qemu-11.0 on aarch64

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
8 weeks agoqemucapabilitiestest: Update capabilities for release of qemu-11.0 on x86_64
Peter Krempa [Tue, 24 Mar 2026 05:46:47 +0000 (06:46 +0100)] 
qemucapabilitiestest: Update capabilities for release of qemu-11.0 on x86_64

Notable changes since the last snapshot was taken:
 - 'http' block protocol 'force-range' property added
 - 'failing' status for migration (event/query) added
 - 'gmet' cpu feature added
 - cpu features name changes:
    - amx-bf16-mirror -> amx-bf16-alias
    - amx-complex-mirror -> amx-complex-alias
    - amx-fp16-mirror -> amx-fp16-alias
    - amx-int8-mirror -> amx-int8-alias
 - removed 'dma-drain' property of 'intel-iommu' device
 - removed 'disable-acs' property of 'pcie-root-port'
 - removed 'qemu-4-0-config-size' of 'virtio-balloon'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
8 weeks agovirsh: cmdNodeMemStats: Rework to vshTable
Peter Krempa [Fri, 17 Apr 2026 12:43:44 +0000 (14:43 +0200)] 
virsh: cmdNodeMemStats: Rework to vshTable

After recent addition of 'available' field the hardcoded alignments no
longer match:

  $ virsh nodememstats
  total  :             63393452 KiB
  free   :              4046756 KiB
  available:             35747628 KiB
  buffers:              2291748 KiB
  cached :             24086464 KiB

To address the issue switch to use dynamically aligned columns via
vshTable infrastructure:

  $ virsh nodememstats
  total    :   63393452 KiB
  free     :    3888776 KiB
  available:   35640268 KiB
  buffers  :    2291768 KiB
  cached   :   24089916 KiB

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
8 weeks agotests: vshtable: Excercise all flag combinations in vshTableRowAppendFlags
Peter Krempa [Fri, 17 Apr 2026 14:50:59 +0000 (16:50 +0200)] 
tests: vshtable: Excercise all flag combinations in vshTableRowAppendFlags

The new test case iterates over all combinations and tries the
formatting of the table with strings of 3 distinct lengths (1 char, 8
chars and maximum widht that fits in the column (8+3 characters)).

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
8 weeks agovsh-table: Add support for right-align and skipping the embedded whitespace
Peter Krempa [Fri, 17 Apr 2026 12:43:39 +0000 (14:43 +0200)] 
vsh-table: Add support for right-align and skipping the embedded whitespace

In certain cases the code might want to skip the forced spacing.

Introduce a concept of flags for each column and new function
'vshTableRowAppendFlags' which will do similar job as
'vshTableRowAppend' but add tuples of flags and the string itself.

This patch implements the following flags:

 VSH_TABLE_CELL_SKIP_LEADING - skips the single leading whitespace
 VSH_TABLE_CELL_SKIP_TRAILING - skips the trailing 2 whitespaces
 VSH_TABLE_CELL_ALIGN_RIGHT - moves the alignment to the right of the
                              column

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
8 weeks agovshTableGetColumnsWidths: Include spacing in lenght calculation
Peter Krempa [Fri, 17 Apr 2026 12:26:42 +0000 (14:26 +0200)] 
vshTableGetColumnsWidths: Include spacing in lenght calculation

Modify the array holding lengths of individual columns in the table to
include the spacing. This will be used later when we'll allow to modify
the spacing.

To do this we'll include the 3 extra spaces as lengths as well as fix
the two loops using the value to use it directly.

Since the spacing is not included in the string the code in
'vshTableRowPrint' is modified to explicitly add the spacing instead of
adding a constant to the calculated length.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
8 weeks agovsh-table: Refactor 'vshTableNew'
Peter Krempa [Fri, 17 Apr 2026 09:51:55 +0000 (11:51 +0200)] 
vsh-table: Refactor 'vshTableNew'

Use automatic memory freeing to remove 'error' label.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
8 weeks agovsh-table: Refactor 'vshTableRowAppend'
Peter Krempa [Fri, 17 Apr 2026 10:27:42 +0000 (12:27 +0200)] 
vsh-table: Refactor 'vshTableRowAppend'

Register cleanup function for vshTableRow and use it to simplify cleanup
in 'vshTableRowAppend'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
8 weeks agovsh-table: Refactor cleanup in 'vshTableRowNew'
Peter Krempa [Fri, 17 Apr 2026 09:49:43 +0000 (11:49 +0200)] 
vsh-table: Refactor cleanup in 'vshTableRowNew'

The 'error' label is not needed, we can directly return failure from the
only error.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
8 weeks agovirfile: safezero: handle posix_fallocate()'s EOPNOTSUPP
Roman Bogorodskiy [Mon, 20 Apr 2026 18:06:58 +0000 (20:06 +0200)] 
virfile: safezero: handle posix_fallocate()'s EOPNOTSUPP

FreeBSD 15.x updated posix_fallocate() to return EOPNOTSUPP
instead of EINVAL when the operation is not supported.
Quoting posix_fallocate(2):

     Previous versions of posix_fallocate used EINVAL to indicate that the
     operation is not supported by the file system, as specified in IEEE Std
     1003.1 (“POSIX.1”) Base Specifications, Issue 7.  IEEE Std 1003.1
     (“POSIX.1”) Base Specifications, Issue 8 switched to requiring EOPNOTSUPP
     for this error case.  ZFS adopted the latter convention in FreeBSD 15.0,
     and the remaining filesystems in base adopted it in FreeBSD 15.1.

Update safezero_posix_fallocate() to handle this return value
along with EINVAL to fix the waterfall down to safezero_slow()
for filesystems that do not support that.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
8 weeks agovmx: Generate correct disk target device ID for superwide SCSI
Martin Kletzander [Mon, 20 Apr 2026 19:45:59 +0000 (21:45 +0200)] 
vmx: Generate correct disk target device ID for superwide SCSI

Commit 32f7db0989e4 added support for superwide SCSI, but did not change
the disk ID calculation which resulted in a possible duplicate.  Change
it to calculate based on the (already decided) maximum of SCSI units per
bus and add a (well, modify existing) test case.

Fixes: 32f7db0989e4
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
8 weeks agovirarptable: add FreeBSD support
Roman Bogorodskiy [Sun, 12 Apr 2026 06:06:38 +0000 (08:06 +0200)] 
virarptable: add FreeBSD support

Add a FreeBSD implementation of the virArpTableGet() function.

Update the bhyve driver's bhyveDomainInterfaceAddresses()
to use it for the VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_ARP
source type.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
8 weeks agoTranslated using Weblate (English (United Kingdom))
Andi Chandler [Tue, 7 Apr 2026 23:15:44 +0000 (23:15 +0000)] 
Translated using Weblate (English (United Kingdom))

Currently translated at 48.1% (5285 of 10967 strings)

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

Signed-off-by: Andi Chandler <andi@gowling.com>
Translated using Weblate (English (United Kingdom))

Currently translated at 48.1% (5279 of 10967 strings)

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

Signed-off-by: Andi Chandler <andi@gowling.com>
Translated using Weblate (English (United Kingdom))

Currently translated at 48.0% (5270 of 10967 strings)

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

Signed-off-by: Andi Chandler <andi@gowling.com>
8 weeks agoTranslated using Weblate (Spanish)
Fco. Javier F. Serrador [Tue, 7 Apr 2026 23:15:43 +0000 (23:15 +0000)] 
Translated using Weblate (Spanish)

Currently translated at 94.1% (10324 of 10967 strings)

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

Signed-off-by: "Fco. Javier F. Serrador" <fserrador@gmail.com>
Translated using Weblate (Spanish)

Currently translated at 93.7% (10285 of 10967 strings)

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

Signed-off-by: "Fco. Javier F. Serrador" <fserrador@gmail.com>
8 weeks agovz: fix memory leak in prlsdkGetNetAddresses()
shivanayak [Sun, 8 Mar 2026 18:28:45 +0000 (23:58 +0530)] 
vz: fix memory leak in prlsdkGetNetAddresses()

prlsdkGetNetAddresses allocates addr via g_new0 on each loop iteration.
If PrlStrList_GetItem fails and jumps to cleanup, addr is leaked since
prlsdkParseNetAddress (which previously freed it) is never reached.

Fix by using g_autofree for addr in prlsdkGetNetAddresses so it is freed
at scope end, and remove the VIR_FREE(addr) from prlsdkParseNetAddress
to avoid double-free, as callers should manage their own memory.

Signed-off-by: Shiva Shankar <shivanayak@gmail.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
8 weeks agodocs: Drop mention of aes-256-cbc
Bruno Renié [Fri, 13 Mar 2026 11:26:57 +0000 (12:26 +0100)] 
docs: Drop mention of aes-256-cbc

This is most likely referring to past qemu-img behavior. Defaults are
not encoded in libvirt. `qemu-img` behavior is runtime-dependent, with a
current preference towards 'aes-256-xts'.

Signed-off-by: Bruno Renié <brutasse@gmail.com>
2 months agobhyve: add blkiotune support
Roman Bogorodskiy [Sun, 5 Apr 2026 09:23:59 +0000 (11:23 +0200)] 
bhyve: add blkiotune support

FreeBSD supports resource limiting with the rctl(4) framework.
It supports various resource types, including I/O resources.
It allows to limit resources for users, processes, login classes,
and jails.

To apply blkiotune limits set limits for the bhyve process.

I/O related resources supported by rctl(4) are:

  readbps            filesystem reads, in bytes per second
  writebps           filesystem writes, in bytes per second
  readiops           filesystem reads, in operations per second
  writeiops          filesystem writes, in operations per second

Thus, the actual commands look like:

rctl -a process:$bhyvepid:writebps:throttle=10000000
rctl -a process:$bhyvepid:readbps:throttle=10000000
rctl -a process:$bhyvepid:writeiops:throttle=20000
rctl -a process:$bhyvepid:readiops:throttle=20000

This is different from the current blkiotune modeling in libvirt as
it requires specific device to apply limits to. To adapt this model
to per-domain I/O limits, update domain schema to specify "*" as a
device name.

The rctl(8) may be not available or not enabled, so add a capability
check for that.

Per process rules get removed when the process disappears, so no special
clean up is necessary.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 months agosecret: Use UMask= in virt-secret-init-encryption.service
Jim Fehlig [Thu, 16 Apr 2026 21:51:51 +0000 (15:51 -0600)] 
secret: Use UMask= in virt-secret-init-encryption.service

Switch to using systemd's native UMask= directive, instead of using
umask directly in ExecStart=.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2 months agoAdd MemAvailable to node memory stats
Takashi Kajinami [Wed, 15 Apr 2026 17:17:56 +0000 (02:17 +0900)] 
Add MemAvailable to node memory stats

MemAvailable was introduced in kernel version 3.10 (and it was even
backported to older kernels in some distributions) and has been
a quite popular method to estimate the available method (totally fully
amount + reclaimable amount).

Signed-off-by: Takashi Kajinami <kajinamit@oss.nttdata.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 months agohyperv: Use 'size_t' for variable named 'i'
Peter Krempa [Thu, 16 Apr 2026 08:15:29 +0000 (10:15 +0200)] 
hyperv: Use 'size_t' for variable named 'i'

Per our syntax check iterator variables ought to be declared as
'size_t'.

Fixes: 9a82b2a92fc91e4a46bb7d77cfefe2b2d04a0b6e
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2 months agohyperv: Implement domainSnapshotCreateXML()
Jonathon Jongsma [Wed, 11 Feb 2026 22:23:30 +0000 (16:23 -0600)] 
hyperv: Implement domainSnapshotCreateXML()

The Hyper-V driver does not support specifying <memory> or <disks> in
the snapshot xml and rejects those configurations.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 months agohyperv: Add a utility function for getting method output params
Jonathon Jongsma [Wed, 11 Feb 2026 22:23:30 +0000 (16:23 -0600)] 
hyperv: Add a utility function for getting method output params

When invoking a method in WMI, it can either return synchronously or
asynchronously (with return value 4096). In the latter case, the output
parameters of the method are not present in the method response xml
document. We have to fetch the output parameters via associations with
the Job object that is returned in the method response.

the hypervInvokeMethod() function already partially handles the async
case by polling the job until it fails, completes successfully, or
times out. This patch adds a utility function to fetch a named output
parameter from a given method response xml document. It handles both
synchronous and asynchronous cases.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 months agohyperv: Implement domainSnapshotDelete()
Jonathon Jongsma [Wed, 11 Feb 2026 22:24:27 +0000 (16:24 -0600)] 
hyperv: Implement domainSnapshotDelete()

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 months agohyperv: Add snapshot related WMI class definitions
Jonathon Jongsma [Fri, 6 Mar 2026 18:20:07 +0000 (12:20 -0600)] 
hyperv: Add snapshot related WMI class definitions

Msvm_VirtualSystemSnapshotService and  Msvm_VirtualSystemSnapshotSettingData

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
2 months agoqemu: Add support for 'VIR_DOMAIN_BLOCK_RESIZE_CAPACITY' with qcow2 using the 'data...
Peter Krempa [Tue, 14 Apr 2026 12:55:42 +0000 (14:55 +0200)] 
qemu: Add support for 'VIR_DOMAIN_BLOCK_RESIZE_CAPACITY' with qcow2 using the 'data-file' feature

If a qcow2 image uses a 'data-file' on a local block device we can still
honour VIR_DOMAIN_BLOCK_RESIZE_CAPACITY but use the capacity of the
data-file instead.

The code is modified to first pick the virStorageSource which we'll
probe for size based on the config of the VM and uses to determine the
new size.

Resolves: https://redhat.atlassian.net/browse/RHEL-155809
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 months agovirsh: blockresize: Introduce '--extend' flag
Peter Krempa [Tue, 31 Mar 2026 14:11:40 +0000 (16:11 +0200)] 
virsh: blockresize: Introduce '--extend' flag

Use the new VIR_DOMAIN_BLOCK_RESIZE_EXTEND to prevent accidentally
shrinking a disk and thus destroying data.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 months agoAPI/qemu: Introduce 'VIR_DOMAIN_BLOCK_RESIZE_EXTEND' for 'virDomainBlockResize'
Peter Krempa [Thu, 26 Mar 2026 17:10:32 +0000 (18:10 +0100)] 
API/qemu: Introduce 'VIR_DOMAIN_BLOCK_RESIZE_EXTEND' for 'virDomainBlockResize'

Introduce a new flag VIR_DOMAIN_BLOCK_RESIZE_EXTEND which will prevent
accidental shrinking of the block device.

Warn callers that they ought to use it.

While this won't prevent any old uses without the flag (which we
couldn't change due to our API guarantees) it will give the users tools
to handle the resizing of devices more safely.

Implement it in the qemu driver.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 months agovirDomainBlockResizeFlags: Convert to prefix-style docs
Peter Krempa [Tue, 31 Mar 2026 14:24:21 +0000 (16:24 +0200)] 
virDomainBlockResizeFlags: Convert to prefix-style docs

Upcoming patches will want to add more extensive docs for one of the new
flags so this format will make it more readable.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 months agoconf: Reject blockio settings for "<disk device='lun'>"
Peter Krempa [Tue, 14 Apr 2026 11:59:01 +0000 (13:59 +0200)] 
conf: Reject blockio settings for "<disk device='lun'>"

Overriding the blockio settings for disk passthrough via
"<disk device='lun'>" doesn't make sense and in fact the 'scsi-block'
device in qemu doesn't even expose the appropriate properties:

  qemu-system-x86_64: -device {"driver":"scsi-block","bus":"scsi0.0","channel":0,"scsi-id":0,"lun":0,"drive":"libvirt-1-format","id":"scsi0-0-0-0","logical_block_size":512,"physical_block_size":512}: Property 'scsi-block.physical_block_size' not found

Reject those at validation.

Resolves: https://redhat.atlassian.net/browse/RHEL-145937
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 months agodocs: Change TD example policy to 0x10000000
Zhenzhong Duan [Wed, 15 Apr 2026 02:39:48 +0000 (22:39 -0400)] 
docs: Change TD example policy to 0x10000000

The definition of BIT0 in policy element comes from TDX spec, but it makes
confusion for some customers whether 0 or 1 activates debug:

  1. We know that "off-TD debug mode" basically means debug from outside the
     TD --> 1 activates debug.
  2. But when a customer is not aware of the term "off-TD debug" it is very
     easy to misinterpret this as "TD debug mode off" --> 1 deactivates debug.

Given that the policy example uses "0x10000001", the second interpretation
even becomes more likely, because a customer may assume that security by
default is applied in the example.

Thus, change the policy in example configuration to "0x10000000" and update
BIT0 definition to be more explicit.

Suggested-by: Fuhry Benny <benny.fuhry@intel.com>
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>