]> git.ipfire.org Git - thirdparty/libvirt.git/log
thirdparty/libvirt.git
2 months agoqemuProcessReconnect: Modernize local variable setup
Peter Krempa [Thu, 15 May 2025 15:00:55 +0000 (17:00 +0200)] 
qemuProcessReconnect: Modernize local variable setup

Assign local variables directly and use autofree for temproary ones.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 months agoqemuDomainRemoveInactiveLocked: Remove 'driver' argument
Peter Krempa [Thu, 15 May 2025 14:57:19 +0000 (16:57 +0200)] 
qemuDomainRemoveInactiveLocked: Remove 'driver' argument

The function can extract the value from @vm's private data.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 months agoqemuProcessStop: Drop 'driver' argument
Peter Krempa [Thu, 15 May 2025 14:48:44 +0000 (16:48 +0200)] 
qemuProcessStop: Drop 'driver' argument

For now it's extracted as a temporary variable but in long term it ought
to be eliminated.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 months agoqemuDomainRemoveInactiveCommon: Remove 'driver' argument
Peter Krempa [Thu, 15 May 2025 14:38:03 +0000 (16:38 +0200)] 
qemuDomainRemoveInactiveCommon: Remove 'driver' argument

The function can fetch it from @vm.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 months agoqemuSnapshotDiscardAllMetadata: Remove 'driver' argument
Peter Krempa [Thu, 15 May 2025 14:32:11 +0000 (16:32 +0200)] 
qemuSnapshotDiscardAllMetadata: Remove 'driver' argument

The function can extract it from @vm.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 months agoqemuCheckpointDiscardAllMetadata: Remove 'driver' argument
Peter Krempa [Thu, 15 May 2025 14:32:11 +0000 (16:32 +0200)] 
qemuCheckpointDiscardAllMetadata: Remove 'driver' argument

The function can extract it from @vm.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 months agoqemuExtDevicesCleanupHost: Use 'virQEMUDriverConfig' instead of 'virQEMUDriver'
Peter Krempa [Thu, 15 May 2025 14:24:29 +0000 (16:24 +0200)] 
qemuExtDevicesCleanupHost: Use 'virQEMUDriverConfig' instead of 'virQEMUDriver'

Refactor the function and all callees to use the driver config instead.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 months agoqemuProcessStartWithMemoryState: Rename 'snapshot' to 'internalSnapshotRevert'
Peter Krempa [Tue, 13 May 2025 17:05:31 +0000 (19:05 +0200)] 
qemuProcessStartWithMemoryState: Rename 'snapshot' to 'internalSnapshotRevert'

Make it obvious that the variable is used for internal snapshot
reversion by renaming it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 months agoqemuProcessStart: Rename 'snapshot' to 'internalSnapshotRevert'
Peter Krempa [Tue, 13 May 2025 17:05:31 +0000 (19:05 +0200)] 
qemuProcessStart: Rename 'snapshot' to 'internalSnapshotRevert'

Make it obvious that the variable is used for internal snapshot
reversion by renaming it. This is necessary mainly as the function
parameters are not documented, but makes it obvious also if they were.

We can also report the name of the sanpshot rather than a pointer that
says absolutely nothing to the reader.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 months agoqemuProcessLaunch: Rename 'snapshot' to 'internalSnapshotRevert'
Peter Krempa [Tue, 13 May 2025 17:05:31 +0000 (19:05 +0200)] 
qemuProcessLaunch: Rename 'snapshot' to 'internalSnapshotRevert'

Make it obvious that the variable is used for internal snapshot
reversion by renaming it. This is necessary mainly as the function
parameters are not documented, but makes it obvious also if they were.

We can also report the name of the sanpshot rather than a pointer that
says absolutely nothing to the reader.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 months agoqemuBuildCommandLine: Drop 'snapshot' argument
Peter Krempa [Tue, 13 May 2025 15:12:09 +0000 (17:12 +0200)] 
qemuBuildCommandLine: Drop 'snapshot' argument

After recent refactors that removed legacy way to revert snapshots we no
longer need to know the snapshot state during commandline build.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 months agoqemuSnapshotRevertInactive: Ensure all error paths handle transient domains properly
Peter Krempa [Thu, 15 May 2025 14:12:31 +0000 (16:12 +0200)] 
qemuSnapshotRevertInactive: Ensure all error paths handle transient domains properly

Only the internal snapshot code paths were able to handle transient
domains properly in case when startup of the process failed.

Unify the error paths on an 'error' label with proper handling.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 months agoqemuSnapshotRevertActive: Remove transient domain on failure
Peter Krempa [Thu, 15 May 2025 06:21:49 +0000 (08:21 +0200)] 
qemuSnapshotRevertActive: Remove transient domain on failure

Code paths which deal with stopping of the qemu process need extra
handling for transient definitions as they need to be removed from the
domain list when we'd be leaving them inactive.

In case of snapshot code it's on failure to revert a snapshot as we stop
the qemu process but the failure to revert may mean that the new process
will not be started.

I've observed this when I was fixing the recent bug in snapshot
reversion which left the domain in unusable state after failure to
revert:

 $ virsh list foo
 error: Requested operation is not valid: domain is not running

 $ virsh undefine foo
 error: Requested operation is not valid: cannot undefine transient domain

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 months agoNEWS: Mention fix for internal snapshot reversion regression
Peter Krempa [Thu, 15 May 2025 08:54:18 +0000 (10:54 +0200)] 
NEWS: Mention fix for internal snapshot reversion regression

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 months agoqemuProcessStartWithMemoryState: Don't setup qemu for incoming migration when reverti...
Peter Krempa [Tue, 13 May 2025 17:07:20 +0000 (19:07 +0200)] 
qemuProcessStartWithMemoryState: Don't setup qemu for incoming migration when reverting internal snapshot

The memory/device state of the VM for an internal snapshot is restored
by qemu itself via a QMP command and is taken from the qcow2 image, thus
we don't actually do any form of incoming migration.

