]> git.ipfire.org Git - thirdparty/libvirt.git/log
thirdparty/libvirt.git
19 hours agoci: regenerate with 'lcitool manifest' master
Michal Privoznik [Thu, 29 Jan 2026 13:11:35 +0000 (14:11 +0100)] 
ci: regenerate with 'lcitool manifest'

Update Alpine to 3.23.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
20 hours agotests: Rename networkxml2xmltest to networkxmlconftest
Michal Privoznik [Wed, 28 Jan 2026 12:10:26 +0000 (13:10 +0100)] 
tests: Rename networkxml2xmltest to networkxmlconftest

Now that networkxml2xmltest does both XML -> XML and XML -> conf
tests its name became misleading. Rename it to networkxmlconftest
and move its data into networkxmlconfdata/ dir.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
20 hours agotests: Drop networkxml2conftest
Michal Privoznik [Wed, 28 Jan 2026 11:56:28 +0000 (12:56 +0100)] 
tests: Drop networkxml2conftest

Now that networkxml2xmltest does XML->conf tests the
networkxml2conftest is redundant. Drop it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
20 hours agonetworkxml2xmltest: Do conf test
Michal Privoznik [Wed, 17 Dec 2025 10:51:07 +0000 (11:51 +0100)] 
networkxml2xmltest: Do conf test

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
20 hours agonetworkxml2xmltest: Sync test cases with networkxml2conftest
Michal Privoznik [Tue, 27 Jan 2026 15:43:06 +0000 (16:43 +0100)] 
networkxml2xmltest: Sync test cases with networkxml2conftest

The networkxml2xmltest does basic parse -> format tests.
The networkxml2conftest does parse -> conf tests.

Now, majority of XMLs are the same. That is, output XMLs of
networkxml2xmltest and input XMls of networkxml2conftest. There
are only a few differences. This is actually great, because it
will allow either tests to do both test cases.

There are some (subtle) differences in individual test cases
though:

1) some test cases exist only in networkxml2conftest and not
   networkxml2xmltest, or
2) some test cases in networkxml2conftest have more values, i.e.
   extra elements, extra attributes. or
3) some test cases in networkxml2conftest have less values.

For cases from 1) they were just copied over. For cases from 2)
those extra elements/attributes were added, and for cases from 3)
those extra attributes were removed (to minimize changes to .conf
files in near future).

One caveat though: networkxml2xmlupdatetest uses input XMLs of
networkxml2xmltest too (hence changes under
networkxml2xmlupdateout/ dir). This means that the
"delete-srv-record-protocol" test started failing, because the
input network XML now has more <srv/> records than the test case
anticipated. But this is easy to fix - hence seemingly unrelated
change under networkxml2xmlupdatein/ dir.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
20 hours agonetworkxml2xmltest: Store parsed def for future tests
Michal Privoznik [Wed, 17 Dec 2025 10:31:52 +0000 (11:31 +0100)] 
networkxml2xmltest: Store parsed def for future tests

Soon, the testRun() will run more than one test case. The input
network XML, however, stays the same. Instead of parsing it and
throwing away immediately, store it temporarily.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
20 hours agonetworkxml2xmltest: Dynamically allocate testInfo struct
Michal Privoznik [Wed, 17 Dec 2025 10:20:31 +0000 (11:20 +0100)] 
networkxml2xmltest: Dynamically allocate testInfo struct

So far, the testInfo struct contained immutable data (from its
lifetime point of view). But that is about to change. For
instance, it will hold parsed network definition (virNetworkDef)
and in order to avoid leaking dynamically allocated data
corresponding free function must be introduced (or clear
function, doesn't really matter). At this point, the structure
might as well be dynamically allocated entirely.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
20 hours agonetworkxml2xmltest: Move path generation into testRun()
Michal Privoznik [Wed, 17 Dec 2025 08:51:17 +0000 (09:51 +0100)] 
networkxml2xmltest: Move path generation into testRun()

This effectively dissolves testCompareXMLToXMLHelper() into
testRun(). Motivation is that parts of data generated inside of
testCompareXMLToXMLHelper() is going to be reused from the caller
(testRun()).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
20 hours agonetworkxml2xmltest: Introduce testRun()
Michal Privoznik [Wed, 17 Dec 2025 08:46:59 +0000 (09:46 +0100)] 
networkxml2xmltest: Introduce testRun()

This is a beginning of something bigger. The idea is that one
DO_TEST_FULL() macro (and its friends) will run multiple test
cases (just like qemuxmlconftest does). But in order to do that
in a readable fashion, the macro should merely just expand to a
function call. The function will then call virTestRunLog(),
multiple times possibly.

This is the first step in that direction.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
20 hours agonetworkxml2xmltest: Don't recreate xmlopt object
Michal Privoznik [Wed, 17 Dec 2025 09:44:21 +0000 (10:44 +0100)] 
networkxml2xmltest: Don't recreate xmlopt object

The aim of virNetworkXMLOption object is to provide some
immutable data to XML parser (e.g. various callbacks). Since the
object is immutable, it can be created once and then reused by
all test cases.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
20 hours agonetworkxml2conftest: Allow regenerating more in one run
Michal Privoznik [Wed, 17 Dec 2025 12:24:06 +0000 (13:24 +0100)] 
networkxml2conftest: Allow regenerating more in one run

Currently, there are two calls to virTestCompareToFile() inside
of testCompareXMLToConfFiles(). If the first one fails the
control jumps directly onto the fail label and skips the second
one. This means that When regenerating test case output
(VIR_TEST_REGENERATE_OUTPUT) the test binary has to be called
twice to regenerate all the files. Suboptimal. Try harder to call
both compare helpers.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
20 hours agonetworkxml2conftest: Allow regenerating hosts file
Michal Privoznik [Wed, 17 Dec 2025 12:14:08 +0000 (13:14 +0100)] 
networkxml2conftest: Allow regenerating hosts file

Inside of testCompareXMLToConfFiles() the
networkDnsmasqConfContents() is called. This may also produce
contents of corresponding hosts file. This is then compared to
expected contents stored on disk as ${testname}.hostsfile. But
due to additional checks virTestCompareToFile() might not even be
called. Problem with that is when there's actual content but the
file doesn't exist the compare helper is not called and thus
VIR_TEST_REGENERATE_OUTPUT trick doesn't work. Let's call the
helper more often as it is perfectly capable of handling this
edge case. What it is not capable of handling is when the file
shouldn't exist at all. So handling of that case is kept.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
20 hours agonetworkxml2conftest: Avoid potential leak
Michal Privoznik [Wed, 17 Dec 2025 12:17:02 +0000 (13:17 +0100)] 
networkxml2conftest: Avoid potential leak

Inside of testCompareXMLToConfFiles() the network definition is
parsed and if that succeeds a virNetworkObj is created by calling
virNetworkObjNew(). But if the latter fails, the control jumps
onto the fail label where only the object is freed but not
already parsed definition leading to a leak.

Swapping these two steps ensures that if either of them fails no
memleak occurs.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
20 hours agotest: wire up networkValidateTests()
Michal Privoznik [Tue, 27 Jan 2026 21:08:18 +0000 (22:08 +0100)] 
test: wire up networkValidateTests()

Our network driver calls networkValidate() right after a network
XML is parsed. This is similar to domain validation step when
parsing domain XML. But it's not that convoluted in network
driver. Regardless, any network related test should mimic real
life scenario as close as possible and thus
networkValidateTests() should be called right after domain XML is
parsed.

Now, networkValidate() might query sysfs wrt to PCI devices and
thus tests must start using virpcimock. The function will also
generate random MAC addresses, if needed, hence virrandommock.

With this change, passthrough-pf and passthrough-address-crash
test cases of networkxml2xmltest started failing but looking at
corresponding XMLs those test cases were designed to test just
XML parsing. They were never designed to showcase a "real"
network XML. So mark them as expected fail.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
20 hours agonetwork: Introduce networkValidateTests()
Michal Privoznik [Tue, 27 Jan 2026 21:07:28 +0000 (22:07 +0100)] 
network: Introduce networkValidateTests()

The aim of this internal API is to wrap networkValidate() and it
is meant to be called from our tests.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
20 hours agonetworkxml2xmltest: Update couple of test cases
Michal Privoznik [Wed, 28 Jan 2026 08:27:51 +0000 (09:27 +0100)] 
networkxml2xmltest: Update couple of test cases

Soon, individual test cases of networkxml2xmltest will be subject
to networkValidate() call. This means, that input XMLs must be
valid (or marked as expected fail). Anyway, there are couple of
offenders:

1) 8021Qbh-net.xml setting vlan for <forward mode='private'/> is
   unsupported,
