54106 Commits
Author SHA1 Message Date
Jiri Denemark eb0b2e768d Release of libvirt-12.4.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
v12.4.0
2026-06-01 12:21:48 +02:00
Roman Bogorodskiy 4097950b75 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>
v12.4.0-rc2
2026-05-28 18:36:03 +02:00
Roman Bogorodskiy 85c7a3b001 NEWS: document bhyve changes for 12.4.0
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-28 17:45:45 +02:00
Michal Privoznik 648c59735a 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>
2026-05-28 15:21:30 +02:00
Michal Privoznik 6dfb398620 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: Ján Tomko <jtomko@redhat.com>
2026-05-28 10:19:54 +02:00
Michal Privoznik 99276efe0c 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>
2026-05-27 15:24:22 +02:00
Denis V. Lunev 103fa13ddb 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>
2026-05-27 09:55:44 +02:00
Jiri Denemark 200deed341 po: Refresh potfile for v12.4.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
v12.4.0-rc1
2026-05-25 22:51:15 +02:00
Peter Krempa 06a4f5721f qemuxmlconftest: Use real FD for iommufd object in tests
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-25 13:28:59 +02:00
Peter Krempa 8afb7fe0e7 qemuxmlconftest: Use real FDs for hostdev tests
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-25 13:28:59 +02:00
Peter Krempa eaecd2ca07 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>
2026-05-25 13:28:59 +02:00
Peter Krempa a854a3cb84 qemuxmlconftest: Use real FDS for testing of 'vsock'
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-25 13:28:58 +02:00
Peter Krempa 1b13c5c791 testutilsqemu: Remove unused 'ARG_VDPA_FD' test argument
The code was refactored to allow any FD numbers so the code to map them
to specific numbers is no longer needed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-25 13:28:58 +02:00
Peter Krempa f7f2bf2aa0 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>
2026-05-25 13:28:58 +02:00
Peter Krempa b28c8cbbb8 qemuxmlconftest: (consistently) use real FDs in tests for VDPA netdevs
Use virTestMakeDummyFD() to get a real FD for the test in
qemuxmlconftest.

Use virTestMakeDummyFD() also in qemuhotplugmock.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-25 13:28:58 +02:00
Peter Krempa 45d2ce9012 qemuxml2argvmock: qemuBuildTPMOpenBackendFDs: Use real FDs
Use 'virTestMakeDummyFD()' to create real FDs both for 'tpmfd' and
'cancelfd'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-25 13:28:58 +02:00
Peter Krempa 28ad58833e qemuxmlconftest: Setup real FDs for 'vhost-user-vga'
Initialize the chardev backends for vhost-user graphics to use real FDs.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-25 13:28:58 +02:00
Peter Krempa 963febb511 testQemuPrepareHostBackendChardevOne: Use real FDs for all cases
Use the virTestMakeDummyFD() function to setup real FDs for all chardev
backends which are set up via testQemuPrepareHostBackendChardevOne.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-25 13:28:58 +02:00
Peter Krempa ddfd6db943 virDomainFDTuple: drop 'testfds' field
Thanks to real FD testing we no longer need to inject test
infrastructure into production code. Remove it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-25 13:28:58 +02:00
Peter Krempa 3d2d363f88 testQemuInfoSetArgs: Use real FDs with 'ARG_FD_GROUP'
Switch over to 'virTestMakeDummyFD' which allows to use real FDs in the
test and also allows to track them in the output files in a stable way.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-25 13:28:58 +02:00
Peter Krempa 9eb761df3f testutilsqemu: Use real FD for monitor FDs instantiated by 'testQemuPrepareHostBackendChardevOne'
Switch to 'virTestMakeDummyFD' which uses a real FD. No otuputs are
changed thanks to the code which censors 'fd' field of --add-fd.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-25 13:28:58 +02:00
Peter Krempa cc330bf3f9 qemuxmlconftest: Stabilize 'vfio-pci' hostdev fds
Prepare to use real FDs in tests.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-25 13:28:58 +02:00
Peter Krempa e1b602e8ac qemuxmlconftest: Stabilize fds in '-netdev'
Use 'testCompareXMLToArgvStabilizeOne' to provide stable test outputs
even when we'll switch to real FDs in tests.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-25 13:28:58 +02:00
Peter Krempa 714285084a qemuxmlconftest: Stabilize 'vsock' 'vhostfd' file descriptior in output files
Install hanlder to stabilize 'vhostfd' fds in -device so that we can
later switch tests to use real FDs.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-25 13:28:58 +02:00
Peter Krempa c8331668af qemuxmlconftest: Stabilize FDs in iommufd objects
Install the handler to stabilize output files on '-object' with
'iommufd' qom type which references a FD directly via the 'fd' property.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-25 13:28:58 +02:00
Peter Krempa c2ea8b2e7c 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>
2026-05-25 13:28:58 +02:00
Peter Krempa 6cf78a55f9 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>
2026-05-25 13:28:57 +02:00
Peter Krempa a72bbfc4ba 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>
2026-05-25 13:28:57 +02:00
Peter Krempa 6984ed1b4e 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>
2026-05-25 13:28:57 +02:00
Peter Krempa 5f2c2d35c0 util: json: Introduce 'virJSONValueObjectReplaceKey'
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>
2026-05-25 13:28:57 +02:00
Peter Krempa 1d95df0c57 util: command: Remove virCommandGetArgList
The function is now unused, remove it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-25 13:28:57 +02:00
Peter Krempa 1919326263 qemuxmlconftest: Use virCommandArgListAccess in testCompareXMLToArgvValidateSchema
Access the args directly rather than fetching a copy since we have a new
helper now.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-25 13:28:57 +02:00
Peter Krempa da7a3f4d37 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>
2026-05-25 13:28:57 +02:00
Peter Krempa a3bedabcc4 qemuxml2argvmock: Fix behaviour of 'virCommandPass' mock
The 'virCommandPass' mock in 'qemuxml2argvmock.so' skipped passing most
FDs to the real implementation of 'virCommandPass', except for few fake
FDs that were hardcoded.