Commit 5b324c0a739fe00 which refactored the setup of the incoming
migration state didn't take the above into account and inadvertently
caused that qemu is being started with '-incoming defer' also when
libvirt would want to revert an internal snapshot.

Now when qemu expects incoming migration it doesn't activate the block
backends as that would cause locking problems and image inconsistency,
but also doesn't allow the use of the images. Since the block backends
are not activated qemu then thinks that they don't actually support
internal snapshots and reports:

  error: operation failed: load of internal snapshot 'foo1' job failed: Device 'libvirt-1-format' is writable but does not support snapshots

Due to the above bug it's not possible to revert to internal snapshots
in libvirt-11.2 and libvirt-11.3.

Fixes: 5b324c0a739fe00cbec209219db4488742492112
Resolves: https://issues.redhat.com/browse/RHEL-88747
Closes: https://gitlab.com/libvirt/libvirt/-/issues/771
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 months agocpu_x86: Do not inline cpuidCall()
Fabio Estevam [Fri, 16 May 2025 11:56:22 +0000 (08:56 -0300)] 
cpu_x86: Do not inline cpuidCall()

The following build error is observed when the DEBUG_BUILD variable
is enabled in OpenEmbedded:

src/cpu/cpu_x86.c: In function 'cpuidSetLeaf4':
src/cpu/cpu_x86.c:2563:1: error: inlining failed in call to 'cpuidCall': function not considered for inlining [-Werror=inline]
 2563 | cpuidCall(virCPUx86CPUID *cpuid)
      | ^~~~~~~~~

Remove the 'inline' specifier to avoid the problem.

Reported-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 months agospec: Bump min_fedora
Michal Privoznik [Thu, 15 May 2025 12:51:51 +0000 (14:51 +0200)] 
spec: Bump min_fedora

Fedora 40 is now officially at end of life [1]. The minimal
version we aim to support upstream is thus Fedora 41. Reflect
this in the spec file.

1: https://lists.fedoraproject.org/archives/list/devel-announce@lists.fedoraproject.org/thread/XCUBN7NR7LXFFSA3IJDRTGHC7K4CXARV/

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 months agospec: Bump min_rhel
Michal Privoznik [Thu, 15 May 2025 12:48:23 +0000 (14:48 +0200)] 
spec: Bump min_rhel

RHEL-8 is out of our support scope. The minimal version we aim to
support upstream is RHEL-9. Reflect this in the spec file.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 months agoci: refresh with 'lcitool manifest'
Michal Privoznik [Thu, 15 May 2025 12:09:09 +0000 (14:09 +0200)] 
ci: refresh with 'lcitool manifest'

- Add Fedora 42
- Remove EOL Fedora 40
- Switch mingw from Fedora 41 to Fedora 42

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 months agotests: Add pcihole64 test for virt machine
Matthew R. Ochs [Thu, 15 May 2025 14:48:53 +0000 (07:48 -0700)] 
tests: Add pcihole64 test for virt machine

Add a pcihole64 test for the aarch64 virt machine that verifies the
value is propagated to the highmem-mmio-size virt machine parameter.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Matthew R. Ochs <mochs@nvidia.com>
2 months agoqemu: Add command line support for PCI high memory MMIO size
Matthew R. Ochs [Thu, 15 May 2025 14:48:47 +0000 (07:48 -0700)] 
qemu: Add command line support for PCI high memory MMIO size

Add support for generating QEMU command line with PCI high memory MMIO size:
    - Add highmem-mmio-size to machine command line generation using
      size conveyed through pcihole64
    - Add validation for aarch64/virt machine type requirement
    - Add capability check for QEMU support

This enables configuring the PCI high memory MMIO window size
for aarch64 virt machine types using the existing pcihole64
element.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Matthew R. Ochs <mochs@nvidia.com>
2 months agoqemu: Add capability for PCI high memory MMIO size
Matthew R. Ochs [Thu, 15 May 2025 14:48:41 +0000 (07:48 -0700)] 
qemu: Add capability for PCI high memory MMIO size

Add QEMU capability for PCI high memory MMIO size configuration:
- Add QEMU_CAPS_MACHINE_VIRT_HIGHMEM_MMIO_SIZE capability
- Add capability to virt machine properties
- Add highmem-mmio-size virt machine property to aarch64 qemu
      10.0.0 capabilities

This allows detecting support for the highmem-mmio-size virt machine
property in QEMU.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Matthew R. Ochs <mochs@nvidia.com>
2 months agoch: Support RNG device
Stefan Kober [Fri, 16 May 2025 07:57:30 +0000 (09:57 +0200)] 
ch: Support RNG device

Cloud Hypervisor supports virtio-rng devices and the configuration of
the randomness source (e.g. /dev/random or /dev/urandom).

This commit adds support for configuring the RNG device via libvirt for
the ch driver.

Signed-off-by: Stefan Kober <stefan.kober@cyberus-technology.de>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 months agorpc: Add the {repoll,retry} logic in virNetClientSetTLSSession
Hyman Huang [Thu, 15 May 2025 01:07:41 +0000 (09:07 +0800)] 
rpc: Add the {repoll,retry} logic in virNetClientSetTLSSession

As advised by the GNU TLS, the caller should attempt again
if the gnutls_record_{recv,send} return EAGAIN or EINTR;
check the following link to view the details:
https://www.gnutls.org/manual/html_node/Data-transfer-and-termination.html

virNetClientSetTLSSession failed to handle EINTR/EGAIN,
though EGAIN seems like it ought to be unlikely given that
the caller waited for G_IO_IN.

Add the {repoll, retry} logic to handle EINTR/EGAIN that
may happen theoretically. This may reduce the likelihood
that the upper application receives the following error
message utmostly when it calls the virConnectOpenAuth API:
Unable to read TLS confirmation: Resource temporarily unavailable