2) hostdev.xml networkValidate() will check if hostdevs specified
   for <forward mode='hostdev'/> are VFs. Use PCI addresses from
   virpcimock.
3) openvswitch-net.xml for <forward mode='bridge'/> only
   openvswitch type of virtualports is allowed.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
20 hours agonetworkxml2conftest: Fail tests where no dnsmasq would be spawned
Michal Privoznik [Tue, 27 Jan 2026 20:25:41 +0000 (21:25 +0100)] 
networkxml2conftest: Fail tests where no dnsmasq would be spawned

If network config does not require dnsmasq then none is spawned.
Having a test case that would still require generating dnsmasq
config is weird and can lead to spurious results. Just fail such
test case.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
20 hours agonetworkxml2conftest: Drop routed-network-no-dns test case
Michal Privoznik [Tue, 27 Jan 2026 20:24:07 +0000 (21:24 +0100)] 
networkxml2conftest: Drop routed-network-no-dns test case

This test case is spurious. If this was real life scenario then
no dnsmasq would be spawned and yet, the test tries to generate
dnsmasq config for it. Just drop the test case and move on.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
20 hours agonetwork: Move decision on dnsmasq need into a separate function
Michal Privoznik [Tue, 27 Jan 2026 19:59:20 +0000 (20:59 +0100)] 
network: Move decision on dnsmasq need into a separate function

Whether a network needs dnsmasq or not is decided at the
beginning of networkStartDhcpDaemon(). Move that code into a
separate function so it can be reused later.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
20 hours agonetwork: Separate private APIs declaration to bridge_driver_priv.h
Michal Privoznik [Tue, 27 Jan 2026 19:38:21 +0000 (20:38 +0100)] 
network: Separate private APIs declaration to bridge_driver_priv.h

There are two functions implemented in bridge_driver.c that are
used in tests (networkDnsmasqCreateXMLConf() and
networkDnsmasqConfContents()) but are declared in
bridge_driver.h. This goes against our current practice where
such APIs are declared in $name_priv.h.

Therefore, move those APIs to bridge_driver_priv.h

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
20 hours agotests: Avoid crossdir inclusion for networkxml2* tests
Michal Privoznik [Tue, 27 Jan 2026 19:43:25 +0000 (20:43 +0100)] 
tests: Avoid crossdir inclusion for networkxml2* tests

Instead of including network driver header files as:

  #include "network/header.h"

pass network_inc_dir to the compiler and include files directly.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 days agoesx: Switch to creating URLs using virURIFormat
Richard W.M. Jones [Mon, 26 Jan 2026 17:54:57 +0000 (17:54 +0000)] 
esx: Switch to creating URLs using virURIFormat

Since libvirt has existing support for creating URIs, use that rather
than home-rolling our own code without any escaping.

As a side-effect this ensures that URLs containing IPv6 addresses are
escaped correctly, for example as below (note square brackets):

      https://[1234:56:0:789a:bcde:72ff:fe0a:7baa]:443/sdk

Fixes: https://issues.redhat.com/browse/RHEL-138300
Updates: commit 845210011a9ffd9d17e30c51cbc81ba67c5d3166
Reported-by: Ming Xie <mxie@redhat.com>
Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2 days agoesx: Abstract all URL-creation code into one function
Richard W.M. Jones [Mon, 26 Jan 2026 10:47:01 +0000 (10:47 +0000)] 
esx: Abstract all URL-creation code into one function

Abstract the places where we create URLs into one place.  This is just
refactoring and should not change the behaviour.

Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
2 days agoesx: Debug URL just before opening with curl
Richard W.M. Jones [Mon, 26 Jan 2026 10:38:02 +0000 (10:38 +0000)] 
esx: Debug URL just before opening with curl

Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
2 days agoqemuSnapshotUpdateBackingStore: Retry as curent user if qemu-img fails
Peter Krempa [Mon, 26 Jan 2026 15:49:50 +0000 (16:49 +0100)] 
qemuSnapshotUpdateBackingStore: Retry as curent user if qemu-img fails

The code calls 'qemu-img rebase' to fix the backing store references.
The 'qemu-img' process here is run as the 'qemu' user or whatever the
defaults and domain XML resolve to. Since this, in certain cases, works
also on images which are not part of the backing chain and in privileged
deployments thus can be owned by 'root:root' the update may fail
(silently).

To preserver root-squash deployments but fix also the above case, retry
the operation on failure as current user.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2 days agovirDomainSnapshotDefAssignExternalNames: Improve error message
Peter Krempa [Mon, 26 Jan 2026 15:39:45 +0000 (16:39 +0100)] 
virDomainSnapshotDefAssignExternalNames: Improve error message

Mention the 'path' where the detection failed as well as include the
possibility that the 'path' doesn't exist in the message itself.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2 days agoqemuSnapshotDiskHasBackingDisk: Use proper 'max_depth' when calling 'virStorageSource...
Peter Krempa [Mon, 26 Jan 2026 15:39:24 +0000 (16:39 +0100)] 
qemuSnapshotDiskHasBackingDisk: Use proper 'max_depth' when calling 'virStorageSourceGetMetadata'

