Currently, the bhyve driver reboot implementation
does not take into account domain's on_reboot action.
Update it so it shuts a domain down on reboot when it is
configured this way.
Additionally, introduce the bhyveDomainShutdownSignal() helper
which shares a common shutdown and reboot implementation
using a signal.
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Currently, the bhyve driver shutdown implementation
does not take into account domain's on_poweroff action.
Update it so it reboots a domain on shutdown when it is
configured this way.
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Peter Krempa [Mon, 25 May 2026 15:15:31 +0000 (17:15 +0200)]
testutils: Turn 'virTestDummyFDContext' into a proper type
'virTestDummyFDContext' was a copy of GHashTable to be able to register
a cleanup function. Upcoming patches will want to track more data
together with the hash table so turn virTestDummyFDContext into a proper
struct which contains the hash table.
Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Peter Krempa [Thu, 21 May 2026 15:06:32 +0000 (17:06 +0200)]
Avoid use of glib's G_REGEX_OPTIMIZE flag
glib's G_REGEX_OPTIMIZE invokes pcre's JIT optimizer which requires
writable executable memory. On hosts with SELinux this by default caused
AVC denials to be logged. The solution in Fedora's SELinux policy was
to allow execmem for e.g. virtqemud, but e.g. virtlogd or
libvirt_leaseshelper on the other hand got a 'dontaudit' rule.
Now the optimizer itself does have a substantial effect; I've measured
around 3x speedup when matching VIR_LOG_REGEX against a sample of a qemu
VM log file. On the other hand, only 3 out of 10 uses of 'g_regex_new'
used the flag and also none of the regexes which used 'G_REGEX_OPTIMIZE'
are on a hot path:
- virDomainQemuMonitorEventStateRegisterID
Used only when custom qemu monitor event callback is registered,
which resides in libvirt_qemu.so so noone will actually use this
in production.
- virCommandRunRegex
Used in:
- virStorageBackendFileSystemNetFindNFSPoolSources
Invoked only via API on output of 'showmount'. Unlikely to ever
see lots of data.
Both of the above are used on code paths processing log output
when failure to startup a VM process or one of the helper
processes for devices for a qemu domain. Thus they are not invoked
on success and the processed buffer is capped to 1k of data.
Since none of the above are on anything resembling a hot path and thus
likely to substantially benefit from the optimizer, and we do have
plenty of other uses without optimization, drop the optimizations
everywhere and add a note to sc_G_REGEX_OPTIMIZE that we're currently
avoiding the use of this flag.
Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
Peter Krempa [Mon, 25 May 2026 08:14:25 +0000 (10:14 +0200)]
syntax-check: Add warning about implications of G_REGEX_OPTIMIZE
glib's G_REGEX_OPTIMIZE flag for regex operations implies the use of
pcre's JIT optimizer for regexes which requires writable executable
memory for the optimized code.
Security frameworks such as SELinux can restrict program's access to
writable executable memory to harden the code.
glib's implementation of the regex functions handles downgrade to
interpreted evaluation of regexes gracefully if writable executable
memory is unavailable, but that is non-obvious and has a performance
penalty.
Add a syntax check which requires all uses of G_REGEX_OPTIMIZE to be
annotated so that the reader of the code can be hinted to why
G_REGEX_OPTIMIZE should perhaps be avoided.
Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
Fima Shevrin [Fri, 22 May 2026 15:49:27 +0000 (15:49 +0000)]
qemu: validate: treat only real backing chains as NVRAM backingStore
qemuDomainInitializePflashStorageSource() always attaches a non-NULL
src->backingStore used as an empty virStorageSource chain terminator
(type VIR_STORAGE_TYPE_NONE). qemuValidateDomainDefNvram() incorrectly
interpreted every non-NULL backingStore as a genuine backing overlay and
reported VIR_ERR_CONFIG_UNSUPPORTED, so legitimate UEFI/NVRAM setups were
rejected.
Use 'virStorageSourceHasBacking' helper as the check.
Fixes: d57630c282ae7220d8998f74b7e4fec21841797f Signed-off-by: Fima Shevrin <efim.shevrin@virtuozzo.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Akash Kulhalli [Wed, 20 May 2026 11:19:38 +0000 (16:49 +0530)]
virsh: allow async vcpu options to reach drivers
Do not reject setvcpu --enable --async or setvcpus --guest --async in virsh.
For setvcpu, async only affects live unplug and is documented as having no
effect when enabling vCPUs. For setvcpus, guest+async is a driver-visible flag
combination; drivers should decide whether they can support it. Keep virsh
validation limited to API-level constraints and let drivers report unsupported
combinations.
Signed-off-by: Akash Kulhalli <akash.kulhalli@oracle.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Akash Kulhalli [Wed, 20 May 2026 11:19:37 +0000 (16:49 +0530)]
domain: use vcpu-specific flag aliases consistently
The vCPU APIs have API-specific flag enums that alias the generic
VIR_DOMAIN_AFFECT_* values for live and config state.
Use the vCPU-specific aliases in the public API checks, QEMU driver flag masks,
and virsh flag construction. The values are unchanged; this is only a
consistency cleanup.
Signed-off-by: Akash Kulhalli <akash.kulhalli@oracle.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
virpci: don't fail VFIO passthrough when /sys/module/*/drivers is inaccessible
On monolythic kernel /sys/modules/*/drivers may not exist (ENOENT)
On kernels with enhanced security (e.g. grsecurity), it might not be
accessible: EACCESS or EPERM.
Directly try to open if it fails with any of those errors, we fallback
on the module name.
Signed-off-by: Baptiste Daroussin <baptiste.daroussin@ovhcloud.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
virpci: don't fail VFIO passthrough when modules.alias is missing
When modules.alias is not available (e.g. monolithic kernel),
virPCIDeviceFindBestVFIOVariant() would fail, causing the entire
PCI device detach to abort.
Instead, log a warning and return success with no variant found,
allowing the caller to fall back to the generic vfio-pci driver.
Signed-off-by: Baptiste Daroussin <baptiste.daroussin@ovhcloud.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
PUSHKARAJ PATIL [Fri, 1 May 2026 16:08:12 +0000 (21:38 +0530)]
virt-aa-helper: Prevent spurious denials for AoE disks
virt-aa-helper calls virStorageSourceGetMetadata before adding a disk
path to a domain's apparmor profile. This probes the device and may
trigger an AppArmor denial when the disk is an AoE device under
/dev/etherd/.
The return value of virStorageSourceGetMetadata is not checked, so the
denial has no functional impact but results in noisy dmesg logs.
Explicitly deny read access to /dev/etherd/e*.* in the virt-aa-helper profile to
avoid these spurious denials.
Co-Authored-By: Peter Krempa <pkrempa@redhat.com> Signed-off-by: PUSHKARAJ PATIL <pushkaraj.patil@in.ibm.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Currently, bhyveDomainQemuAgentCommand() uses
bhyveDomainAgentAvailable()
which works only if the agent was already initialized.
It should use bhyveDomainEnsureAgent() instead.
Also, remove the bhyveDomainAgentAvailable() function,
there are no cases when it should be used instead of
bhyveDomainEnsureAgent().
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Currently, bhyveDomainEnsureAgent() returns successfully (with 0 return
value) even in cases when the agent is not configured.
That happens because the bhyveConnectAgent() function does not fail
if it cannot find the agent configuration. This might result in
accessing the agent pointer at NULL.
Fix by making bhyveConnectAgent() failing if the agent is not
configured.
Additionally, only call bhyveFindAgentConfig() when the agent is
not configured to avoid unnecessary checks every time the agent is
needed.
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Denis V. Lunev [Thu, 28 May 2026 19:36:53 +0000 (21:36 +0200)]
qemu: Inherit SCSI controller model from existing peers
virDomainDefMaybeAddHostdevSCSIcontroller() already inherits the
model of an existing SCSI controller when auto-adding peers driven
by a hostdev whose drive address overflows the highest declared
idx. virDomainDefAddDiskControllersForType(), called for the
disk-driven analogue, does not -- it passes model=-1 unconditionally.
The unspecified peers then arrive at qemuDomainDefaultSCSIControllerModel()
and pick up whichever model the capability cascade settles on
(typically lsilogic). A user-declared virtio-scsi controller at
idx 0 ends up alongside auto-added lsilogic peers at idx 1+.
Plug the same inheritance into qemuDomainDefaultSCSIControllerModel()
itself so it covers both the disk-driven path and any other caller
that arrives with an unresolved model. The function already prefers
architectural defaults (PSeries, ARM virt, RISC-V virt, LoongArch,
s390, built-in ESP) over capabilities; peer inheritance slots in
just before the capability cascade. A virtio-scsi domain keeps the
new peers as virtio-scsi; an lsisas1068 domain stays lsisas1068; a
fresh domain with no SCSI controllers still gets the cap-driven
default. controller-scsi-auto, the only existing test that flows
through this helper, is unaffected (it has no peers to inherit
from). controller-scsi-inherit-model covers the new behavior.
Signed-off-by: Denis V. Lunev <den@openvz.org> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Add virURICheckExtCommand() in a similar fashion to the existing
virURICheckUnixSocket() and use it for (1) the same host migration check
and (2) in remoteConnectOpen().
This allows to migrate VMs using the ext transport, as the external
command can act as a proxy to the remote libvirt.
Signed-off-by: Sergey Dyasli <sergey.dyasli@nutanix.com> Signed-off-by: Mark Cave-Ayland <mark.caveayland@nutanix.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Allow passing arguments to the ext program via the query parameters. The
name of each argument is "argv" and it can be repeated multiple times to
pass several arguments.
Suggested-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Sergey Dyasli <sergey.dyasli@nutanix.com> Signed-off-by: Mark Cave-Ayland <mark.caveayland@nutanix.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
The aim of domaincapstest is to check domain capabilities XML
with respect to qemu capabilities. And we used to have old qemu
capabilities where only TPM-1.2 was supported. But as of
v12.4.0-rc1~130 QEMU-7.2 or newer is required which means the
code that's handling older QEMUs is required no more. Drop it.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
where the optional interfacename can be either the MAC address of the
interface to announce, or the name of the tap device used to connect
the domain's interface to the real network (if the connection is with
a tap device), and [parameters] is one or more of the following options:
Laine Stump [Mon, 18 May 2026 02:42:03 +0000 (22:42 -0400)]
qemu: implement virDomainAnnounceInterface() API
using qemuMonitorAnnounceSelf(). Note that the other public domain
interface APIs expect interface to be specified by either its "target"
name (i.e. the name of the tap/macvtap device on the host) or by the
MAC address, but qemuMonitorAnnounceSelf() expects the QEMU "device
id" (which is known in libvirt as the "alias"), so we have to convert.
Resolves: https://redhat.atlassian.net/browse/RHEL-7047 Signed-off-by: Laine Stump <laine@redhat.com> Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Laine Stump [Wed, 6 May 2026 20:46:24 +0000 (16:46 -0400)]
API: Introduce virDomainAnnounceInterface()
This API provides a way for a libvirt client to force a guest to
inject a "Gratuitous ARP" packet into the outgoing stream of one, or
all, network devices of the guest; this will be used to update the
forwarding tables of any network switches in the local broadcast
domain so that they will begin forwarding traffic correctly in a more
timely manner after network topology changes.
Signed-off-by: Laine Stump <laine@redhat.com> Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Laine Stump [Sun, 3 May 2026 04:54:08 +0000 (00:54 -0400)]
qemu: new monitor function qemuMonitorAnnounceSelf()
This new function sends the command "announce-self" to QEMU, causing
it to inject a series of gratuitous ARP (GARP) response packets into
the output stream of one or all guest interfaces, which will force any
switches in the same collision domain to update their forwarding db
for that interface's MAC address.
There are several parameters that control which interfaces the GARP
packets are sent on, as well as their number and interval, but all of
these parameters have sane defaults (even though QEMU's own
self-announce requires they all be specified in the QMP command).
Here is an example of the fully formed JSON for an announce-self:
All parameters except "interface" are unsigned integers that are
mandatory in the JSON command sent to QEMU. libvirt's
qemuMonitoAnnounceSelf() function, however, makes them optional by
replacing anything set to 0 with the same default value used
internally by QEMU when it is executing announce-self for a guest at
the end of a migration (initial=50, max=550, rounds-5, step=50).
"interfaces" (the only optional parameter from QEMU's point of view)
is (again, from QEMU's PoV) a *list* of the QEMU device-ids for the
interfaces to announce (if it's missing then announce-self injects
announcements on *all* of this guest's interfaces), but it seems much
more likely that someone will either want to announce a single
interface, or all of them, so to simplify calling in the more common
cases, our function just accepts a *single* device name (that can be
NULL) and creates a JSON array containing that one interface name (in
the rare case that someone wants to announce multiple interfaces but
not all of them, they can call our API multiple times).
Signed-off-by: Laine Stump <laine@redhat.com> Reviewed-by: Martin Kletzander <mkletzan@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Add xml2argv tests verifying the standalone VNC feature:
- graphics-vnc-standalone: when both <graphics type='dbus'/> and
<graphics type='vnc'/> are present, the -vnc QEMU argument is
omitted since qemu-vnc handles VNC externally via D-Bus.
- graphics-vnc-standalone-socket: same behavior with a Unix socket
listen address.
- graphics-vnc-standalone-p2p: when dbus is p2p mode, standalone
VNC is NOT triggered and the built-in -vnc argument is preserved.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Route the OpenGraphics, OpenGraphicsFD, and GraphicsReload driver
APIs through the standalone qemu-vnc D-Bus interface when active.
Client connections are passed via D-Bus fd-passing (AddClient),
certificate reloading uses the ReloadCertificates method, and
password changes use SetPassword.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
qemu: integrate standalone VNC in domain lifecycle
When both a D-Bus display and a VNC graphics device are configured
and the qemu-vnc binary is available, use the standalone VNC server
instead of QEMU's built-in VNC.
During domain preparation, detect whether the standalone VNC path
applies and allocate the qemuVnc context. Skip the built-in -vnc
command line argument when standalone VNC is active. Start and stop
the qemu-vnc process through the external device hooks.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Add helpers to manage the standalone qemu-vnc VNC server process.
The qemu-vnc server connects to QEMU via the D-Bus display interface,
providing VNC access decoupled from the QEMU process.
The helper handles process lifecycle (start/stop), D-Bus name
watching, and provides D-Bus methods for password management,
certificate reloading, and client connections.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Jonathon Jongsma [Thu, 26 Mar 2026 19:01:24 +0000 (14:01 -0500)]
hyperv: report nested virtualization setting in domain XML
When Hyper-V is configured to expose virtualization extensions to a
guest, report this in the domain XML by adding the vendor-appropriate
CPU feature flag:
This requires adding ExposeVirtualizationExtensions and several other
fields introduced in Windows 10 to the Msvm_ProcessorSettingData WMI
class definition.
Jonathon Jongsma [Thu, 26 Mar 2026 15:36:37 +0000 (10:36 -0500)]
hyperv: fix error handling of hypervGetProcessorsByName()
We were checking the output pointer for NULL rather than checking the
dereferenced value for NULL. So the case where no processors were
returned would not have returned an error as expected.
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
- machine types for the 11.1.0 release added
- (auto) deprecated 8.1 machine type
- 'poll-weight' property added for 'iothread' object
- 'clipboard' property added for 'gtk' display backend
- 'vhost-user-rtc' device added
- new CPU models/versions
- Cascadelake-Server-v6-x86_64-cpu
- Cascadelake-Server-v7-x86_64-cpu
- ClearwaterForest-v4-x86_64-cpu
- DiamondRapids-v2-x86_64-cpu
- EPYC-Genoa-v3-x86_64-cpu
- EPYC-Milan-v4-x86_64-cpu
- EPYC-Turin-v2-x86_64-cpu
- GraniteRapids-v6-x86_64-cpu
- GraniteRapids-v7-x86_64-cpu
- Icelake-Server-v8-x86_64-cpu
- Icelake-Server-v9-x86_64-cpu
- SapphireRapids-v7-x86_64-cpu
- SapphireRapids-v8-x86_64-cpu
- SierraForest-v6-x86_64-cpu
- Skylake-Server-v6-x86_64-cpu
- 'query-kvm' command is now deprecated
- removed 'gluster' blockdev backend
- 'blkdebug' blockdev backend allows injecting delays
- chardev backends support 'encoding' property
- 'remaining' amount reported in 'query-migrate'
- 'target-info-x86_64' QOM type added
- 'x-rdma-chunk-size' migration parameter added
The few changed '.args' files update the machine type to the actual
version because they were frozen before we've added a newer capability
dump (latest machine type is masked to stabilize test outputs).
Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Peter Krempa [Tue, 2 Jun 2026 12:55:14 +0000 (14:55 +0200)]
qemublocktest: Skip schema validation on 'gluster' backend tests
qemu-11.1 will drop support for the 'gluster' block backend driver. We
want to keep the tests around to validate that nothing in the
parser/generator has changed but there's no point in wiring up QMP
schema validation against older versions.
Skip the schema validation for gluster qemublocktests.
Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Jiri Denemark [Mon, 25 May 2026 12:31:07 +0000 (14:31 +0200)]
qemu_capabilities: Fix domain capabilities on AMD CPUs
The arch-capabilities MSR is not defined on AMD CPUs, but KVM has always
been emulating them. Unfortunately, this may cause Windows to crash so
QEMU (since 10.1, commit d3a24134e37d57abd3e7445842cda2717f49e96d)
decided to mask the MSR by default with some additional compatibility
code for older machine types.
This is all mostly transparent except for probing when we run QEMU
without a machine type and expand the "host" CPU model. With QEMU 10.1
and newer none of the arch-capabilities features will be shown as
enabled, which may cause unexpected issues for users (such as KubeVirt)
that get the list of all supported features from the host-model CPU
definition in domain capabilities to select possible target nodes for
migration. As a result of the change, no AMD host with new QEMU will be
shown as available for incoming migration from older hosts.
Since the features are supported on the host (it's possible to
explicitly enable them), but they should not be enabled by default in
host-model CPU, we only add the to domain capabilities when
VIR_CONNECT_GET_DOMAIN_CAPABILITIES_SUPPORTED_CPU_FEATURES flag is set.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Jiri Denemark [Fri, 29 May 2026 10:52:39 +0000 (12:52 +0200)]
Introduce VIR_CONNECT_GET_DOMAIN_CAPABILITIES_SUPPORTED_CPU_FEATURES flag
Some CPU features may be enabled explicitly, but should not
automatically become part of a host-model CPU. Users can now request
such features to be shown in the host-model CPU in domain capabilities
by VIR_CONNECT_GET_DOMAIN_CAPABILITIES_SUPPORTED_CPU_FEATURES flag.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Jiri Denemark [Tue, 26 May 2026 13:38:59 +0000 (15:38 +0200)]
Fix documentation of VIR_CONNECT_GET_DOMAIN_CAPABILITIES_EXPAND_CPU_FEATURES
The flag is designed for expanding the CPU model used by host-model. But
the documentation was sometimes describing it as showing all CPU
features supported on the host, which is wrong as the host may support
features that would not be enabled in host-model.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Jiri Denemark [Thu, 21 May 2026 15:55:28 +0000 (17:55 +0200)]
qemu_capabilities: Cache expanded CPU
When probing host model CPU we already expand it to get a list of all
CPU features. Let's store the expanded CPU definition in virQEMUCaps and
copy it to domain capabilities when requested by the
VIR_CONNECT_GET_DOMAIN_CAPABILITIES_EXPAND_CPU_FEATURES flag instead of
expanding the CPU over and over on each request.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Jiri Denemark [Fri, 29 May 2026 12:19:30 +0000 (14:19 +0200)]
qemu_capabilities: Always sort features in host-model CPU
Expanding a CPU model always produces a sorted list of features so the
features in host-model CPU capabilities were either sorted or not
depending on flags passed to virConnectGetDomainCapabilities.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Michal Privoznik [Thu, 28 May 2026 10:02:36 +0000 (12:02 +0200)]
ci: regenerate with 'lcitool manifest'
This drops Debian 12 and introduces Debian 13, since Debian 12
reached its EOL on 2026-06-10 [1]. However, Debian 13 dropped
official support for mipsel and mips64el, but introduced riscv64
support. Reflect this changes in supported arches in the manifest
file and regenerate with the latest lcitool.
1: https://www.debian.org/releases/ Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Daniel Hora [Thu, 28 May 2026 13:28:26 +0000 (15:28 +0200)]
examples: Improved shell output of showDomains
Improved formatting of the shell output of the
function showDomains based on length of the longest domain.
Signed-off-by: Daniel Hora <dhora@redhat.com> Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
The virDomainFSInfoFormat() and qemuAgentFSInfoToPublic() function
implementations are not driver dependent and can be shared across
drivers, so move them to a common place to avoid code duplication.
Also, rename virDomainFSInfoFormat() to qemuAgentFSInfoFormat() to follow
the naming scheme in qemu_agent.c.
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
bhyve: support getting interface addresses from agent
Extend bhyveDomainInterfaceAddresses() to support
the VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_AGENT source.
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Move all the helpers to the beginning for the file to
be able to use them in every API implementation.
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
docs: drvbhyve: reorganize sections about resource limits
Sections about resource limits are currently placed across the file
in between various device examples. To make it easier to follow,
group them into a single section. This also allows to give
an introduction on the rctl(8) framework once instead of repeating
it for every resource type.
Also, document the memory limitation support added in libvirt 12.4.0.
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Michal Privoznik [Thu, 28 May 2026 12:31:56 +0000 (14:31 +0200)]
qemu_nbdkit: Fix format when printing time_t values
The time_t type can be 32bit or 64bit signed integer. There are
systems where it's defined as long, or long long (32bit systems
usually). Therefore, using just 'l' length modifier is not good
enough. Also, using 'u' conversion specifier is also wrong
(though, values stored in qemuNbdkitCaps struct reflect mtime of
some files, so there won't be a negative value).
Anyway, do what we already do for virQEMUCaps - use '%lld' printf
format and typecast to long long.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Michal Privoznik [Tue, 26 May 2026 13:18:52 +0000 (15:18 +0200)]
tests: Link qemuxml2argvmock with test_utils_lib
When running qemuxmlconftest under valgrind, it fails with a
symbol lookup error:
valgrind: symbol lookup error: libvirt.git/_build/tests/libqemuxml2argvmock.so: undefined symbol: virTestMakeDummyFD
This occurs because qemuxml2argvmock uses the
virTestMakeDummyFD() function (implemented in testutils.c) but
does not explicitly link against test_utils_lib. Fix this by
linking the test utils library to the mock library, statically.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Denis V. Lunev [Wed, 20 May 2026 16:47:44 +0000 (18:47 +0200)]
mailmap: Map 'via Devel' mailing-list From-munged authors to real identities
The devel@lists.libvirt.org mailing list rewrites the From: header
for DMARC reasons, so patches submitted via the list land in git as
'<Real Name> via Devel <devel@lists.libvirt.org>'. This currently
affects 30 commits across 13 distinct contributors, all of whom are
identifiable by their Signed-off-by trailer.
Add mailmap entries that remap each mangled identity back to the
author's real name and address, matching the approach used by the
Linux kernel for the same problem.
Beyond cosmetic cleanup, this keeps contribution statistics
(git shortlog, contributor graphs) accurate and ensures contributors
get proper credit for their work, which is valuable when they look
for new positions or otherwise need a verifiable record of upstream
activity.
This approach is standard for such situations in Linux kernel. I have
seen this several times.
Signed-off-by: Denis V. Lunev <den@openvz.org> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Peter Krempa [Tue, 19 May 2026 16:06:31 +0000 (18:06 +0200)]
qemuxml2argvmock: Use real FDs for interface tests
Similarly to previous commits use real FDs so that we don't risk
collisions.
Note that for the test cases passing multiple tap and vhost FDs the
helpers which stabilize the output don't actually work, as the FDs are
concatenated. For now we'll not deal with this and simply leave them
censored by the 'XXXXXXX' string.
Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Peter Krempa [Wed, 20 May 2026 11:59:12 +0000 (13:59 +0200)]
qemuxmlconftest: Use virTestMakeDummyFD() to get VDPA disk fds
While VDPA disks did use real FDs they used convoluted infrastructure
for mapping them to specific numbers. Remove that since we can now mask
them from the output args instead.
Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Peter Krempa [Fri, 15 May 2026 16:53:41 +0000 (18:53 +0200)]
qemumonitorjsontest: Stabilize FD names in '-chardev'
Use 'testCompareXMLToArgvStabilizeOne' to censor FD values in '-chardev'
commands for stable test outputs without the need for fake FDs.
For monitor sockets this also creates a hint '@mon-fd@' to be used as
substitution to prevent any further churn on basically every .args file.
The substitution is done by temporarily using another fake FD (1764)
instead of 1729 so that it's unique.
Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Peter Krempa [Wed, 13 May 2026 13:31:30 +0000 (15:31 +0200)]
qemuxmlconftest: Stablilize '-add-fd' arguments
Add code which walks the generated argument list and allows to strip out
and replace by a substitution any field in either JSON or legacy qemu
argument string.
Use it to stabilize 'fd' field of '-add-fd'
This will allow us to rip out code which tries to allocate stable FD
numbers, which doesn't work reliably (e.g. if the environment passes
some FDs).
Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Peter Krempa [Wed, 20 May 2026 15:28:41 +0000 (17:28 +0200)]
qemuxmlconftest: Move mock'd FDs further out
Upcoming patches will introduce use of real FDs for tests. Since the
test will go through many FDs they will collide with the fake ones
allocated randomly in qemuxml2argvmock.
Move them out for now until they are replaced and masked out from the
tests.
Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Peter Krempa [Wed, 13 May 2026 14:51:58 +0000 (16:51 +0200)]
testutils: Introduce virTestMakeDummyFD
The helper makes a dummy (file) FD to be used as FD in tests which want
to handle a FD but don't really use it. It also optionally records the
FD number along with a hint in a hash table which can be later
used to fetch the hint and stabilize test outputs.
Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Add a helper which replaces the value part of a JSON object key. This
will be helpful in tests where we'll want to rewrite some outputs (e.g.
fds) to stabilize output files.
Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Peter Krempa [Wed, 13 May 2026 12:59:50 +0000 (14:59 +0200)]
util: vircommand: Add direct accessor for 'args' array for tests
Introduce virCommandArgListAccess which returns 'args' and 'nargs'
Upcoming patches will add code which censores/stabilizes FD numbers in
test outputs. This will be done by rewriting the argument of the command
before comparing it with test output. Add a test-only function to
directly access 'args' and 'nargs' of a virCommand to do this
modification.
This accessor will also be used instead of 'virCommandGetArgList' in
'testCompareXMLToArgvValidateSchema' to avoid needles copy of all
arguments.
Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>