Note that in order to fully avoid the mentioned problem, the
upper application should retry virConnectOpenAuth.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Hyman Huang <yong.huang@smartx.com>
2 months agosrc: Fix retval of some functions declared to return an int
Michal Privoznik [Wed, 14 May 2025 14:14:39 +0000 (16:14 +0200)] 
src: Fix retval of some functions declared to return an int

There are couple of functions (virCHDomainPrepareHostdevPCI(),
qemuDomainPrepareHostdevPCI(),
virStorageBackendRBDSetAllocation(), virCommandHandshakeChild())
that are declared to return an integer, but in fact return a
boolean. This may lead to incorrect behaviour. Fix their retvals.

This diff was generated using the following semantic patch:

  @@
  identifier foo;
  @@

  int foo(...) {
      <+...
  (
  -   return true;
  +   return 0;
  |
  -   return false;
  +   return -1;
  )
      ...+>
  }

Each function and its callers were then inspected to see what
retvals are expected.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 months agovirsh-pool.c: Fix return type of virshBuildPoolXML()
Michal Privoznik [Wed, 14 May 2025 13:48:40 +0000 (15:48 +0200)] 
virsh-pool.c: Fix return type of virshBuildPoolXML()

The virshBuildPoolXML() function is declared to return an int but
in fact its return type is a boolean. Even its both callers
(cmdPoolCreateAs() and cmdPoolDefineAs()) treat its retval as a
boolean. Switch the return type from integer to boolean.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 months agovirnetdevvlan: Fix return type of virNetDevVlanEqual()
Michal Privoznik [Wed, 14 May 2025 13:46:16 +0000 (15:46 +0200)] 
virnetdevvlan: Fix return type of virNetDevVlanEqual()

The virNetDevVlanEqual() function is declared to return an int
but in fact its return type is a boolean. Even its only caller
(qemuDomainChangeNet()) treats its retval as a boolean. Switch
the return type from integer to boolean.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 months agostorage_backend_rbd.C: Fix return type of a volStorageBackendRBDUseFastDiff() stub
Michal Privoznik [Wed, 14 May 2025 13:40:40 +0000 (15:40 +0200)] 
storage_backend_rbd.C: Fix return type of a volStorageBackendRBDUseFastDiff() stub

Inside of storage_backend.c there are two implementations of
volStorageBackendRBDUseFastDiff() function: one when librbd is
new enough and one when it isn't. The former returns a bool, but
the latter is declared to return an int despite it returning a
boolean. Fix the latter.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 months agoqemu_process: Fix return type of qemuDomainHasHotpluggableStartupVcpus()
Michal Privoznik [Wed, 14 May 2025 13:40:18 +0000 (15:40 +0200)] 
qemu_process: Fix return type of qemuDomainHasHotpluggableStartupVcpus()

The qemuDomainHasHotpluggableStartupVcpus() function is declared
to return an int but in fact its return type is a boolean. Even
its only caller (qemuProcessLaunch()) treats its retval as a
boolean. Switch the return type from integer to boolean.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 months agonwfilter: Fix return type of virNWFilterCanApplyBasicRules callback
Michal Privoznik [Wed, 14 May 2025 13:35:01 +0000 (15:35 +0200)] 
nwfilter: Fix return type of virNWFilterCanApplyBasicRules callback

The virNWFilterCanApplyBasicRules() callback returns an int but
in fact its return type is a boolean. Even its only
implementation (ebiptablesCanApplyBasicRules()) returns a
boolean. Switch the return type from integer to boolean.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 months agostorage_backend_rbd.c: Make virStorageBackendRBDSetAllocation() stub report an error
Michal Privoznik [Wed, 14 May 2025 13:51:18 +0000 (15:51 +0200)] 
storage_backend_rbd.c: Make virStorageBackendRBDSetAllocation() stub report an error

Inside of storage_backend_rbd.c there are two implementations of
virStorageBackendRBDSetAllocation(). One reports an error on
failure, so the stub implementation should report an error too.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 months agovirDomainNetDefCheckABIStability: Consider virtio 'queues' ABI
Peter Krempa [Tue, 13 May 2025 12:03:48 +0000 (14:03 +0200)] 
virDomainNetDefCheckABIStability: Consider virtio 'queues' ABI

While the queue count itself is not a guest visible property, libvirt
uses it to calculate the 'vectors' property of the 'virtio-net' device
which is ABI.

Since we don't expose control of 'vectors' explicitly, consider 'queues'
ABI.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2 months agovirNetDevTapCreate: Use error message hinting to multiqueue use only when opening...
Peter Krempa [Tue, 13 May 2025 11:44:27 +0000 (13:44 +0200)] 
virNetDevTapCreate: Use error message hinting to multiqueue use only when opening multiple queues

Due to a logic bug the error message mentioning multi queue operation
would be emitted also when a single queue would be opened on an
externally managed tap device.

Adjust the condition to trigger only when multiple queues are in use.

Fixes: f6fb097e11a
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2 months agodocs: man: Document '--once' for 'virsh autostart'
Peter Krempa [Mon, 5 May 2025 14:39:25 +0000 (16:39 +0200)] 
docs: man: Document '--once' for 'virsh autostart'

Document the '--once' option and how it combines with the setting
without '--once'.

Resolves: https://issues.redhat.com/browse/RHEL-89414
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 months agoAPI: Clarify behaviour of autostart vs autostart once
Peter Krempa [Mon, 5 May 2025 14:33:32 +0000 (16:33 +0200)] 
API: Clarify behaviour of autostart vs autostart once

If either of the autostart settings is enabled the VM will be
autostarted. Attempt to clarify that.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 months agoqemuDomainPrepareHostdevPCI: Simplify error messages
Peter Krempa [Mon, 12 May 2025 13:21:07 +0000 (15:21 +0200)] 
qemuDomainPrepareHostdevPCI: Simplify error messages