The 'max_depth' argument of 'virStorageSourceGetMetadata' doesn't just
limit how far the function goes but also fails completely if the chain
is deeper than the passed value.

In 'qemuSnapshotDiskHasBackingDisk' we only care about finding the
backing image, so just one level below, the passed path, but due to the
above setting '1' as max_depth will make the function simply fail every
time.

Extract and reuse QEMU_DOMAIN_STORAGE_SOURCE_CHAIN_MAX_DEPTH as the
detection depth. While '200' layers is overkill for this code, we also
start a full qemu instance just to delete an snapshot so this doens't
matter and still protects from self-referential images.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2 days agoqemuSnapshotUpdateBackingStore: Remove stale comment
Peter Krempa [Fri, 23 Jan 2026 07:54:32 +0000 (08:54 +0100)] 
qemuSnapshotUpdateBackingStore: Remove stale comment

The code does a 'qemu-img rebase' rather than a 'qemu-img create' what
the commit suggests. Since we enumerate all arguments right below,
there's no need for a comment.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2 days agoqemuSnapshotDiskHasBackingDisk: Avoid call of virStorageSourceIsSameLocation with...
Peter Krempa [Fri, 23 Jan 2026 07:42:50 +0000 (08:42 +0100)] 
qemuSnapshotDiskHasBackingDisk: Avoid call of virStorageSourceIsSameLocation with NULL argument

When the 'backingStore' pointer is not populated the function calls
'virStorageSourceGetMetadata' to try to populate it but if the on-disk
metadata doesn't have a backing image (e.g. if it's the 'base' image of
the chain) the 'backingStore' or the metadata fetcher fails the pointer
will still be NULL.

The function then calls 'virStorageSourceIsSameLocation' but the
internal functions for dealing with storage sources don't handle NULL
gracefully.

Since the code calling 'qemu-img' based on the data detected here
doesn't actually raise errors if the operations fail there's no point
in raising errors here either.

Closes: https://gitlab.com/libvirt/libvirt/-/issues/844
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 days agoqemu: Connect NVMe devices to PCIe bus
Akihiko Odaki [Fri, 23 Jan 2026 06:06:03 +0000 (15:06 +0900)] 
qemu: Connect NVMe devices to PCIe bus

NVMe has PCIe transport, so connect NVMe devices to PCIe bus instead of
classic PCI bus if available.

Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Reviewed-by: Laine Stump <laine@redhat.com>
7 days agoFix printf style used with virDomainIOMMUDef::aw_bits
Michal Privoznik [Thu, 22 Jan 2026 14:43:17 +0000 (15:43 +0100)] 
Fix printf style used with virDomainIOMMUDef::aw_bits

The aw_bits member of the virDomainIOMMUDef is of type unsigned
int. However, in a few places
(virDomainIOMMUDefCheckABIStability(), virDomainIOMMUDefFormat(),
qemuBuildIOMMUCommandLine()) incorrect printf modifier is used.
Fix those places.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
8 days agosrc: Use device alias when ifname is unset in virDomainInterfaceAddresses()
Michal Privoznik [Tue, 20 Jan 2026 15:19:00 +0000 (16:19 +0100)] 
src: Use device alias when ifname is unset in virDomainInterfaceAddresses()

The virDomainInterfaceAddresses() API returns an array of
_virDomainInterface structs which then describe IP addresses
associated with given domain. The struct contains 'name' member
which is documented deliberately vaguely: "interface name". This
is because depending on the source of truth used (controlled by
'source' argument) the name can be wildly different from the one
in domain XML. Now, in case of source =
VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_ARP, the host's ARP table is
parsed and matching interfaces are found by comparing MAC
addresses. If it's a match then the 'name' is set to net->ifname
(corresponds to /interface/target/@dev). But that is not always
set and sometimes may be NULL (e.g. for hostdevs, usernet). We
can't change the API (like we did for hwaddr in v1.2.14-rc1~105)
because this is already released. So the next best thing to do is
to put the interface alias in there.

To be on a safe side, do the same change to the
VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_LEASE case.

Resolves: https://issues.redhat.com/browse/RHEL-141496
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
8 days agolibvirt-domain: Fix documentation of virDomainInterfaceAddresses()
Michal Privoznik [Tue, 20 Jan 2026 15:15:14 +0000 (16:15 +0100)] 
libvirt-domain: Fix documentation of virDomainInterfaceAddresses()

Ever since of v1.2.14-rc1~105 the hwaddr member of
_virDomainInterface struct can be NULL. And this is documented
inside the struct. But then the public API documents it can never
be NULL which is obviously wrong. Fix the public API
documentation.

Fixes: 3640245db7d72bf8e05df726587625a6328c895e
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
8 days agoutil: Remove @masked argument from virSocketAddrFormatWithPrefix
Julio Faracco [Tue, 20 Jan 2026 02:29:11 +0000 (23:29 -0300)] 
util: Remove @masked argument from virSocketAddrFormatWithPrefix

Ever since its introduction in commit 426afc00 all the callers
pass true.

Remove the argument.

Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
9 days agoqemuDomainSetThrottleGroup: Don't put group name into the 'tunable' event twice
Peter Krempa [Fri, 16 Jan 2026 15:39:49 +0000 (16:39 +0100)] 
qemuDomainSetThrottleGroup: Don't put group name into the 'tunable' event twice

'qemuDomainSetBlockIoTuneFields' already populates the contents of the
VIR_DOMAIN_EVENT_ID_TUNABLE params with the group name so there's no
need to do it explicitly. We'd report the group name twice:

 event 'tunable' for domain 'cd':
blkdeviotune.group_name: asdf
blkdeviotune.total_bytes_sec: 1234
blkdeviotune.group_name: asdf

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
9 days agoqemuDomainSetThrottleGroup: Always honour thottle group name passed as argument
Peter Krempa [Fri, 16 Jan 2026 15:39:40 +0000 (16:39 +0100)] 
qemuDomainSetThrottleGroup: Always honour thottle group name passed as argument

Due to the code share with 'qemuDomainSetBlockIoTune' the throttle group
setting code accepts the throttle group name also via typed parameters.

In 'qemuDomainSetThrottleGroup', this means that there are 2 ways to
pass it the throttle group name and both are handled slightly
differently. Specifically the name of the group used in the list of
groups is the name taken from the typed parameters rather than the one
passed via API. We also don't validate that they match.

Now if the name in the typed parameters is missing we'd add empty string
to the group list which would later crash when looking up the group
name.