This meant that if a test case had an valid FD that it used for testing
that FD would be leaked. At the same time fake fds 1730, 1731, 1732
would be actually passed to the virCommand itself although the FD was
invalid.

Since neither of the above makes sense fix the implementation the
following way:

 - refuse to pass any STDIO fds
     They are real and they would break test program output. Some tests
     do try to use them errorneously; they will be addressed later.

 - pass real FDs to virCommand
    Real FDs can be properly handled by virCommand. Especially they will
    be closed once the virCommand object is disposed of.

 - don't pass fake FDs
    They create extra noise e.g. in valgrind. Skip those as it makes no
    sense to handle those.

This patch addresses most failures that valgrind reports with
--track-fds=all.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-25 13:28:57 +02:00
Peter Krempa f705379443 qemuFDPassLogFDInfo: Check if FD is valid before 'fstat'-ing it
Some test cases (qemuxmlconftest) currently use made up descriptors,
which cause e.g. valgrind to be unhappy:

 ==831186== File descriptor 1729 Invalid file descriptor
 ==831186==    at 0x531042E: fgetxattr (in /usr/lib64/libc.so.6)
 ==831186==    by 0x5AE2846: ??? (in /usr/lib64/libselinux.so.1)
 ==831186==    by 0x5AE7093: fgetfilecon_raw (in /usr/lib64/libselinux.so.1)
 ==831186==    by 0x4EB736F: qemuFDPassLogFDInfo (qemu_fd.c:92)
 ==831186==    by 0x4EB7B8E: qemuFDPassDirectTransferCommand (qemu_fd.c:443)

when tracking FDs. Since 'qemuFDPassLogFDInfo' just logs information
about the FD we can simply not query the FD if it's made up.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-25 13:28:57 +02:00
Peter Krempa a6d491909a util: command: Extract common parts of FD closing to virCommandMassClose
Extract the lookup of used FDs and their setup to virCommandMassClose
rather than duplicate it in the two functions we have for using
different modes of FD closing.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-25 13:28:57 +02:00
Peter Krempa 6301078c62 qemu: Stop mocking 'qemuOpenChrChardevUNIXSocket'
The tests now use 'testQemuPrepareHostBackendChardevOne' which replaces
'qemuProcessPrepareHostBackendChardevOne' which is skipped as it is a
host setup step.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-25 13:28:57 +02:00
Peter Krempa 615cc14e45 qemuxmlconftest: Remove unused 'monitor_chr' from testCompareXMLToArgv
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-25 13:28:57 +02:00
Roman Bogorodskiy ebeb4426c5 virsh: fix entering interactive session
When entering an interactive session, that is, without a command
specified:

  virsh --connect $URI