Rework the error reporting. Unify on one message about device assignment
modes not supported by the qemu driver and move and reword the messages
for VFIO device assignment.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 months agoqemuDomainPrepareHostdevPCI: Fix return values after conversion from bool to int
Peter Krempa [Mon, 12 May 2025 13:06:32 +0000 (15:06 +0200)] 
qemuDomainPrepareHostdevPCI: Fix return values after conversion from bool to int

Historically when the code was in 'qemuHostdevPreparePCIDevicesCheckSupport'
the function returned bools. Later it was refactored and moved to
'qemuDomainPrepareHostdevPCI' the return values were not changed.

Thus the function now returned '-1', 'false', and 'true'. Callers
checked for '-1' only so the few cases forbidding legacy device
passthrough were no longer causing fatal errors.

Fixes: 3b87709c768480e085556e06bd8d08f62270d42d
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 months agovirnetdevtap: Fix memory leak in virNetDevTapReattachBridge
QiangWei Zhang [Tue, 6 May 2025 10:33:01 +0000 (18:33 +0800)] 
virnetdevtap: Fix memory leak in virNetDevTapReattachBridge

Variable 'master' needs to be free because it will be reassigned in
virNetDevOpenvswitchInterfaceGetMaster().

The leaked stack:
Direct leak of 11 byte(s) in 1 object(s) allocated from:
    #0 0x7f7dad8ba6df in __interceptor_malloc (/lib64/libasan.so.8+0xba6df)
    #1 0x7f7dad715728 in g_malloc (/lib64/libglib-2.0.so.0+0x60728)
    #2 0x7f7dad72d8b2 in g_strdup (/lib64/libglib-2.0.so.0+0x788b2)
    #3 0x7f7dacb63088 in g_strdup_inline /usr/include/glib-2.0/glib/gstrfuncs.h:321
    #4 0x7f7dacb63088 in virNetDevGetName ../src/util/virnetdev.c:823
    #5 0x7f7dacb63886 in virNetDevGetMaster ../src/util/virnetdev.c:909
    #6 0x7f7dacb90288 in virNetDevTapReattachBridge ../src/util/virnetdevtap.c:527
    #7 0x7f7dacd5cd67 in virDomainNetNotifyActualDevice ../src/conf/domain_conf.c:30505
    #8 0x7f7da3a10bc3 in qemuProcessNotifyNets ../src/qemu/qemu_process.c:3290
    #9 0x7f7da3a375c6 in qemuProcessReconnect ../src/qemu/qemu_process.c:9211
    #10 0x7f7dacc0cc53 in virThreadHelper ../src/util/virthread.c:256
    #11 0x7f7dac2875d4 in start_thread (/lib64/libc.so.6+0x875d4)
    #12 0x7f7dac3091bb in __GI___clone3 (/lib64/libc.so.6+0x1091bb)

Fixes: de938b92c9d3a47647164aa643c20d2fc96cd2bc
Signed-off-by: QiangWei Zhang <zhang.qiangwei@zte.com.cn>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 months agovirnetlink: Split virNetlinkBridgeVlanFilterSet()
Michal Privoznik [Mon, 12 May 2025 13:00:04 +0000 (15:00 +0200)] 
virnetlink: Split virNetlinkBridgeVlanFilterSet()

Currently, virNetlinkBridgeVlanFilterSet() takes @cmd as the
second argument where either RTM_SETLINK or RTM_DELLINK is
expected. Both of these constants come from linux/rtnetlink.h and
thus are undefined when building without netlink. This design
also clashes with the whole point of virnetlink: to offload
netlink dependency onto a single file.

Therefore, drop the argument, turn
virNetlinkBridgeVlanFilterSet() into just setter, effectively,
and introduce virNetlinkBridgeVlanFilterDel() for the case when
RTM_DELLINK would be passed as @cmd.

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/770
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 months agovirnetdevbridge: Include virnetlink.h more often
Michal Privoznik [Mon, 12 May 2025 12:29:21 +0000 (14:29 +0200)] 
virnetdevbridge: Include virnetlink.h more often

The whole point of virnetlink.h is that it hides away the build
time dependency on netlink. It wraps netlink functions in our
functions which then have a stub implementation in case netlink
support was disabled.

Though, netlink is still Linux specific, so keep it in the
'#ifdef __linux__` block to cause a compilation error should
anybody try to use any of the wrapped functions on non-Linux.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 months agovirnetdevbridge.c: Fix comments in virNetDevBridgeSetupVlans()
Michal Privoznik [Mon, 12 May 2025 12:27:58 +0000 (14:27 +0200)] 
virnetdevbridge.c: Fix comments in virNetDevBridgeSetupVlans()

We still use C89 style of comments. Fix C99 style of comments
used in virNetDevBridgeSetupVlans().

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 months agovirnetlink: Provide stub for virNetlinkBridgeVlanFilterSet()
Michal Privoznik [Mon, 12 May 2025 12:28:42 +0000 (14:28 +0200)] 
virnetlink: Provide stub for virNetlinkBridgeVlanFilterSet()

In virnetlink.c there are two sections: the first one when
building WITH_LIBNL support, the other that provides stubs for
functions declared in the corresponding header file when building
without netlink support. But the stub implementation for
virNetlinkBridgeVlanFilterSet() was missing.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 months agorpm: disable zfs on Fedora >= 43
Daniel P. Berrangé [Thu, 8 May 2025 10:16:30 +0000 (11:16 +0100)] 
rpm: disable zfs on Fedora >= 43

The zfs-fuse package has been dead upstream for a long time and is
now retired in Fedora rawhide.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2 months agotests: Add capabilities for QEMU 10.0.0 on aarch64
Matthew R. Ochs [Wed, 7 May 2025 23:38:46 +0000 (16:38 -0700)] 
tests: Add capabilities for QEMU 10.0.0 on aarch64

Notable differences:

  * various machine types, notably vexpress-a9, have stopped
    accepting user-specified CPU models in QEMU 9.0;

  * the command line for raw devices is slightly different
    as libvirt now skips the 'raw' format driver blockdev.