To avoid this problem always use the name passed via argument. This is
achieved by passing it into 'qemuDomainSetBlockIoTuneFields' so that it
overrides whatever is in the typed parameters.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
9 days agoqemuDomainSetBlockIoTuneField: Move setting of 'group_name' out of the loop
Peter Krempa [Fri, 16 Jan 2026 15:38:38 +0000 (16:38 +0100)] 
qemuDomainSetBlockIoTuneField: Move setting of 'group_name' out of the loop

The refactor will simplify further change which will introduce another
source for the group name.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
9 days agoqemuDomainSetThrottleGroup: Enforce non-zero 'groupname' string length
Peter Krempa [Fri, 16 Jan 2026 15:36:50 +0000 (16:36 +0100)] 
qemuDomainSetThrottleGroup: Enforce non-zero 'groupname' string length

Having a name of 0 characters makes no sense. Reject it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
9 days agoqemucapabilitiestest: Add data for the qemu-11.0 dev cycle (aarch64)
Peter Krempa [Wed, 14 Jan 2026 16:03:05 +0000 (17:03 +0100)] 
qemucapabilitiestest: Add data for the qemu-11.0 dev cycle (aarch64)

The dump is based on QEMU commit 'v10.2.0-476-gcf3e71d8fc'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
9 days agoqemucapabilitiestest: Add data for the qemu-11.0 dev cycle (x86_64)
Peter Krempa [Wed, 14 Jan 2026 08:05:27 +0000 (09:05 +0100)] 
qemucapabilitiestest: Add data for the qemu-11.0 dev cycle (x86_64)

The dump is based on QEMU commit 'v10.2.0-476-gcf3e71d8fc'

Notable changes:
 - machine type changes: new types added, '5.0' machines dropped
 - new and updated cpus:
    - ClearwaterForest-v2-x86_64-cpu
    - DiamondRapids-v1-x86_64-cpu
    - GraniteRapids-v4-x86_64-cpu
    - SapphireRapids-v5-x86_64-cpu
    - SierraForest-v4-x86_64-cpu
 - various CPU flag changes for 'max-x86_64-cpu'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
9 days agoqemuxmlconftest: Prepare 'fd-memory-numa-topology4' for removal of 'pc-i440fx-5.0'
Peter Krempa [Wed, 14 Jan 2026 08:28:32 +0000 (09:28 +0100)] 
qemuxmlconftest: Prepare 'fd-memory-numa-topology4' for removal of 'pc-i440fx-5.0'

Per commit message of 3f390db2e2ed33cda8e which added the
'fd-memory-numa-topology4' case, it's supposed to test memory
preallocation setting in the NUMA setup.

Now the 5.0 machine type is the last one supporting the old-style NUMA
config and thus also the only way to test the formatting of
'--mem-prealloc' commandline option for qemu, which was since replaced
by a property in the memory backend object.

Thus to preserve the idea of this test, add
'fd-memory-numa-topology4-old-machine' test case pinned to qemu-10.2,
which will use pc-i440fx-5.0 and modernize the normal case using the
latest qemu version by dropping the specific machine version.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
9 days agoqemuxmlconftest: Remove specific machine type from 'devices-acpi-index'
Peter Krempa [Wed, 14 Jan 2026 08:19:59 +0000 (09:19 +0100)] 
qemuxmlconftest: Remove specific machine type from 'devices-acpi-index'

ACPI index support doesn't depend on the machine type and
'pc-i440fx-5.0' will be removed from qemu-11.0.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
9 days agoqemuxmlconftest: Freeze 'cpu-numa-memory-oldstyle' case to qemu-10.2
Peter Krempa [Wed, 14 Jan 2026 08:10:35 +0000 (09:10 +0100)] 
qemuxmlconftest: Freeze 'cpu-numa-memory-oldstyle' case to qemu-10.2

The test case specifically excercises our generator with the
'pc-i440fx-5.0' machine type which will be removed in qemu-11.0.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
9 days agovirnetdevtap: Produce more helpful error message in virNetDevTapCreate()
Michal Privoznik [Tue, 20 Jan 2026 09:54:21 +0000 (10:54 +0100)] 
virnetdevtap: Produce more helpful error message in virNetDevTapCreate()

Since v10.8.0-rc1~133 a different error is reported from
virNetDevTapCreate() when the tap device already exists (and
<interface/> XML specifies managed='no'). But the change covers
only one scenario: if multiqueue was requested in <inteface/> XML
BUT pre-created tap device doesn't have multi_queue flag set. The
opposite scenario: if the device has the multi_queue flag set BUT
no multiqueue was specified in the XML. Until now.

Resolves: https://issues.redhat.com/browse/RHEL-118303
Fixes: f6fb097e11a15e390d989411b2660ead0d1a7c10
Fixes: 465a38154f0cfc31d62c4105770e1f4a9599a611
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
9 days agoesx: Allow connecting to IPv6 server
Michal Privoznik [Tue, 20 Jan 2026 09:08:29 +0000 (10:08 +0100)] 
esx: Allow connecting to IPv6 server

When connecting to a VMWare server, the hostname from URI is
resolved using esxUtil_ResolveHostname() which in turn calls
getaddrinfo(). But in the hints argument, we restrict the return
address to be IPv4 (AF_INET) which obviously fails if the address
to resolve is an IPv6 address. Set the hint to AF_UNSPEC which
allows both IPv4 and IPv6. While at it, also allow IPv4 addresses
mapped in IPv6 by setting AI_V4MAPPED flag.

Resolves: https://issues.redhat.com/browse/RHEL-138300
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
10 days agobhyve: workaround for the lack of UTC clock on ARM64
Roman Bogorodskiy [Tue, 13 Jan 2026 18:30:23 +0000 (19:30 +0100)] 
bhyve: workaround for the lack of UTC clock on ARM64

Currently, bhyve does not support UTC clock offset on ARM64.
However, when <clock offset= > is not specified in the domain XML,
UTC offset is used by default. That results in an incorrect
configuration for the bhyve ARM64 guests by default.

Workaround is to extend bhyveDomainDefPostParse() to fall back
to the LOCALTIME clock offset when UTC clock offset is not
supported by bhyve.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
10 days agovirt-aa-helper: Ask for no deny rule for readonly disk elements
Serge Hallyn [Mon, 5 Jan 2026 20:27:21 +0000 (14:27 -0600)] 
virt-aa-helper: Ask for no deny rule for readonly disk elements

Just because a disk element only requests read access doesn't mean
there may not be another readwrite request.

Using 'R' when creating the apparmor rule will prevent an implicit
write-deny rule to be created alongside. This does not mean write
is allowed but it would cause a denial message and probably more
relevant, allows to add write access later.

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/622
Resolves: https://gitlab.com/libvirt/libvirt/-/issues/806
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1554031
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1692441
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Wesley Hershberger <wesley.hershberger@canonical.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
10 days agosyntax-check: Introduce sc_prohibit_local_with_subshell rule
Michal Privoznik [Fri, 16 Jan 2026 08:12:30 +0000 (09:12 +0100)] 
syntax-check: Introduce sc_prohibit_local_with_subshell rule