virsh currently segfaults because it tries to access
ctl->cmd->def->handler and the ctl->cmd is NULL.

Fix by checking if ctl->cmd is not NULL before doing further checks.

Fixes: b489eb8d6b
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2026-05-25 10:58:15 +02:00
Radoslaw Smigielski via Devel 05ff74ad06 ci: Fix --engine flag positioning in helper script
The --engine flag was being added to positional_args before the "run"
subcommand, which resulted in incorrect lcitool invocations:

  lcitool container --engine podman run ...  (wrong)

This caused "invalid choice: 'podman'" errors because lcitool expected
a COMMAND argument at that position.

Fix by moving the --engine flag to opts array, which is added after
the "run" subcommand, resulting in the correct command structure:

  lcitool container run --engine podman ...  (correct)

Example:

 $ ./ci/helper run fedora-44 --job codestyle --engine podman
  usage: lcitool container [-h] COMMAND ...
 lcitool container: error: argument COMMAND: invalid choice: 'podman' (choose from engines, build, run, shell)

The same error happens if "--engine" option is set to different
than "auto" value.

Signed-off-by: Radoslaw Smigielski <rsmigiel@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2026-05-25 10:17:01 +02:00
George Melikov 7a1f1236a4 NEWS: add latest ZFS driver changes
Signed-off-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
2026-05-23 07:32:52 +02:00
George Melikov 875af97a7a NEWS: add missing ZFS driver new feature to 11.7.0
Document native volume resizing support.

Signed-off-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
2026-05-23 07:29:41 +02:00
Lucas Kornicki e5f32e456e qemu: emit channel lifecycle event
Emit the channel lifecycle event on VSERPORT_CHANGE
and when refreshing virtio state.

On "org.qemu.guest_agent.0" channel state change both
agent and channel lifecycle events are emitted in that order.

Signed-off-by: Lucas Kornicki <lucas.kornicki@nutanix.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-21 15:32:54 +02:00
Lucas Kornicki faa3ece92c conf,remote: add channel lifecycle domain event
Add support for a new domain event which can be used to track
the state of any virtio channel.

Previously one could only monitor the "org.qemu.guest_agent.0" channel
which had a dedicated agent lifecycle event. The channel lifecycle event
will be emitted alongside the agent specific one.

Signed-off-by: Lucas Kornicki <lucas.kornicki@nutanix.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-21 15:32:50 +02:00
Roman Bogorodskiy 57467ba683 bhyve: implement the domainSetMemoryParameters API
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-20 18:27:17 +02:00
Roman Bogorodskiy 278697b72d bhyve: process: factor out rctl(8) code
Factor out all rctl(8) execution code to bhyve_rctl.c.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-20 18:27:13 +02:00
Roman Bogorodskiy 3c013d1627 bhyve: implement the domainGetMemoryParameters API
Implement the domainGetMemoryParameters() API for the bhyve driver.
To parse live limits execute rctl(8) to list the active rules and parse
them.

Introduce the bhyve_rctl.c for working with rctl(8).

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-20 18:27:08 +02:00
Roman Bogorodskiy dd34991f6e bhyve: add memtune support
Add support of the memtune's hard_limit configuration:

  <memtune>
    <hard_limit ... >
  </memtune>

to the bhyve driver.

Just like in the block I/O tuning case, memory limits are set using the
rctl(8) tool.

Syntax for that is:

 rctl -a process:<pid>:memoryuse:deny=1073741824

Extend bhyveSetResourceLimits() to execute this command if it's
requested by the domain XML.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-20 18:23:32 +02:00
Jiri Denemark 5d5bb2059d cpu_map: Add DiamondRapids CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-20 16:39:45 +02:00
Jiri Denemark 5e7d3b55f7 cpu_map: Add new versions of GraniteRapids CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-05-20 16:39:45 +02:00