Signed-off-by: Matthew R. Ochs <mochs@nvidia.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 months agotests: Use collie instead of borzoi for aarch64 tests
Andrea Bolognani [Thu, 27 Feb 2025 10:35:07 +0000 (11:35 +0100)] 
tests: Use collie instead of borzoi for aarch64 tests

The borzoi machine type was dropped in QEMU 9.2.0, so let's
use a different machine type with no ACPI support and no
implicit USB controller instead.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 months agoqemu_capabilities: Fetch caps for virtio-mem-ccw too
Michal Privoznik [Wed, 7 May 2025 12:32:52 +0000 (14:32 +0200)] 
qemu_capabilities: Fetch caps for virtio-mem-ccw too

While with upstream QEMU it's impossible to have virtio-mem-ccw and not
have virtio-mem-pci, in RHEL the QEMU's build system is patched to make
that possible. But this breaks our assumption when fetching
capabilities.

Well, just do what we are already doing in this situation (e.g.
"virtio-blk-pci"/"virtio-blk-ccw" & virQEMUCapsDevicePropsVirtioBlk, or
"virtio-scsi-pci"/"virtio-net-ccw" & virQEMUCapsDevicePropsVirtioSCSI):
fetch the same set of props for both devices.

Resolves: https://issues.redhat.com/browse/RHEL-87528
Resolves: https://issues.redhat.com/browse/RHEL-87532

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 months agoci: refresh with 'lcitool manifest'
Daniel P. Berrangé [Fri, 2 May 2025 08:29:08 +0000 (09:29 +0100)] 
ci: refresh with 'lcitool manifest'

This removes librbd from 32-bit arches on debian sid, which no longer
exists.

Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 months agodocs: hooks: Document when shutoff-reason argument was introduced
Michal Privoznik [Mon, 5 May 2025 08:51:52 +0000 (10:51 +0200)] 
docs: hooks: Document when shutoff-reason argument was introduced

Introduced in v10.5.0-rc1~52, qemu and lxc hook scripts are
executed with additional argument: shutoff reason. But wording of
our docs make it looks like it's been that way forever. Make it
clear this is `recent` feature.

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/766
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 months agocpu_x86: Fix algorithm for computing CPU model weight
Jiri Denemark [Wed, 23 Apr 2025 12:58:41 +0000 (14:58 +0200)] 
cpu_x86: Fix algorithm for computing CPU model weight

This patch is effectively a NOP, but it fixes a logic bug and makes the
heuristics more visible and easier to change should there be a need to
do so in the future.

We decide which CPU model is the best match for given CPU data by
comparing lists of features that need to be enabled/disabled on top of
the selected CPU model. Since the original approach of using just the
total number of features was not working well enough, commit
v8.3.0-42-g48341b025a implemented a penalty for disabled features which
would increase for each additional disabled features. Apparently the
intention was weighting disabled features as

                      disabled * (disabled + 3)
    weightDisabled =  -------------------------
                                2

and complete CPU model as

    weight = enabled + weightDisabled

But there was a bug in the code which caused it to ignore some of the
features and counted as enabled regardless on their policy. Instead of
going through all features the code used the number of "enabled"
features (the variable was not really counting number of enabled
features though) which was initialized to the total number of features
and decremented each time a disabled features was found. Thus depending
on the number of disabled features, some features at the end of the list
were ignored. Luckily we know all the ignored features had to be
disabled because the CPU definitions were created by x86DataToCPU which
constructs a list of enabled features followed by disabled features.

So to fix the bug while providing the same results we can come up with
an equivalent formula using properly counted features in the CPU
definition.

The number of disabled features counted by the buggy code is

    half = (disabled + 1) div 2

and the weight of all disabled features is

                     half * (half + 3)
    weightDisabled = -----------------
                            2

When computing the total weight, we can't no longer use number of
enabled features because the original code counted some of the disabled
features as enabled. So to match the old behavior, we count the total
weight as

    weight = features - half + weightDisabled

The weight of enabled features now differs from the value computed by
the old code, but we don't need to worry about it as it's not really
used anywhere except for logging.

Fixes: https://gitlab.com/libvirt/libvirt/-/issues/759
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 months agocpu_x86: Refactor virCPUx86CompareCandidateFeatureList
Jiri Denemark [Wed, 16 Apr 2025 12:30:12 +0000 (14:30 +0200)] 
cpu_x86: Refactor virCPUx86CompareCandidateFeatureList