In shell, the following function doesn't echo '1' but '0':

  func() {
      local var=$(false)
      echo $?
  }

This is because '$?' does not refer to 'false' but 'local'. The
bash_builtins(1) manpage explains it well. And it also mentions
other commands behaving the same: export, declare and readonly.
Since it is really easy to miss this pattern, introduce a
syntax-check rule. Mind you, the following pattern (which passes
the rule) does check for the subshell exit code:

  func() {
      local var
      var=$(false)
      echo $?
  }

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
10 days agolibvirt-guest.sh.in: Fix logical error in guest_is_on()
Michal Privoznik [Mon, 19 Jan 2026 10:42:14 +0000 (11:42 +0100)] 
libvirt-guest.sh.in: Fix logical error in guest_is_on()

The guest_is_on() function is documented to check whether given
domain is running and set guest_running variable accordingly. It
does so by running virsh (transitively), then setting the
variable and only after that comparing $? variable. This is
obviously wrong, because after the guest_running variable
assignment the $? variable no longer holds the exit code of
virsh. Even worse, as explained in the previous commit, it never
held that value in the first place. Fix this by firstly setting
the global variable and only after that running virsh.

Fixes: 08071ec0f113bb1fe8dcc263cb6bf87529e8b76b
Resolves: https://gitlab.com/libvirt/libvirt/-/issues/839
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
10 days agolibvirt-guests.sh: Declare and assign separately to avoid masking return values
Michal Privoznik [Mon, 19 Jan 2026 10:28:47 +0000 (11:28 +0100)] 
libvirt-guests.sh: Declare and assign separately to avoid masking return values

In Bash, the following code does not do what you think it does:

  func() {
      local var=$(false)
      echo $?
  }

Here, '0' is echoed even though false is designed to exit with a
non-zero code. This is because in fact the last executed command
is 'local' not 'false' and thus '$?' contains zero as in "yeah,
the variable is successfully declared" [1]. In our libvirt-guest
shell script, there are a few places like this. Fix them.

1: bash_builtins(1)
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
11 days agoscripts: don't import shutil in meson-warnings.py
Laine Stump [Mon, 19 Jan 2026 05:31:17 +0000 (00:31 -0500)] 
scripts: don't import shutil in meson-warnings.py

It's never used, which makes flake8 complain.

Fixes: 50ad6026adc227f5d364fd088c7c1b770e37eddb
Signed-off-by: Laine Stump <laine@redhat.com>
13 days agoci: regenerate with 'lcitool manifest'
Daniel P. Berrangé [Fri, 16 Jan 2026 13:45:55 +0000 (13:45 +0000)] 
ci: regenerate with 'lcitool manifest'

This pulls in changes which cut down the build log sizes

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
13 days agomeson: write all warning flags to 'c-warnings.txt'
Daniel P. Berrangé [Fri, 16 Jan 2026 14:56:18 +0000 (14:56 +0000)] 
meson: write all warning flags to 'c-warnings.txt'

Passing warning flags to the C compiler results in incredibly long
command lines, which in turns results in incredibly large CI log
files. Our logs are so large that they often exceed the GitLab
file limits.

We've cut out the irrelevant cruft from the logs and they're still
too large. The only option left is to stop passing so many args
to the compiler.

Fortunately it is easy to achieve this with GCC/CLang as when seeing
an argument "@somepath" they will treat each line in "somepath" as
being an additional compiler argument.

Putting the warning flags in a 'c-warnings.txt' file is fairly
easy and a massive win. We don't lose anything from the CI logs
as we print the full set of warning flags at the end of running
'meson'. Meanwhile for interactive builds the flags are visible
in the c-warnings.txt file in the build directory root.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
13 days agosrc: remove some -D defines from compiler args
Daniel P. Berrangé [Fri, 16 Jan 2026 13:25:47 +0000 (13:25 +0000)] 
src: remove some -D defines from compiler args

The compiler args are so verbose that CI jobs hit the limit on the
log file size GitLab is willing to capture.

Mitigate this a little bit by removing

  -DIN_LIBVIRT
  -Dabs_top_builddir="..dir.."
  -Dabs_top_srcdir="..dir.."

The last two are already present in the meson-config.h file so
were redundant, and the first is easily added to internal.h.

NB, remote_protocol.x needed special treatment since it is an
exception which (intentionally) does NOT include internal.h
before libvirt/libvirt.h

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
13 days agoutil: Fix max socket calculation
Alexandr Semenikhin [Tue, 6 Jan 2026 10:31:29 +0000 (10:31 +0000)] 
util: Fix max socket calculation

This patch changes how the maximum socket count is calculated.

On some systems (e.g. GB200), physical_package_id values are not
contiguous or zero-based. Instead of 0..N, they may contain large
arbitrary identifiers (e.g. 256123234). The previous implementation
assumed a 0..N range and used the maximum ID value directly.

This caused:
    excessive memory allocation
    extremely large loop bounds
    OOM / DoS scenarios
    unnecessary CPU time consumption

The new implementation computes the socket count as the number of unique
package IDs present on the node, rather than relying on the maximum numeric
value.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Tested-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Alexandr Semenikhin <alexandr2e78@gmail.com>
13 days agoconf: simplify check for vlan tagging support in virDomainActualNetDefValidate()
Laine Stump [Thu, 15 Jan 2026 00:28:17 +0000 (19:28 -0500)] 
conf: simplify check for vlan tagging support in virDomainActualNetDefValidate()

Since the only two types of bridges we support are OVS bridges and
Linux host bridges, and since both of those now support vlan tagging,
we don't need to check the virtualport type etc - if there is a bridge
specified then we know the interface will support vlan tagging.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
13 days agoconf: validate that specified interface type supports vlan tags
Laine Stump [Thu, 15 Jan 2026 00:19:38 +0000 (19:19 -0500)] 
conf: validate that specified interface type supports vlan tags

Somehow this was never done in virDomainNetDefValidate() (which is run
immediately post-parse) - it was only in
virDomainActualNetDefValidate() (which isn't done until the interface
is actually attached to the domain). While it is true that we *might*
not know if vlan tagging is supported for the interface if the
interface type == 'network', we otherwise will always know right away,
so we may as well check sooner than later.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
13 days agoqemu: use actual/effective vlan when updating OVS-based interface vlan tag
Laine Stump [Wed, 14 Jan 2026 02:00:39 +0000 (21:00 -0500)] 
qemu: use actual/effective vlan when updating OVS-based interface vlan tag

Using &newdev->vlan when updating the vlan tag causes problems if the
interface is using a libvirt virtual network to get its vlan tag
info - in this case the info won't be properly pulled from the virtual network
config, but instead it will just use the (empty)
vlan object from the netdef.

The proper thing to do is to use virDomainNetGetActualVlan(), which
will pull the vlan tag from the network definition, if applicable.

Signed-off-by: Laine Stunp <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
13 days agoqemu: update vlan tag of macvtap (direct) passthrough devices during update-device
Laine Stump [Wed, 14 Jan 2026 01:16:50 +0000 (20:16 -0500)] 
qemu: update vlan tag of macvtap (direct) passthrough devices during update-device

We already update the vlan tag of interfaces that are attached to an
OVS bridge or Linux host bridge. This patch adds the bit of code
necessary to update the vlan tag of a macvtap passthrough interface
(the only other type of interface that supports vlan tagging).

Resolves: https://issues.redhat.com/browse/RHEL-74487
Resolves: https://issues.redhat.com/browse/RHEL-7300
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
13 days agoqemu: forbid modifying network device portForwards with update-device
Laine Stump [Tue, 13 Jan 2026 05:01:18 +0000 (00:01 -0500)] 
qemu: forbid modifying network device portForwards with update-device

Prior to this patch, a network device of a running domain could be
updated to change the portForwards list, and libvirt wouldn't
complain, but the change would be silently ignored. This list is only
used by the passt backend, and passt can only change the list of
portForwards by killing and re-running the passt process, which we
don't want to do because that would destroy any open tcp session flows
in passt (ie. it would disrupt guest network traffic); we don't want
to do *that*, but we should at least let the user know that their
requested change isn't possible.

This patch checks if the portForwards list of the updated network
device exactly matches the portForwards list of the current network
device, and fails the update if they don't match.

Resolves: https://issues.redhat.com/browse/RHEL-7338
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
13 days agoconf: new function virDomainNetPortForwardIsEqual()
Laine Stump [Mon, 12 Jan 2026 20:20:39 +0000 (15:20 -0500)] 
conf: new function virDomainNetPortForwardIsEqual()

This function checks two arrays of virDomainNetPortForwards for
equality. It seemed silly to send a separate #elements for each array
just to check for their equality, but I could easily be convinced to
do it that way (rather than having the caller check for equal #element
and then just send it once).

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
13 days agoutil: fix equivalence of AF_UNSPEC virSocketAddrs
Laine Stump [Tue, 13 Jan 2026 06:03:23 +0000 (01:03 -0500)] 
util: fix equivalence of AF_UNSPEC virSocketAddrs

If a virSocketAddr has family AF_UNSPEC that means it is
unspecified/empty. If two virSocketAddrs are AF_UNSPEC then they are
equal, but virSocketAddrEqual() was countint that as *not* equal. This
doesn't make a difference for current uses of the function since they
all check that at least one of the virSocketAddrs is *not* AF_UNSPEC
before calling virSocketAddrEqual(), but an upcoming patch using
virSocketAddrEqual() will not be making that check, so let's fix the
utility function.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
13 days agonwfilter: rename ebiptables unit tests and data files
Dion Bosschieter [Thu, 11 Dec 2025 14:00:50 +0000 (15:00 +0100)] 
nwfilter: rename ebiptables unit tests and data files

Prepare for introduction of nwfilter nftables driver test files.
Create new nwfilterxml2ebipfirewalldata directory for nwfilter
ebiptables driver specific test files.
This way we split off the xml test data from the argument test
files, which are driver specific.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Dion Bosschieter <dionbosschieter@gmail.com>
2 weeks agodomain_logcontext: Don't assume remote driver is always available
Michal Privoznik [Thu, 15 Jan 2026 14:31:54 +0000 (15:31 +0100)] 
domain_logcontext: Don't assume remote driver is always available

Some functions inside of domain_logcontext.c call virLogManager
APIs. But that one is available only when remote driver is
enabled. Therefore, make domain_logcontext.c conditional, just
like log_manager.c is: if config.has('WITH_REMOTE').

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/842
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2 weeks agoqemucapabilitestest: Add 'caps_10.2.0_aarch64' test data
Peter Krempa [Tue, 13 Jan 2026 16:20:00 +0000 (17:20 +0100)] 
qemucapabilitestest: Add 'caps_10.2.0_aarch64' test data

The test dump is obtained on a Raspberry Pi 5, thus the differences in
some of the config, but using this platform will give us the possibility
to update them more frequently.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 weeks agoqemucapabilitiesdata: Regenerate 'caps_10.2.0_x86_64' replies
Peter Krempa [Tue, 13 Jan 2026 15:56:16 +0000 (16:56 +0100)] 
qemucapabilitiesdata: Regenerate 'caps_10.2.0_x86_64' replies

Update the latest x86_64 dump to populate the 'scsi-block' and
'scsi-generic' device properties.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 weeks agoqemu: capabilities: Probe properties of 'scsi-block' and 'scsi-generic' devices
Peter Krempa [Thu, 11 Dec 2025 17:43:39 +0000 (18:43 +0100)] 
qemu: capabilities: Probe properties of 'scsi-block' and 'scsi-generic' devices

Add code to probe properties of 'scsi-block' and 'scsi-generic' qemu
devices. For now the '.replies' are modified using the
'qemu-replies-tool' script and the data is annotated as fake and is in
fact missing. Further updates will populate them for any real dump.

The properties for the two devices will be later used e.g. to detect
support for persistent reservations migration support.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 weeks agoqemuSecurityMoveImageMetadata: Move seclabels only to virStorageSource of same type
Peter Krempa [Mon, 12 Jan 2026 09:54:38 +0000 (10:54 +0100)] 
qemuSecurityMoveImageMetadata: Move seclabels only to virStorageSource of same type

The concept of moving a seclabel is used e.g. when a new image is
introduced to the backing chain (or one of the existing ones becomes
active during block commit). What it does is that it moves the metedata
remembering the original seclabel to the new image.

That idea works reasonably well if both the original and new image are
of same type e.g. a file, where they have comparable seclabel.

It breaks down though when you e.g. create a snapshot stored in a 'file'
on top of a disk originally backed by a 'block' storage source, since
the seclabels differ quite siginificantly.

This patch restricts the seclabel move in qemuSecurityMoveImageMetadata
to happen only if the storage sources are of same type to avoid the
issue. This means that the seclabels will not be remebered and will be
restored to the default but it's better than to transfer wrong labels.

Resolves: https://issues.redhat.com/browse/RHEL-114412

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 weeks agoAlign help text of virt-aa-helper with actual expectated input
Erik Huelsmann [Tue, 13 Jan 2026 20:10:47 +0000 (21:10 +0100)] 
Align help text of virt-aa-helper with actual expectated input

When virt-aa-helper is invoked with a -u parameter followed by an actual UUID
as suggested by the help text, it throws an 'invalid UUID' error, even when the
UUID is the UUID of an existing VM.  With this adjustment of the help text,
there's a better chance of users providing the correct input.