Refactor weight calculation to a separate virCPUx86WeightFeatures
function to avoid code duplication. The algorithm is not changed during
the refactoring, it will be fixed later.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 months agocputest: Add data for a newer version of Intel Atom(R) P5362 CPU
Jiri Denemark [Fri, 25 Apr 2025 12:57:50 +0000 (14:57 +0200)] 
cputest: Add data for a newer version of Intel Atom(R) P5362 CPU

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 months agocputest: Add data for Intel(R) Xeon(R) w7-3465X CPU
Jiri Denemark [Fri, 25 Apr 2025 06:00:23 +0000 (08:00 +0200)] 
cputest: Add data for Intel(R) Xeon(R) w7-3465X CPU

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 months agocputest: Add data for Intel(R) Xeon(R) Gold 6530 CPU
Jiri Denemark [Thu, 24 Apr 2025 21:50:42 +0000 (23:50 +0200)] 
cputest: Add data for Intel(R) Xeon(R) Gold 6530 CPU

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 months agocputest: Add data for Intel(R) Xeon(R) Bronze 3408U CPU
Jiri Denemark [Thu, 24 Apr 2025 14:04:59 +0000 (16:04 +0200)] 
cputest: Add data for Intel(R) Xeon(R) Bronze 3408U CPU

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 months agocputest: Add data for Intel(R) Xeon(R) 6731E CPU
Jiri Denemark [Thu, 24 Apr 2025 14:03:40 +0000 (16:03 +0200)] 
cputest: Add data for Intel(R) Xeon(R) 6731E CPU

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 months agocputest: Add data for AMD EPYC 9334 32-Core CPU
Jiri Denemark [Thu, 24 Apr 2025 14:01:55 +0000 (16:01 +0200)] 
cputest: Add data for AMD EPYC 9334 32-Core CPU

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 months agocputest: Add data for Intel(R) Xeon(R) Gold 6152 CPU
Jiri Denemark [Thu, 24 Apr 2025 08:26:30 +0000 (10:26 +0200)] 
cputest: Add data for Intel(R) Xeon(R) Gold 6152 CPU

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 months agocputest: Add data for AMD Ryzen 5 5500U CPU
Jiri Denemark [Wed, 23 Apr 2025 14:13:42 +0000 (16:13 +0200)] 
cputest: Add data for AMD Ryzen 5 5500U CPU

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 months agocputest: Add data for AMD EPYC 7713 64-Core CPU
Jiri Denemark [Wed, 23 Apr 2025 14:11:17 +0000 (16:11 +0200)] 
cputest: Add data for AMD EPYC 7713 64-Core CPU

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 months agocputest: Add data for Intel(R) Xeon(R) Silver 4214R CPU
Jiri Denemark [Wed, 23 Apr 2025 13:48:25 +0000 (15:48 +0200)] 
cputest: Add data for Intel(R) Xeon(R) Silver 4214R CPU

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 months agocputest: Add data for Intel(R) Xeon(R) CPU E3-1270 v5 CPU
Jiri Denemark [Wed, 23 Apr 2025 13:47:42 +0000 (15:47 +0200)] 
cputest: Add data for Intel(R) Xeon(R) CPU E3-1270 v5 CPU

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 months agocputest: Add data for Intel(R) Core(TM) i7-1365U CPU
Jiri Denemark [Fri, 25 Apr 2025 13:15:37 +0000 (15:15 +0200)] 
cputest: Add data for Intel(R) Core(TM) i7-1365U CPU

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 months agocputest: Add data for Intel(R) Core(TM) i7-1270P CPU
Jiri Denemark [Fri, 25 Apr 2025 13:04:06 +0000 (15:04 +0200)] 
cputest: Add data for Intel(R) Core(TM) i7-1270P CPU

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 months agotests: update capabilities for QEMU 10.0.0 on s390x
Shalini Chellathurai Saroja [Wed, 30 Apr 2025 13:47:31 +0000 (15:47 +0200)] 
tests: update capabilities for QEMU 10.0.0 on s390x

Update the replies and xml files for QEMU 10.0.0 on s390x based on
the released QEMU tag v10.0.0 with the commit Id
7c949c53e936aa3a658d84ab53bae5cadaa5d59c.

Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 months agoqemuxmlactivetest: Don't segfault when capability XMLs are invalid
Peter Krempa [Thu, 24 Apr 2025 13:40:12 +0000 (15:40 +0200)] 
qemuxmlactivetest: Don't segfault when capability XMLs are invalid

This is purely a devel-time problem in the test suite.

'qemuxmlactivetest' invokes the whole test worker twice, once for
inactive output and second time for active.

Now 'testQemuInfoInitArgs' returns a failure if the XML is invalid and
the test is skipped. On another invocation though it returns 0 if
'testQemuInfoSetArgs' was not invoked meanwhile and thus makes it seem
it succeeded which leads to a crash in the code assuming that some
pointers are valid.

Use same interlocking as 'qemuxmlconftest' to skip the second invocation
on failure of the first one.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 months agodomaincapstest: Remove XMLs for already dropped qemu versions (4.2.0 - 5.1.0)
Peter Krempa [Mon, 28 Apr 2025 07:34:50 +0000 (09:34 +0200)] 
domaincapstest: Remove XMLs for already dropped qemu versions (4.2.0 - 5.1.0)

The files were forgotten after the previous bump to use qemu-5.2 as
minimum. The data for qemu-5.2, qemu-6.0, and qemu-6.1 was already
removed when bumping to qemu-6.2.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 months agoqemucapabilitiesdata: Enable GTK graphics for 'caps_10.0.0_x86_64'
Peter Krempa [Mon, 28 Apr 2025 12:19:32 +0000 (14:19 +0200)] 
qemucapabilitiesdata: Enable GTK graphics for 'caps_10.0.0_x86_64'

The common x86_64 test output was usually built without GTK as I've had
that in my build script for a long time. Enable it now as GTK UI is
enabled by many distros and upcoming patches plan to add support to
libvirt as well.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 months agoscripts: Adapt mock-noinline.py to ATTRIBUTE_MOCKABLE
Michal Privoznik [Mon, 28 Apr 2025 11:56:09 +0000 (13:56 +0200)] 
scripts: Adapt mock-noinline.py to ATTRIBUTE_MOCKABLE

The script is renamed to mockable-attribute.py and adjusted to
check for the new attribute.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 months agosrc: s/G_NO_INLINE/ATTRIBUTE_MOCKABLE/
Michal Privoznik [Mon, 28 Apr 2025 09:58:39 +0000 (11:58 +0200)] 
src: s/G_NO_INLINE/ATTRIBUTE_MOCKABLE/

Per change in coding style done in previous commit,
ATTRIBUTE_MOCKABLE should be used instead of G_NO_INLINE for
functions that are mocked in our test suite. Do the change.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 months agointernal: Introduce ATTRIBUTE_MOCKABLE
Michal Privoznik [Mon, 28 Apr 2025 08:49:57 +0000 (10:49 +0200)] 
internal: Introduce ATTRIBUTE_MOCKABLE

Currently, if we want to mock a function the noinline attribute
is appended after the function (via G_NO_INLINE macro). This used
to work for non pure functions. But there are some trivial
functions (for instance virQEMUCapsProbeHVF()) that are pure,
i.e. have no side effect, and while their call from other parts
of the code is not optimized out, their call from within the same
compilation unit (qemu_capabilities.c) is optimized out.