Signed-off-by: Erik Huelsmann <ehuels@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 weeks agosyntax-check: Introduce sc_prohibit_g_autofree_const rule
Michal Privoznik [Thu, 8 Jan 2026 15:50:01 +0000 (16:50 +0100)] 
syntax-check: Introduce sc_prohibit_g_autofree_const rule

The aim of this rule is to capture the following pattern:

  g_autofree const char *var = ...;

The pattern is problematic, because it frees a const pointer. If
written the old way, we'd get a compiler warning:

  warning: passing argument 1 of ‘free’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2 weeks agonetwork: Drop const for forwardIf in pfAddNatFirewallRules()
Michal Privoznik [Thu, 8 Jan 2026 15:57:19 +0000 (16:57 +0100)] 
network: Drop const for forwardIf in pfAddNatFirewallRules()

The 'forwardIf' variable inside of pfAddNatFirewallRules() is
declared as both g_autofree and const. This makes no sense.
Since the variable is g_strdup()-ed into right in the
declaration, it's not const. Drop that part of variable
declaration.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2 weeks agohyperv: Drop const for resourceType in hypervDomainAttachSerial()
Michal Privoznik [Fri, 9 Jan 2026 07:13:05 +0000 (08:13 +0100)] 
hyperv: Drop const for resourceType in hypervDomainAttachSerial()

The 'resourceType' variable inside of hypervDomainAttachSerial()
is declared as both g_autofree and const. This makes no sense.
Since the variable is g_strdup_printf()-ed into a couple of lines
later, it's not const. Drop that part of variable declaration.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2 weeks agorpm: disable -Werror on ELN builds
Daniel P. Berrangé [Wed, 17 Dec 2025 14:56:49 +0000 (14:56 +0000)] 
rpm: disable -Werror on ELN builds

The ELN build root performs rebuilds of Fedora rawhide packages with
%{rhel} set instead of %{fedora}. The vast majority of the time this
will "do the right thing", but when we control -Dwerror we chose to
enable -Werror on RHEL on the basis that the GCC toolchain is stable
and thus we don't expect new warnings to appear. That does not hold
true for ELN which tracks rawhide GCC.  Thus we have the rare situation
where we should explicitly check %{eln} not just %{rhel}.

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2 weeks agoPost-release version bump to 12.1.0
Jiri Denemark [Thu, 15 Jan 2026 09:12:36 +0000 (10:12 +0100)] 
Post-release version bump to 12.1.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2 weeks agoRelease of libvirt-12.0.0 v12.0.0
Jiri Denemark [Thu, 15 Jan 2026 09:07:59 +0000 (10:07 +0100)] 
Release of libvirt-12.0.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2 weeks agoNEWS: Mention shared FS detection race
Jiri Denemark [Wed, 14 Jan 2026 13:52:08 +0000 (14:52 +0100)] 
NEWS: Mention shared FS detection race

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 weeks agoNEWS: Document features/improvements/bug fixes I've participated in
Michal Privoznik [Wed, 14 Jan 2026 07:20:20 +0000 (08:20 +0100)] 
NEWS: Document features/improvements/bug fixes I've participated in

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

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2 weeks agoNEWS: Mention JSON nesting bug and TPM migration quirk with NFS
Peter Krempa [Tue, 13 Jan 2026 13:35:49 +0000 (14:35 +0100)] 
NEWS: Mention JSON nesting bug and TPM migration quirk with NFS

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2 weeks agoTranslated using Weblate (Korean) v12.0.0-rc2
김인수 [Sun, 11 Jan 2026 00:58:28 +0000 (00:58 +0000)] 
Translated using Weblate (Korean)

Currently translated at 100.0% (11015 of 11015 strings)

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

Signed-off-by: 김인수 <simmon@nplob.com>
2 weeks agoTranslated using Weblate (Swedish)
Daniel Nylander [Sun, 11 Jan 2026 00:58:27 +0000 (00:58 +0000)] 
Translated using Weblate (Swedish)

Currently translated at 99.9% (11007 of 11015 strings)

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

Signed-off-by: Daniel Nylander <po@danielnylander.se>
2 weeks agoTranslated using Weblate (Portuguese)
Américo Monteiro [Sun, 11 Jan 2026 00:58:26 +0000 (00:58 +0000)] 
Translated using Weblate (Portuguese)

Currently translated at 100.0% (11015 of 11015 strings)

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

Signed-off-by: Américo Monteiro <a_monteiro@gmx.com>
2 weeks agonews: document bhyve new features for 12.0.0
Roman Bogorodskiy [Fri, 9 Jan 2026 17:24:08 +0000 (18:24 +0100)] 
news: document bhyve new features for 12.0.0

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2 weeks agoUpdate translation files
Hosted Weblate [Fri, 9 Jan 2026 10:59:12 +0000 (10:59 +0000)] 
Update translation files

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

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

Signed-off-by: Fedora Weblate Translation <i18n@lists.fedoraproject.org>
2 weeks agopo: Refresh potfile for v12.0.0 v12.0.0-rc1
Jiri Denemark [Fri, 9 Jan 2026 10:53:11 +0000 (11:53 +0100)] 
po: Refresh potfile for v12.0.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3 weeks agoTranslated using Weblate (Spanish)
Nicolás Gal [Thu, 8 Jan 2026 15:33:30 +0000 (15:33 +0000)] 
Translated using Weblate (Spanish)