This is because inlining and semantic interposition are two
different things. Even GCC's documentation for noinline attribute
[1] states that clearly:

  This function attribute prevents a function from being
  considered for inlining. It also disables some other
  interprocedural optimizations; it’s preferable to use the more
  comprehensive noipa attribute instead if that is your goal.

  Even if a function is declared with the noinline attribute,
  there are optimizations other than inlining that can cause
  calls to be optimized away if it does not have side effects,
  although the function call is live.

Unfortunately, despite attempts [2] Clang still does not support
the attribute and thus we have to rely on noinline +
-fsemantic-interposition combo.

1: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-noinline-function-attribute
2: https://reviews.llvm.org/D101011

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 months agoopenvz: stop hardcoding vzlist/vzctl/vzmigrate paths
Daniel P. Berrangé [Tue, 29 Apr 2025 10:59:41 +0000 (11:59 +0100)] 
openvz: stop hardcoding vzlist/vzctl/vzmigrate paths

Allow virCommand to find them in $PATH, which will always include 'sbin'
since the openvz driver only operates in system mode.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 months agoutil: stop hardcoding pkttyagent path
Daniel P. Berrangé [Tue, 29 Apr 2025 10:59:41 +0000 (11:59 +0100)] 
util: stop hardcoding pkttyagent path

Allow virCommand to find it in $PATH

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 months agostorage: stop hardcoding LVM tool paths
Daniel P. Berrangé [Tue, 29 Apr 2025 10:47:27 +0000 (11:47 +0100)] 
storage: stop hardcoding LVM tool paths

Change the meson rules to always enable the LVM driver if on a
Linux host, unless the meson options say not to.

The virCommand APIs will return suitable runtime errors if the
tools are not installed.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 months agomeson: stop setting conf var for optional programs
Daniel P. Berrangé [Mon, 28 Apr 2025 16:19:14 +0000 (17:19 +0100)] 
meson: stop setting conf var for optional programs

There is no reference to AUGPARSE, BLACK, FLAKE8, PDWTAGS or PYTEST conf
variables anywhere, only the ${name}_prog meson variables are used.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 months agoutil: remove use hardcoded TC path
Daniel P. Berrangé [Mon, 28 Apr 2025 16:22:14 +0000 (17:22 +0100)] 
util: remove use hardcoded TC path

Allow virCommand to find 'tc' in $PATH. This command is only used
when running privileged in which case both 'bin' and 'sbin' dirs will
be in $PATH, so virFindFileInPath will do the right thing to find it.

Since there are no longer any optional programs, only optional test
programs, the meson variables can be renamed and simplified at this
point.

The "TC" constant is defined in the header to match the pattern used
for the other firewall tool names.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 months agoutil: remove use hardcoded OVS_VSCTL path
Daniel P. Berrangé [Mon, 28 Apr 2025 16:22:14 +0000 (17:22 +0100)] 
util: remove use hardcoded OVS_VSCTL path

Allow virCommand to find 'ovs-vsctl' in $PATH. This command is only used
when running privileged in which case both 'bin' and 'sbin' dirs will
be in $PATH, so virFindFileInPath will do the right thing to find it.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 months agoutil: remove use hardcoded MODPROBE/RMMOD paths
Daniel P. Berrangé [Mon, 28 Apr 2025 16:22:14 +0000 (17:22 +0100)] 
util: remove use hardcoded MODPROBE/RMMOD paths

Allow virCommand to find 'modprobe' & 'rmmod' in $PATH. These commands
are only used when running privileged in which case both 'bin' and
'sbin' dirs will be in $PATH, so virFindFileInPath will do the right
thing to find them.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 months agoutil: remove use hardcoded MM_CTL path
Daniel P. Berrangé [Mon, 28 Apr 2025 16:22:14 +0000 (17:22 +0100)] 
util: remove use hardcoded MM_CTL path

Allow virCommand to find 'mm-ctl' in $PATH. This command is only used
when running privileged in which case both 'bin' and 'sbin' dirs will
be in $PATH, so virFindFileInPath will do the right thing to find it.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 months agonodedev: remove use hardcoded MDEVCTL path
Daniel P. Berrangé [Mon, 28 Apr 2025 16:22:14 +0000 (17:22 +0100)] 
nodedev: remove use hardcoded MDEVCTL path

Allow virCommand to find 'mdevctl' in $PATH. This command is only used
when running privileged in which case both 'bin' and 'sbin' dirs will
be in $PATH, so virFindFileInPath will do the right thing to find it.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 months agoutil: remove hardcoded ISCSIADM command path
Daniel P. Berrangé [Mon, 28 Apr 2025 16:39:59 +0000 (17:39 +0100)] 
util: remove hardcoded ISCSIADM command path

Gating the iscsi driver backend on a isciadm probe is likely to do
more harm than good as it needlessly disables the code if the dev
forgot to install iscsiadm at build time. As a Linux only command
it is simpler to gate the feature based on the platform choice and
allow missing binaries to be diagnose at runtime.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 months agomeson: remove check for 'ip' program
Daniel P. Berrangé [Mon, 28 Apr 2025 16:32:28 +0000 (17:32 +0100)] 
meson: remove check for 'ip' program

There are no references to an "IP" conf variable nor a meson
'ip_prog' variable so the check serves no purpose.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 months agoutil: remove use hardcoded DMIDECODE path
Daniel P. Berrangé [Mon, 28 Apr 2025 16:22:14 +0000 (17:22 +0100)] 
util: remove use hardcoded DMIDECODE path

Allow virCommand to find 'dmidecode' in $PATH. This command is only
usable when running privileged since it relies on reading from a
privileged kernel file. Thus we can assume both 'bin' and 'sbin' dirs
will be in $PATH and virFindFileInPath will do the right thing to
find it when called by virCommand.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 months agomeson: stop setting conf var for required programs
Daniel P. Berrangé [Mon, 28 Apr 2025 16:19:14 +0000 (17:19 +0100)] 
meson: stop setting conf var for required programs

There is no reference to PERL, PYTHON3, XMLLINT or XSLTPROC conf
variables anywhere, only the ${name}_prog meson variables are
used.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 months agobuild-aux: add missing definition of PERL variable
Daniel P. Berrangé [Mon, 28 Apr 2025 16:17:37 +0000 (17:17 +0100)] 
build-aux: add missing definition of PERL variable

Currently $(PERL) is expanding to nothing, but the spacing-check.pl test
luckily still works via the shebang.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 months agodocs: stop setting vars for docs tools
Daniel P. Berrangé [Mon, 28 Apr 2025 10:51:01 +0000 (11:51 +0100)] 
docs: stop setting vars for docs tools

Nothing in the tree references RST2MAN or RST2HTML5 variables, only
rst2man_prog & rst2html5_prog, so the former can be removed.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 months agoutil: stop hardcoding 'ifconfig' path
Daniel P. Berrangé [Mon, 28 Apr 2025 10:47:34 +0000 (11:47 +0100)] 
util: stop hardcoding 'ifconfig' path

Change the source to assume use of 'ifconfig' on FreeBSD builds,
allowing virCommand to report missing commands at runtime.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 months agoutil: stop hardcoding bhyve, bhyvectl, bhyveload paths
Daniel P. Berrangé [Mon, 28 Apr 2025 10:47:34 +0000 (11:47 +0100)] 
util: stop hardcoding bhyve, bhyvectl, bhyveload paths

Change the meson rules to always enable bhyve if on a FreeBSD host,
unless the meson options say not to.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 months agoutil: stop hardcoding numad path
Daniel P. Berrangé [Mon, 28 Apr 2025 10:47:34 +0000 (11:47 +0100)] 
util: stop hardcoding numad path

Change the meson rules to always enable numad if on a Linux host, unless
the meson options say not to.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 months agotests: storage hardcoding paths for mount & vgchange
Daniel P. Berrangé [Mon, 28 Apr 2025 10:43:30 +0000 (11:43 +0100)] 
tests: storage hardcoding paths for mount & vgchange

This is redundant since the tests will strip any path component from the
binary name before comparison.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 months agostorage: stop hardcoding paths for mkfs, mount, umount
Daniel P. Berrangé [Mon, 28 Apr 2025 10:42:13 +0000 (11:42 +0100)] 
storage: stop hardcoding paths for mkfs, mount, umount

This was always undesirable but now causes problems on Fedora 42
where at build time we detect a /sbin path but at runtime this
will only exist on upgraded machines, not fresh installs.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 months agoPost-release version bump to 11.4.0
Jiri Denemark [Fri, 2 May 2025 07:31:06 +0000 (09:31 +0200)] 
Post-release version bump to 11.4.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3 months agoRelease of libvirt-11.3.0 v11.3.0
Jiri Denemark [Fri, 2 May 2025 07:25:45 +0000 (09:25 +0200)] 
Release of libvirt-11.3.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3 months agoTranslated using Weblate (Romanian)
Remus-Gabriel Chelu [Thu, 1 May 2025 09:25:07 +0000 (09:25 +0000)] 
Translated using Weblate (Romanian)

Currently translated at 35.4% (3875 of 10918 strings)

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

Signed-off-by: Remus-Gabriel Chelu <remusgabriel.chelu@disroot.org>
3 months agoTranslated using Weblate (Spanish)
Nicolás Gal [Thu, 1 May 2025 09:25:07 +0000 (09:25 +0000)] 
Translated using Weblate (Spanish)

Currently translated at 53.4% (5834 of 10918 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
3 months agoTranslated using Weblate (Romanian) v11.3.0-rc2
Remus-Gabriel Chelu [Tue, 29 Apr 2025 09:08:35 +0000 (09:08 +0000)] 
Translated using Weblate (Romanian)

Currently translated at 33.2% (3630 of 10918 strings)

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

Signed-off-by: Remus-Gabriel Chelu <remusgabriel.chelu@disroot.org>
3 months agoTranslated using Weblate (Ukrainian)
Yuri Chornoivan [Tue, 29 Apr 2025 09:08:35 +0000 (09:08 +0000)] 
Translated using Weblate (Ukrainian)

Currently translated at 100.0% (10918 of 10918 strings)

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

Signed-off-by: Yuri Chornoivan <yurchor@ukr.net>
3 months agoTranslated using Weblate (Chinese (Simplified) (zh_CN))
QiangWei Zhang [Tue, 29 Apr 2025 09:08:34 +0000 (09:08 +0000)] 
Translated using Weblate (Chinese (Simplified) (zh_CN))

Currently translated at 92.1% (10066 of 10918 strings)

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

Signed-off-by: QiangWei Zhang <zhang.qiangwei@zte.com.cn>
Translated using Weblate (Chinese (Simplified) (zh_CN))

Currently translated at 92.1% (10065 of 10918 strings)

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

Signed-off-by: QiangWei Zhang <zhang.qiangwei@zte.com.cn>
3 months agoUpdate translation files
Weblate [Tue, 29 Apr 2025 09:08:33 +0000 (09:08 +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>
3 months agoscripts: Fix reading list of files in mock-noinline.py
Michal Privoznik [Mon, 28 Apr 2025 11:37:43 +0000 (13:37 +0200)] 
scripts: Fix reading list of files in mock-noinline.py

The mock-noinline.py script is fed list of files through its
stdin, each file on its own line. Unfortunately, the way the
script is written does nothing as the trailing newline character
prevents any .endswith() match. Strip each line of white spaces.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 months agoutil: Add missing G_NO_INLINE annotation
Michal Privoznik [Mon, 28 Apr 2025 11:36:45 +0000 (13:36 +0200)] 
util: Add missing G_NO_INLINE annotation

There are two functions that are mocked, but are missing required
G_NO_INLINE attribute: virFirewallDIsRegistered() and
virHostCPUGetPhysAddrSize(). Add it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>