Currently translated at 86.8% (9559 of 11005 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
3 weeks agoTranslated using Weblate (Spanish)
Fco. Javier F. Serrador [Thu, 8 Jan 2026 15:33:29 +0000 (15:33 +0000)] 
Translated using Weblate (Spanish)

Currently translated at 86.8% (9559 of 11005 strings)

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

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

Currently translated at 85.1% (9374 of 11005 strings)

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

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

Currently translated at 85.0% (9359 of 11005 strings)

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

Signed-off-by: "Fco. Javier F. Serrador" <fserrador@gmail.com>
3 weeks agoTranslated using Weblate (Spanish)
Weblate [Thu, 8 Jan 2026 15:33:29 +0000 (15:33 +0000)] 
Translated using Weblate (Spanish)

Currently translated at 85.0% (9359 of 11005 strings)

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

Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>
3 weeks agoTranslated using Weblate (English (United Kingdom))
Andi Chandler [Thu, 8 Jan 2026 15:33:28 +0000 (15:33 +0000)] 
Translated using Weblate (English (United Kingdom))

Currently translated at 47.8% (5263 of 11005 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 47.7% (5252 of 11005 strings)

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

Signed-off-by: Andi Chandler <andi@gowling.com>
3 weeks agoTranslated using Weblate (Spanish)
Nicolás Gal [Thu, 8 Jan 2026 15:33:27 +0000 (15:33 +0000)] 
Translated using Weblate (Spanish)

Currently translated at 83.3% (9175 of 11005 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
3 weeks agoTranslated using Weblate (Spanish)
Fco. Javier F. Serrador [Thu, 8 Jan 2026 15:33:26 +0000 (15:33 +0000)] 
Translated using Weblate (Spanish)

Currently translated at 83.3% (9177 of 11005 strings)

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

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

Currently translated at 82.3% (9061 of 11005 strings)

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

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

Currently translated at 79.6% (8765 of 11005 strings)

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

Signed-off-by: "Fco. Javier F. Serrador" <fserrador@gmail.com>
3 weeks agoTranslated using Weblate (Georgian)
Temuri Doghonadze [Thu, 8 Jan 2026 15:33:25 +0000 (15:33 +0000)] 
Translated using Weblate (Georgian)

Currently translated at 4.6% (514 of 11005 strings)

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

Signed-off-by: Temuri Doghonadze <temuri.doghonadze@gmail.com>
3 weeks agoTranslated using Weblate (Spanish)
Nicolás Gal [Thu, 8 Jan 2026 15:33:25 +0000 (15:33 +0000)] 
Translated using Weblate (Spanish)

Currently translated at 79.2% (8721 of 11005 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
3 weeks agoTranslated using Weblate (Czech)
Pavel Borecki [Thu, 8 Jan 2026 15:33:24 +0000 (15:33 +0000)] 
Translated using Weblate (Czech)

Currently translated at 97.5% (10740 of 11005 strings)

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

Signed-off-by: Pavel Borecki <pavel.borecki@gmail.com>
Translated using Weblate (Czech)

Currently translated at 97.5% (10738 of 11005 strings)

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

Signed-off-by: Pavel Borecki <pavel.borecki@gmail.com>
Translated using Weblate (Czech)

Currently translated at 97.2% (10705 of 11005 strings)

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

Signed-off-by: Pavel Borecki <pavel.borecki@gmail.com>
Translated using Weblate (Czech)

Currently translated at 96.9% (10670 of 11005 strings)

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

Signed-off-by: Pavel Borecki <pavel.borecki@gmail.com>
Translated using Weblate (Czech)

Currently translated at 96.1% (10577 of 11005 strings)

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

Signed-off-by: Pavel Borecki <pavel.borecki@gmail.com>
Translated using Weblate (Czech)

Currently translated at 96.0% (10575 of 11005 strings)

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

Signed-off-by: Pavel Borecki <pavel.borecki@gmail.com>
Translated using Weblate (Czech)

Currently translated at 95.8% (10546 of 11005 strings)

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

Signed-off-by: Pavel Borecki <pavel.borecki@gmail.com>
Translated using Weblate (Czech)

Currently translated at 95.7% (10539 of 11005 strings)

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

Signed-off-by: Pavel Borecki <pavel.borecki@gmail.com>
Translated using Weblate (Czech)

Currently translated at 95.6% (10523 of 11005 strings)

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

Signed-off-by: Pavel Borecki <pavel.borecki@gmail.com>
Translated using Weblate (Czech)

Currently translated at 94.4% (10394 of 11005 strings)

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

Signed-off-by: Pavel Borecki <pavel.borecki@gmail.com>
Translated using Weblate (Czech)

Currently translated at 94.1% (10361 of 11005 strings)

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

Signed-off-by: Pavel Borecki <pavel.borecki@gmail.com>
3 weeks agoTranslated using Weblate (Georgian)
Weblate [Thu, 8 Jan 2026 15:33:23 +0000 (15:33 +0000)] 
Translated using Weblate (Georgian)

Currently translated at 4.6% (514 of 11005 strings)

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

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

Currently translated at 94.1% (10360 of 11005 strings)

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

Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>
3 weeks agoTranslated using Weblate (Czech)
Pavel Borecki [Thu, 8 Jan 2026 15:33:22 +0000 (15:33 +0000)] 
Translated using Weblate (Czech)

Currently translated at 94.1% (10360 of 11005 strings)

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

Signed-off-by: Pavel Borecki <pavel.borecki@gmail.com>
3 weeks agoTranslated using Weblate (Swedish)
Daniel Nylander [Thu, 8 Jan 2026 15:33:21 +0000 (15:33 +0000)] 
Translated using Weblate (Swedish)

Currently translated at 100.0% (11005 of 11005 strings)

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

Signed-off-by: Daniel Nylander <po@danielnylander.se>
Translated using Weblate (Swedish)

Currently translated at 96.4% (10612 of 11005 strings)

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

Signed-off-by: Daniel Nylander <po@danielnylander.se>
Translated using Weblate (Swedish)

Currently translated at 95.1% (10476 of 11005 strings)

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

Signed-off-by: Daniel Nylander <po@danielnylander.se>
Translated using Weblate (Swedish)

Currently translated at 95.0% (10456 of 11005 strings)

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

Signed-off-by: Daniel Nylander <po@danielnylander.se>
3 weeks agonews: Mention improvements and fixes to firmware selection
Andrea Bolognani [Sun, 28 Dec 2025 16:46:40 +0000 (17:46 +0100)] 
news: Mention improvements and fixes to firmware selection

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 weeks agoqemu_firmware: Allow matching both UEFI and BIOS for ROM loader
Andrea Bolognani [Mon, 17 Nov 2025 17:02:15 +0000 (18:02 +0100)] 
qemu_firmware: Allow matching both UEFI and BIOS for ROM loader

Currently we apply a 1:1 mapping between loader type and firmware
type: ROM can only match BIOS and pflash can only match UEFI.

That was accurate at the time when the check was introduced, but
is no longer the case today: the Intel TDX build of edk2, for
example, is loaded as a ROM but it still provides an UEFI
implementation to the guest.

Tweak the matching logic so that a ROM loader is allowed to match
both BIOS and UEFI firmware descriptors.

The firmware-manual-efi-tdx test case benefits from this change,
as all the missing information is now correctly filled in.

This will also solve an issue reported to the list, where
firmware builds targeting the confidential VM use case on aarch64
would not be usable at all, due to the way UEFI and ACPI are
depending on each other on the architecture.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 weeks agoqemu_firmware: Don't skip autoselection for ROM
Andrea Bolognani [Mon, 17 Nov 2025 14:47:30 +0000 (15:47 +0100)] 
qemu_firmware: Don't skip autoselection for ROM

It's possible to have firmware descriptors for builds intended to
be loaded as ROM, as is the case for those loaded as pflash.
There is no reason to skip firmware autoselection in those cases,
and doing so prevents useful information from being filled in.

After this change, the firmware-manual-efi-tdx test case is
augmented with some additional information. Even more information
will be filled in later, when we improve the matching logic.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 weeks agoqemu_firmware: ROM firmware is always in raw format
Andrea Bolognani [Mon, 17 Nov 2025 19:17:45 +0000 (20:17 +0100)] 
qemu_firmware: ROM firmware is always in raw format

By definition.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>