]> git.ipfire.org Git - thirdparty/libvirt.git/log
thirdparty/libvirt.git
6 months agoci: refresh with 'lcitool manifest'
Daniel P. Berrangé [Tue, 11 Feb 2025 17:15:45 +0000 (17:15 +0000)] 
ci: refresh with 'lcitool manifest'

This replaces Fedora 39 with Fedora 41, updates the FreeBSD
Cirrus CI image names, and tweaks some package names

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
6 months agonode_device: Do not lock the driver state needlessly
Martin Kletzander [Fri, 7 Feb 2025 14:43:52 +0000 (15:43 +0100)] 
node_device: Do not lock the driver state needlessly

When processing the PCI devices we can only read the configs for each of
them if running as privileged.  That information is saved in the driver
state as a boolean introduced in commit 643c74abff01.  However since
that version it is only written to once during nodeStateInitialize() and
only read from that point (apart from some commits around v3.9.0 release
when it was not even set, but that was fixed before v3.10.0).  And it is
only read once, just to store that boolean in a temporary variable which
is also used in only one condition.

Rewrite this without locking and save few lines of code.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 months agoTranslated using Weblate (English (United Kingdom))
Andi Chandler [Tue, 11 Feb 2025 12:00:55 +0000 (13:00 +0100)] 
Translated using Weblate (English (United Kingdom))

Currently translated at 48.6% (5241 of 10781 strings)

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

Signed-off-by: Andi Chandler <andi@gowling.com>
6 months agoTranslated using Weblate (Romanian)
Remus-Gabriel Chelu [Tue, 11 Feb 2025 12:00:54 +0000 (13:00 +0100)] 
Translated using Weblate (Romanian)

Currently translated at 20.1% (2175 of 10781 strings)

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

Signed-off-by: Remus-Gabriel Chelu <remusgabriel.chelu@disroot.org>
6 months agoTranslated using Weblate (Spanish)
Nicolás Gal [Tue, 11 Feb 2025 12:00:54 +0000 (13:00 +0100)] 
Translated using Weblate (Spanish)

Currently translated at 52.8% (5700 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
Translated using Weblate (Spanish)

Currently translated at 52.6% (5679 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
Translated using Weblate (Spanish)

Currently translated at 52.6% (5676 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
Translated using Weblate (Spanish)

Currently translated at 52.6% (5674 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
Translated using Weblate (Spanish)

Currently translated at 52.6% (5671 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
Translated using Weblate (Spanish)

Currently translated at 52.2% (5634 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
6 months agonode_device_udev: add error reporting to udevProcessCCWGroup
Boris Fiuczynski [Thu, 6 Feb 2025 16:27:52 +0000 (17:27 +0100)] 
node_device_udev: add error reporting to udevProcessCCWGroup

Add reporting an internal error when the string to type conversion of
devtype fails as this indicates a serious problem since devtype was used
to get into this method during the udev event handling.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
6 months agoqemu: domain: Initialize FD passthrough for a virStorageSource before using it
Peter Krempa [Thu, 6 Feb 2025 15:20:45 +0000 (16:20 +0100)] 
qemu: domain: Initialize FD passthrough for a virStorageSource before using it

The call to 'qemuBlockStorageSourceNeedsFormatLayer()' bases the
decision also on the state of the passed FD, so we must initialize the
passthrough data via 'qemuDomainPrepareStorageSourceFDs()' before the
aforementioned call.

In the test change it's visible that we didn't add the necessary 'raw'
driver which allows the 'protocol' blockdev to be opened in 'rw' mode so
that qemu picks the proper file descriptior while keeping the device
read-only.

Resolves: https://issues.redhat.com/browse/RHEL-37519
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
6 months agoqemuxmlconftest: Add testing of FDs with 'writable' flag in 'disk-source-fd'
Peter Krempa [Thu, 6 Feb 2025 14:55:37 +0000 (15:55 +0100)] 
qemuxmlconftest: Add testing of FDs with 'writable' flag in 'disk-source-fd'

Add few examples of fd groups with the 'writable' flag set, when passing
a single FD. Notably as a top level image of a readonly disk (even when
that doesn't make much sense) and also as a base image of a chain.

Note that this documents a status quo of a bug fixed in upcoming patch.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
6 months agoqemuxmlconftest: Allow testing of the 'writable' flag for passed FDs for disks
Peter Krempa [Thu, 6 Feb 2025 14:50:35 +0000 (15:50 +0100)] 
qemuxmlconftest: Allow testing of the 'writable' flag for passed FDs for disks

Pass also the 'writable' state to the fake passed FDs so that we can
test it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
6 months agoTranslated using Weblate (Spanish)
Nicolás Gal [Thu, 6 Feb 2025 12:58:21 +0000 (13:58 +0100)] 
Translated using Weblate (Spanish)

Currently translated at 51.9% (5600 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
Translated using Weblate (Spanish)

Currently translated at 51.5% (5557 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
Translated using Weblate (Spanish)

Currently translated at 51.2% (5522 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
Translated using Weblate (Spanish)

Currently translated at 51.2% (5522 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
Translated using Weblate (Spanish)

Currently translated at 51.0% (5507 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
Translated using Weblate (Spanish)

Currently translated at 50.7% (5472 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
Translated using Weblate (Spanish)

Currently translated at 50.6% (5458 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
Translated using Weblate (Spanish)

Currently translated at 50.4% (5437 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
6 months agodocs: Reword virDomainGetEmulatorPinInfo description
Martin Kletzander [Mon, 13 Jan 2025 14:27:10 +0000 (15:27 +0100)] 
docs: Reword virDomainGetEmulatorPinInfo description

This API only queries the XML settings and not the running threads
themselves.  In order to avoid confusion, change the wording slightly.

Resolves: https://issues.redhat.com/browse/RHEL-72052
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
6 months agotests: qemuxmlconfdata: Update launch-security-sev-snp.xml
Michal Privoznik [Mon, 27 Jan 2025 09:46:17 +0000 (10:46 +0100)] 
tests: qemuxmlconfdata: Update launch-security-sev-snp.xml

Recently, I was part of a discussion where it was suspected that
libvirt does not pick up correct FW for SEV-SNP guests. Update
our test to demonstrate it does.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
6 months agonodedev: udev: Hook up virFileWaitForExist to address uevent race of pci device
Guoyi Tu [Thu, 19 Dec 2024 15:07:35 +0000 (23:07 +0800)] 
nodedev: udev: Hook up virFileWaitForExist to address uevent race of pci device

Similarly to commit 1af45804 we should be safer by waiting for the whole
sysfs tree is created for the device.

Signed-off-by: Guoyi Tu <tugy@chinatelecom.cn>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
6 months agoqemu: Attach persistent reservations manager if block-copy target requires it
Peter Krempa [Tue, 4 Feb 2025 17:06:00 +0000 (18:06 +0100)] 
qemu: Attach persistent reservations manager if block-copy target requires it

Users can choose to copy a disk into a destination where they want to
use persistent reservations. Start the daemon if the configuration
requires it.

Resolves: https://issues.redhat.com/browse/RHEL-7342
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
6 months agoqemu: blockjob: Remove persistent reservations manager when dropping disk images
Peter Krempa [Tue, 4 Feb 2025 16:59:06 +0000 (17:59 +0100)] 
qemu: blockjob: Remove persistent reservations manager when dropping disk images

Check if the persistent reservations manager daemon is still needed
after a disk (sub)-chain was dropped after a blockjob.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
6 months agoqemu: hotplug: Export persistent reservations manager helper functions
Peter Krempa [Tue, 4 Feb 2025 16:51:57 +0000 (17:51 +0100)] 
qemu: hotplug: Export persistent reservations manager helper functions

Export qemuHotplugAttachManagedPR/qemuHotplugRemoveManagedPR for reuse
in blockjob code.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
6 months agovirDomainDefHasManagedPR: Consider also disk's 'mirror' chain
Peter Krempa [Tue, 4 Feb 2025 16:55:14 +0000 (17:55 +0100)] 
virDomainDefHasManagedPR: Consider also disk's 'mirror' chain

Consider also the destination of a block-copy job.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
6 months agoqemu_hotplug.h: Reformat according to new coding style
Peter Krempa [Tue, 4 Feb 2025 16:45:37 +0000 (17:45 +0100)] 
qemu_hotplug.h: Reformat according to new coding style

Fix the mixed style by unifying the formatting.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
6 months agoqemucapabilitiestest: Add data for the qemu-10.0 dev cycle on x86_64
Peter Krempa [Tue, 4 Feb 2025 16:12:00 +0000 (17:12 +0100)] 
qemucapabilitiestest: Add data for the qemu-10.0 dev cycle on x86_64

Add data based on 'v9.2.0-1537-gd922088eb4'

Notable changes:
    - '10.0' machine types added
    - 'hub' chardev backend added
    - 'cpr' migrate channel added
    - 'nsamples' field for 'dbus' audio backend now reported
    - 'ClearwaterForest-v1' cpu model added
    - 'SierraForest-v2' cpu model added
    - 'ivshmem-flat' device added
    - new qom objects:
        - 'virtio-mem-system-reset'
        - 'vmclock'
    - default value of 'rombar' changed from 1 to -1 for all devices
    - 'intel-iommu' device:
        - default value of 'aw-bit' changed from '39' to '48'
        - 'fs1gp' boolean added
        - 'x-flts' boolean added
    - 'virtio-balloon-pci'/'virtio-mem-pci':
        - 'ioeventfd' added
        - 'vectors' added

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
6 months agoqemucapabilitiestest: Final update for qemu-9.2 release on x86_64
Peter Krempa [Thu, 28 Nov 2024 08:52:32 +0000 (09:52 +0100)] 
qemucapabilitiestest: Final update for qemu-9.2 release on x86_64

Update the data after the release.

Notable changes:
 - the 6.2 machine types became deprecated

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
6 months agoqemu: snapshot: Ensure that NVRAM image exists when taking inactive internal snapshot
Peter Krempa [Mon, 3 Feb 2025 16:52:50 +0000 (17:52 +0100)] 
qemu: snapshot: Ensure that NVRAM image exists when taking inactive internal snapshot

Attempting to take an internal snapshot of a freshly defined VM with
qcow2 backed NVRAM results in failure as the NVRAM image doesn't get
populated until the VM is started for the first time.

Fix this by invoking qemuPrepareNVRAM() when qcow2 nvram is defined.

Resolves: https://issues.redhat.com/browse/RHEL-73315
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
6 months agoqemu: process: Export qemuPrepareNVRAM for use in snapshot code
Peter Krempa [Mon, 3 Feb 2025 16:48:05 +0000 (17:48 +0100)] 
qemu: process: Export qemuPrepareNVRAM for use in snapshot code

Export qemuPrepareNVRAM so that it doesn't require the VM object. The
snapshot code needs in the corner case of creating a snapshot of a
freshly defined VM ensure that the nvram image exists in order to
snapshot it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
6 months agoqemuSnapshotForEachQcow2: Don't initialize 'nrollback'
Peter Krempa [Mon, 3 Feb 2025 17:23:29 +0000 (18:23 +0100)] 
qemuSnapshotForEachQcow2: Don't initialize 'nrollback'

The variable holds the amount of disks to roll back the snapshot for.
The value must be set before the code jumps to the 'rollback:' label so
the best situation is to not initialize it and let the compiler catch
errors rather than initialize the unsigned variable to -1 and let it
crash.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
6 months agonode_device_udev: Fix build failure in ccw device code
Peter Krempa [Wed, 5 Feb 2025 18:27:36 +0000 (19:27 +0100)] 
node_device_udev: Fix build failure in ccw device code

clang complains:

../../../libvirt/src/node_device/node_device_udev.c:1408:82: error: result of comparison of unsigned enum expression < 0 is always false [-Werror,-Wtautological-unsigned-enum-zero-compare]
 1408 |     if ((data->ccwgroup_dev.type = virNodeDevCCWGroupCapTypeFromString(devtype)) < 0)
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
1 error generated.

Fix it by adding a temporary int variable to facilitate the check before
assigning to the unsigned enum value.

Fixes: 985cb9c32a6
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
6 months agonodedev: add qeth layer2 and layer3 device types
Boris Fiuczynski [Tue, 4 Feb 2025 17:11:43 +0000 (18:11 +0100)] 
nodedev: add qeth layer2 and layer3 device types

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
6 months agonodedev: add ccwgroup capability support to ccw devices
Boris Fiuczynski [Tue, 4 Feb 2025 17:11:42 +0000 (18:11 +0100)] 
nodedev: add ccwgroup capability support to ccw devices

Add the group membership information to a CCW device. Allow to filter
CCW devices based on a group membership.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
6 months agonodedev: add ccwgroup node device support
Boris Fiuczynski [Tue, 4 Feb 2025 17:11:41 +0000 (18:11 +0100)] 
nodedev: add ccwgroup node device support

Add ccwgroup node device type supporting qeth generic driver.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
6 months agonodedev: refactor udevCCWGetState
Boris Fiuczynski [Tue, 4 Feb 2025 17:11:40 +0000 (18:11 +0100)] 
nodedev: refactor udevCCWGetState

Refactor method to be only ccw state type depended to allow reuse in a
later patch.

Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
6 months agonodedev: refactor CCW state format for use in ccwgroup
Boris Fiuczynski [Tue, 4 Feb 2025 17:11:39 +0000 (18:11 +0100)] 
nodedev: refactor CCW state format for use in ccwgroup

Refactor to allow reuse in ccwgroup.

Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
6 months agonodedev: remove virNodeDeviceCapCCWDefFormat
Boris Fiuczynski [Tue, 4 Feb 2025 17:11:38 +0000 (18:11 +0100)] 
nodedev: remove virNodeDeviceCapCCWDefFormat

Directly use virCCWDeviceAddressFormat.

Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
6 months agonodedev: refactor CCW device address
Boris Fiuczynski [Tue, 4 Feb 2025 17:11:37 +0000 (18:11 +0100)] 
nodedev: refactor CCW device address

Replace cssid, ssid and devno elements with virCCWDeviceAddress.

Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
6 months agonodedev: refactor CCW device address format
Boris Fiuczynski [Tue, 4 Feb 2025 17:11:36 +0000 (18:11 +0100)] 
nodedev: refactor CCW device address format

Refactor for reuse in the following patch.

Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
6 months agodocs: fix 'virsh domstats --vcpu' measure units and descriptions
Fabricio Duarte [Mon, 16 Dec 2024 22:02:44 +0000 (19:02 -0300)] 
docs: fix 'virsh domstats --vcpu' measure units and descriptions

The fields are in nanoseconds, not microseconds. Also fixes the
description of `vcpu.<num>.wait`, as it does not actually represent the
time waiting on I/O.

Signed-off-by: Fabricio Duarte <fabricio.duarte.jr@gmail.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
6 months agoTranslated using Weblate (Chinese (Traditional) (zh_TW))
Daniel P. Berrangé [Mon, 3 Feb 2025 14:39:59 +0000 (15:39 +0100)] 
Translated using Weblate (Chinese (Traditional) (zh_TW))

Currently translated at 2.4% (265 of 10781 strings)

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

Signed-off-by: "Daniel P. Berrange" <berrange@redhat.com>
Translated using Weblate (Chinese (Simplified) (zh_CN))

Currently translated at 93.3% (10067 of 10781 strings)

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

Signed-off-by: "Daniel P. Berrange" <berrange@redhat.com>
6 months agoTranslated using Weblate (Spanish)
Nicolás Gal [Mon, 3 Feb 2025 14:39:58 +0000 (15:39 +0100)] 
Translated using Weblate (Spanish)

Currently translated at 51.0% (5507 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
Translated using Weblate (Spanish)

Currently translated at 50.7% (5472 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
Translated using Weblate (Spanish)

Currently translated at 50.6% (5458 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
Translated using Weblate (Spanish)

Currently translated at 50.4% (5437 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
6 months agoNEWS: Mention preserving I/O error messages for qemu VMs
Peter Krempa [Tue, 28 Jan 2025 16:22:19 +0000 (17:22 +0100)] 
NEWS: Mention preserving I/O error messages for qemu VMs

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
6 months agoinclude: libvirt-domain: Add 'message' @reason of VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON
Peter Krempa [Fri, 24 Jan 2025 15:26:54 +0000 (16:26 +0100)] 
include: libvirt-domain: Add 'message' @reason of VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON

In case when the hypervisor does report the reason for the I/O error as
an unstable string to display to users we can add a @reason possibility
for the I/O error event noting that the error is available.

Add 'message' as a reason enumeration value and document it
to instruct users to look at the logs or virDomainGetMessages().

The resulting event looks like:

 event 'io-error' for domain 'cd': /dev/mapper/errdev0 (virtio-disk0) report due to message

Users then can look at the virDomainGetMessages() API:

 I/O error: disk='vda', index='1', path='/dev/mapper/errdev0', timestamp='2025-01-28 15:47:52.776+0000', message='Input/output error'

Or in the VM log file:

 2025-01-28 15:47:52.776+0000: IO error device='virtio-disk0' node-name='libvirt-1-storage' reason='Input/output error'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
6 months agoinclude: libvirt-domain: Reword documentation for @reason of VIR_DOMAIN_EVENT_ID_IO_E...
Peter Krempa [Mon, 27 Jan 2025 14:50:34 +0000 (15:50 +0100)] 
include: libvirt-domain: Reword documentation for @reason of VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON

Emphasise that it's an enumeration and convert the possibilities to a
list of values with explanation.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
6 months agovirDomainGetMessages: Introduce VIR_DOMAIN_MESSAGE_IOERRORS
Peter Krempa [Mon, 27 Jan 2025 18:13:43 +0000 (19:13 +0100)] 
virDomainGetMessages: Introduce VIR_DOMAIN_MESSAGE_IOERRORS

Report any stored I/O error messages reported by the hypervisor when
reporting messages of a domain. As the I/O error may be already stale we
report also the timestamp when it was recorded.

Example message:

 I/O error: disk='vda', index='1', path='/dev/mapper/errdev0', timestamp='2025-01-28 15:47:52.776+0000', message='Input/output error'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
6 months agovirDomainObjGetMessages: Refactor using GPtrArray
Peter Krempa [Mon, 27 Jan 2025 16:38:51 +0000 (17:38 +0100)] 
virDomainObjGetMessages: Refactor using GPtrArray

Simplify the function especially by rewriting it using GPtrArray to
construct the string list, especially for the upcoming case when the
number of added elements will not be known beforehand and when
hypervisor specific data will be added.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
6 months agolibxlDomainGetMessages: Add existing flags to 'virCheckFlags'
Peter Krempa [Tue, 28 Jan 2025 13:06:16 +0000 (14:06 +0100)] 
libxlDomainGetMessages: Add existing flags to 'virCheckFlags'

The two VIR_DOMAIN_MESSAGE_* flags were not listed in the virCheckFlags
check in 'libxl' but were present in 'test' and 'qemu' driver impls.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
6 months agoqemuProcessHandleIOError: Log IO errors in the VM log file
Peter Krempa [Fri, 24 Jan 2025 16:01:34 +0000 (17:01 +0100)] 
qemuProcessHandleIOError: Log IO errors in the VM log file

Add a log entry to the VM log file for every time we receive an IO error
event from qemu. The log entry is as follows:

 2025-01-24 16:03:28.928+0000: IO error device='virtio-disk0' node-name='libvirt-1-storage' reason='other: Input/output error'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
6 months agoqemuProcessHandleIOError: Populate I/O error reason to virStorageSource
Peter Krempa [Mon, 27 Jan 2025 18:17:16 +0000 (19:17 +0100)] 
qemuProcessHandleIOError: Populate I/O error reason to virStorageSource

Record the last I/O error reason and timestamp which happened with the
corresponding virStorageSource struct.

This will later allow querying the last error e.g. via the
virDomainGetMessages() API.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
6 months agovirStorageSource: Add fields for storing last I/O error message
Peter Krempa [Mon, 27 Jan 2025 15:20:43 +0000 (16:20 +0100)] 
virStorageSource: Add fields for storing last I/O error message

Hypervisors may report a I/O error message (unstable; for human use)
to libvirt. In order to store it with the appropriate virStorageSource
so that it can be later queried we need to add fields to
virStorageSource to store the timestamp and message.

The message is deliberately not copied via virStorageSourceCopy.

The messages are also not serialized to the status XML as losing them on
a daemon restart as they're likely to be stale anyways.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
6 months agoqemuMonitorJSONHandleIOError: Propagate new 'qom-path' field
Peter Krempa [Tue, 28 Jan 2025 09:39:52 +0000 (10:39 +0100)] 
qemuMonitorJSONHandleIOError: Propagate new 'qom-path' field

QEMU commit v9.1.0-1065-ge67b7aef7c added 'qom-path' as an optional
field for the BLOCK_IO_ERROR event. Extract and propagate it as an
alternative to lookup via 'node-name' and 'device' (alias).

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
6 months agoqemuProcessHandleIOError: Prefer lookup by node name
Peter Krempa [Fri, 24 Jan 2025 16:17:51 +0000 (17:17 +0100)] 
qemuProcessHandleIOError: Prefer lookup by node name

When qemu reports a node name for an I/O error we should prefer the
lookup by node name instead as it gives us the path to the specific
image which caused the error instead of the top level image path.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
6 months agoqemuMonitorJSONHandleIOError: Do not munge 'reason' field of IO error event
Peter Krempa [Mon, 27 Jan 2025 12:53:36 +0000 (13:53 +0100)] 
qemuMonitorJSONHandleIOError: Do not munge 'reason' field of IO error event

Leave the interpretation of the event to 'qemuProcessHandleIOError()'
which will create it's own variant of the messages for the user-facing
libvirt events. qemuMonitorJSONHandleIOError() will pass through the raw
data it got from qemu.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
6 months agoqemuProcessHandleIOError: Rename local variables
Peter Krempa [Mon, 27 Jan 2025 12:07:24 +0000 (13:07 +0100)] 
qemuProcessHandleIOError: Rename local variables

Prefix the helper variables used to supply data to the event by
'event'. Declare them with the default value of an empty string rather
than doing it later.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
6 months agoqemu: Rename 'diskAlias' to 'device' in qemu IO error event handling
Peter Krempa [Mon, 27 Jan 2025 12:42:36 +0000 (13:42 +0100)] 
qemu: Rename 'diskAlias' to 'device' in qemu IO error event handling

The field is named 'device' in the event so unify our naming.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
6 months agoqemu: Handle quirks of 'device' field of BLOCK_IO_ERROR event in monitor code
Peter Krempa [Mon, 27 Jan 2025 12:03:58 +0000 (13:03 +0100)] 
qemu: Handle quirks of 'device' field of BLOCK_IO_ERROR event in monitor code

BLOCK_IO_ERROR's 'device' field is an empty string in case when it isn't
applicable as it was originally mandatory in the qemu API docs.

Move the logic that convert's empty string back to NULL from
'qemuProcessHandleIOError()' to 'qemuMonitorJSONHandleIOError()'

This also fixes a hypothetical NULL-dereference if qemu would indeed
report an IO error without the 'device' field present.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
6 months agoNEWS: Document virtio-mem-ccw
Michal Privoznik [Fri, 24 Jan 2025 11:16:41 +0000 (12:16 +0100)] 
NEWS: Document virtio-mem-ccw

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
6 months agoqemuxmlconftest: Introduce memory-hotplug-virtio-mem-ccw-s390x.xml
Michal Privoznik [Tue, 28 Jan 2025 07:54:36 +0000 (08:54 +0100)] 
qemuxmlconftest: Introduce memory-hotplug-virtio-mem-ccw-s390x.xml

This is similar to emuxmlconfdata/memory-hotplug-virtio-mem-pci-s390x.xml
except the explicit placement of virtio-mem onto a PCI bus is removed.
This results in virtio-mem being placed onto CCW "bus" this demonstrating
previous commits working as expected.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
6 months agoqemu: Allow virtio-mem on CCW
Michal Privoznik [Wed, 15 Jan 2025 12:00:36 +0000 (13:00 +0100)] 
qemu: Allow virtio-mem on CCW

After previous commits, we can allow virtio-mem to live on CCW
channel.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
6 months agoqemu: Validate virtio-mem-ccw
Michal Privoznik [Wed, 15 Jan 2025 14:48:41 +0000 (15:48 +0100)] 
qemu: Validate virtio-mem-ccw

There are basically two differences between virtio-mem-ccw and
virtio-mem-pci. s390 doesn't allow mixing different page sizes
and there's no NUMA support in QEMU.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
6 months agoqemu_caps: Introduce QEMU_CAPS_DEVICE_VIRTIO_MEM_CCW
Michal Privoznik [Wed, 15 Jan 2025 09:46:16 +0000 (10:46 +0100)] 
qemu_caps: Introduce QEMU_CAPS_DEVICE_VIRTIO_MEM_CCW

This capability tracks whether QEMU supports virtio-mem-ccw
device. Introduced in QEMU commit v9.2.0-492-gaa910c20ec only
upcoming release of QEMU supports the device.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
6 months agoqemuxmlconftest: Introduce memory-hotplug-virtio-mem-pci-s390x.xml
Michal Privoznik [Wed, 15 Jan 2025 09:45:31 +0000 (10:45 +0100)] 
qemuxmlconftest: Introduce memory-hotplug-virtio-mem-pci-s390x.xml

As of v9.2.0-1413-gd77ae821e8 QEMU supports virtio-mem-pci on
s390 too. Let's add a test case for that.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
6 months agoqemu_command: Use qemuBuildVirtioDevProps() to build cmd line for virtio-mem and...
Michal Privoznik [Mon, 13 Jan 2025 14:48:03 +0000 (15:48 +0100)] 
qemu_command: Use qemuBuildVirtioDevProps() to build cmd line for virtio-mem and virtio-pmem

Both, virtio-mem and virtio-pmem devices follow traditional QEMU
naming convention: their suffix determines what bus they live on.
For instance, virtio-mem-pci, virtio-mem-ccw, virtio-pmem-pci.
We already have a function that constructs device name following
this convention: qemuBuildVirtioDevGetConfigDev().

While there's no virtio-pmem-ccw device yet, the function can
still be used.

Another advantage of using the function is - it'll be easier in
future when we want to configure various virtio aspects of memory
devices (like ats, iommu_platform, etc.).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
6 months agoqemu: Do NOT autoadd NUMA node for s390
Michal Privoznik [Mon, 20 Jan 2025 16:10:24 +0000 (17:10 +0100)] 
qemu: Do NOT autoadd NUMA node for s390

In some cases, we might automatically add a NUMA node. But this
doesn't work for s390 really, because in its commit
v2.12.0-rc0~41^2~6 QEMU forbade specifying NUMA nodes for s390.
Suppress automatic adding of NUMA node on our side.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
6 months agolibvirt.spec.in: fix indentation
Pavel Hrdina [Mon, 3 Feb 2025 17:35:13 +0000 (18:35 +0100)] 
libvirt.spec.in: fix indentation

Fixes: cf32953f5b6ec30386f71b40cf458467752a6dca
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 months agorpm: disable account creation for Fedora >= 42
Daniel P. Berrangé [Wed, 29 Jan 2025 15:52:02 +0000 (15:52 +0000)] 
rpm: disable account creation for Fedora >= 42

In Fedora >= 42, support for user/group account creation based on
sysusers files has been enabled in RPM. Manually running useradd/
groupadd is thus obsolete.

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
6 months agotools: add sysusers file to create 'virtlogin' group
Daniel P. Berrangé [Wed, 29 Jan 2025 15:37:46 +0000 (15:37 +0000)] 
tools: add sysusers file to create 'virtlogin' group

We previously added a sysusers file, but missed the 'virtlogin' group.
This group is used to make the virt-login-shell binary setgid, so we
shoudl be registering that too. It must be done in a separate sysusers
file, however, since it is packaged separately from the daemons.

Fixes: a2c3e390f7bedf36f4ddc544d09fe3b8772c5c6f
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
6 months agoNEWS: Document VBOX-6.1 removal
Michal Privoznik [Tue, 28 Jan 2025 12:18:02 +0000 (13:18 +0100)] 
NEWS: Document VBOX-6.1 removal

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
6 months agovbox: Drop code supporting old VBox version
Michal Privoznik [Fri, 27 Sep 2024 07:04:17 +0000 (09:04 +0200)] 
vbox: Drop code supporting old VBox version

Now that only supported version of VirtualBox is 7.0.x the code
that supports older versions can be dropped.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
6 months agovbox: Drop support for VirtualBox-6.1.x
Michal Privoznik [Fri, 27 Sep 2024 06:49:22 +0000 (08:49 +0200)] 
vbox: Drop support for VirtualBox-6.1.x

According to VirtualBox download page [1] the support for version
6.1.x was terminated a year ago. Drop support for it.

1: https://www.virtualbox.org/wiki/Download_Old_Builds_6_1

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
6 months agovbox: Report an error when VBox CAPI initialization fails
Michal Privoznik [Sat, 5 Oct 2024 21:50:25 +0000 (23:50 +0200)] 
vbox: Report an error when VBox CAPI initialization fails

If initialization of VBOX fails inside of _pfnInitialize an
negative value is returned to signal an error condition to a
caller but no error message is printed out. Reporting an error
may shed more light into why VBOX failed to initialize.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
6 months agovbox: Use g_autofree in tryLoadOne()
Michal Privoznik [Thu, 26 Sep 2024 08:53:01 +0000 (10:53 +0200)] 
vbox: Use g_autofree in tryLoadOne()

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
6 months agoqemu: Check for valid save image format when verifying image header
Jim Fehlig via Devel [Fri, 31 Jan 2025 02:29:04 +0000 (19:29 -0700)] 
qemu: Check for valid save image format when verifying image header

When attempting to restore a saved image, the check for a valid save image
format does not occur until the qemu process is about to be executed. Move
the check earlier in the restore process, along with the other checks that
verify a valid save image header.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
6 months agoqemu: Decompose qemuSaveImageOpen
Jim Fehlig via Devel [Fri, 31 Jan 2025 02:29:03 +0000 (19:29 -0700)] 
qemu: Decompose qemuSaveImageOpen

Split the reading of libvirt's save image metadata from the opening
of the fd that will be passed to QEMU. This allows improved error
handling and provides more flexibility users of qemu_saveimage.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
6 months agoqemu: Move unlinking corrupt save image file to caller
Jim Fehlig via Devel [Fri, 31 Jan 2025 02:29:02 +0000 (19:29 -0700)] 
qemu: Move unlinking corrupt save image file to caller

qemuDomainObjRestore is the only caller of qemuSaveImageOpen that
requests an unlink of a corrupted save image. Provide a function to
check for a corrupt image and move unlinking it to qemuDomainObjRestore.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
6 months agoremote: add sysusers file to create 'libvirt' group
Daniel P. Berrangé [Wed, 29 Jan 2025 15:37:46 +0000 (15:37 +0000)] 
remote: add sysusers file to create 'libvirt' group

We previously added a sysusers file, but missed the 'libvirt' group.
This group is referenced in the polkit rules, so we should be
registering that too. It must be done in a separate sysusers file,
however, since it is common to all daemons.

Fixes: a2c3e390f7bedf36f4ddc544d09fe3b8772c5c6f
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
6 months agoglibcompat: Sync g_string_replace()
Adam Julis [Wed, 29 Jan 2025 16:02:45 +0000 (17:02 +0100)] 
glibcompat: Sync g_string_replace()

Ever since its introduction, g_string_replace() has received
various bugfies and improvements, e.g.:

  0a8c7e57a g_string_replace: Don't replace empty string more than once per location
  b13777841 g_string_replace: Document behaviour of zero-length match pattern
  e8517e777 remove quadratic behavior in g_string_replace
  c9e48947e gstring: Fix a heap buffer overflow in the new g_string_replace() code

to name a few. Sync our implementation with the one from current
main branch of glib. Some code style adjustments have been made
to match our coding style.

Signed-off-by: Adam Julis <ajulis@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
6 months agodocs: add missing cellNum parameter in function call
Ankush Menat [Wed, 29 Jan 2025 16:48:46 +0000 (16:48 +0000)] 
docs: add missing cellNum parameter in function call

Signed-off-by: Ankush Menat <ankushmenat@gmail.com>
6 months agoqemuSnapshotDeleteValidate: Fix crash when disk is not found in VM definition
kaihuan [Fri, 29 Nov 2024 14:56:45 +0000 (22:56 +0800)] 
qemuSnapshotDeleteValidate: Fix crash when disk is not found in VM definition

qemuDomainDiskByName() can return a NULL pointer on failure.
But this returned value in qemuSnapshotDeleteValidate is not checked.It will make libvirtd crash.

Signed-off-by: kaihuan <jungleman759@gmail.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
6 months agoqemu: Check empty drives in block I/O throttle API
Fabian Leditzky [Tue, 21 Jan 2025 14:33:25 +0000 (14:33 +0000)] 
qemu: Check empty drives in block I/O throttle API

Provide a proper user facing error when attempting to query block
I/O throttling settings for an empty drive. Without this patch, a less
meaningful internal error produced by qemuMonitorJSONBlockIoThrottleInfo
would be propagated to the user.

Signed-off-by: Fabian Leditzky <fabian@ldsoft.dev>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
6 months agoSupport IDE/SATA disk 'product' parameter
Adam Julis [Sat, 18 Jan 2025 10:30:20 +0000 (11:30 +0100)] 
Support IDE/SATA disk 'product' parameter

Since we supported 'product' parameter for SCSI, just expanded existing
solution makes IDE/SATA parameter works too. QEMU requires parameter 'model'
in case of IDE/SATA (instead of 'product'), so the process of making JSON
object is slightly modified. Length of the 'product' parameter is
different in SCSI (16 chars) and ATA/SATA (40 chars).

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/697
Signed-off-by: Adam Julis <ajulis@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
6 months agoqemu_snapshot: allow reverting to external disk only snapshot
Pavel Hrdina [Wed, 31 Jan 2024 16:14:28 +0000 (17:14 +0100)] 
qemu_snapshot: allow reverting to external disk only snapshot

When snapshot is created with disk-only flag it is always external
snapshot without memory state. Historically when there was not support
to revert external snapshots this produced error message.

    error: Failed to revert snapshot s1
    error: internal error: Invalid target domain state 'disk-snapshot'. Refusing snapshot reversion

Now we can simply consider this as reverting to offline snapshot as the
possible damage to file system is already done at the point of snapshot
creation.

Resolves: https://issues.redhat.com/browse/RHEL-21549
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
6 months agotools: Move libvirt-guests lock file out of subsys directory
Bronek Kozicki [Mon, 16 Dec 2024 11:15:26 +0000 (11:15 +0000)] 
tools: Move libvirt-guests lock file out of subsys directory

This directory might not exist on systems not supporting old SystemV interfaces.

Signed-off-by: Bronek Kozicki <brok@incorrekt.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
6 months agovirsh: pool-list: remove unnecessary spaces to align behavior
Philipp Schuster [Wed, 8 Jan 2025 16:38:15 +0000 (17:38 +0100)] 
virsh: pool-list: remove unnecessary spaces to align behavior

By removing the unnecessary spaces, the behavior is aligned with
`virsh list --all --name` and `virsh net-list --all --name`.

Without this change, one can't do something like the following easily:

`virsh pool-list --all --name | xargs -I {} virsh pool-start \"{}\"`

as no pool `"foo    "` (with all the spaces) actually exist.

Although the removed comment states that the additional spaces were kept
to maintain backwards compatibility, the commit [0] and the old behavior
are from 2010 when libvirt was at version 0.8.1. For the sake of sanity,
the behavior should be aligned with other parts of the CLI.

[0] https://gitlab.com/libvirt/libvirt/-/commit/415b14903e816aeb98d6f9c16fba045686cb0765

Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
6 months agodocs: Document that 'vcpu.delay' statistic is in nanoseconds
Assaf Admi [Tue, 7 May 2024 08:58:06 +0000 (11:58 +0300)] 
docs: Document that 'vcpu.delay' statistic is in nanoseconds

Add nanoseconds units for vcpu.delay doc, as it's based on
'/proc/<pid>/task/<tid>/schedstat' (see 'qemuGetSchedstatDelay()').

'schedstat' is in nanoseconds, according to
https://docs.kernel.org/scheduler/sched-stats.html#proc-pid-schedstat.

Signed-off-by: aadmi <aadmi@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
6 months agoTranslated using Weblate (Romanian)
Remus-Gabriel Chelu [Tue, 28 Jan 2025 17:19:42 +0000 (18:19 +0100)] 
Translated using Weblate (Romanian)

Currently translated at 14.9% (1611 of 10781 strings)

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

Signed-off-by: Remus-Gabriel Chelu <remusgabriel.chelu@disroot.org>
6 months agoTranslated using Weblate (Korean)
김인수 [Tue, 28 Jan 2025 17:19:41 +0000 (18:19 +0100)] 
Translated using Weblate (Korean)

Currently translated at 100.0% (10781 of 10781 strings)

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

Signed-off-by: 김인수 <simmon@nplob.com>
Translated using Weblate (Korean)

Currently translated at 99.6% (10745 of 10781 strings)

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

Signed-off-by: 김인수 <simmon@nplob.com>
Translated using Weblate (Korean)

Currently translated at 98.4% (10619 of 10781 strings)

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

Signed-off-by: 김인수 <simmon@nplob.com>
6 months agoTranslated using Weblate (Spanish)
Nicolás Gal [Tue, 28 Jan 2025 17:19:41 +0000 (18:19 +0100)] 
Translated using Weblate (Spanish)

Currently translated at 50.0% (5400 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
Translated using Weblate (Spanish)

Currently translated at 50.0% (5395 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
Translated using Weblate (Spanish)

Currently translated at 50.0% (5391 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
Translated using Weblate (Spanish)

Currently translated at 49.6% (5357 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
Translated using Weblate (Spanish)

Currently translated at 49.0% (5287 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
Translated using Weblate (Spanish)

Currently translated at 48.3% (5212 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
Translated using Weblate (Spanish)

Currently translated at 47.9% (5173 of 10781 strings)

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

Signed-off-by: Nicolas Gal <nialegal@yandex.com>
Translated using Weblate (Spanish)

Currently translated at 47.7% (5149 of 10781 strings)

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

Signed-off-by: Nicolas Gal <nialegal@yandex.com>
6 months agoTranslated using Weblate (Italian)
Salvatore Cocuzza [Tue, 28 Jan 2025 17:19:40 +0000 (18:19 +0100)] 
Translated using Weblate (Italian)

Currently translated at 21.4% (2315 of 10781 strings)

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

Signed-off-by: Salvatore Cocuzza <info@salvatorecocuzza.it>
6 months agoqemuProcessHandleIOError: Refactor to extract 'priv' instead of 'driver'
Peter Krempa [Fri, 24 Jan 2025 16:16:35 +0000 (17:16 +0100)] 
qemuProcessHandleIOError: Refactor to extract 'priv' instead of 'driver'

The VM private data will be used in a sub-sequent patch. To minimize
churn, refactor the function before changing the logic.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
6 months agobuild: Bump minimum glib2 version to 2.66.0
Peter Krempa [Mon, 27 Jan 2025 16:42:34 +0000 (17:42 +0100)] 
build: Bump minimum glib2 version to 2.66.0

Per our supported platforms the minimum available versions are:

         CentOS Stream 9: 2.68.4
               Debian 11: 2.66.8
               Fedora 39: 2.78.6
      openSUSE Leap 15.6: 2.78.6
            Ubuntu 22.04: 2.72.4
           FreeBSD ports: 2.80.5
          macOS homebrew: 2.82.4
          macOS macports: 2.78.4

Bump to 2.66 which is limited by Debian 11. While ideally we'd bump to
2.68 which would give us 'g_strv_builder' and friends 2.66 is enough for
g_ptr_array_steal() which can be used to emulate the former with almost
no extra code.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
6 months agoconf: check size of secret file for secret object
Adam Julis [Wed, 15 Jan 2025 13:27:20 +0000 (14:27 +0100)] 
conf: check size of secret file for secret object

Since the empty file with a .base64 value wasn't recognized during the loading
process (starting of libvirtd), attempting to get a value for the UUID resulted
in an undefined error. This patch resolves the issue by checking the size of
the file and ensuring that the stored value is as expected (NULL).

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Adam Julis <ajulis@redhat.com>
6 months agoch: Include unistd.h in ch_events.c
Michal Privoznik [Mon, 27 Jan 2025 15:51:55 +0000 (16:51 +0100)] 
ch: Include unistd.h in ch_events.c

There's a call to read() in the file but corresponding include of
unistd.h is missing causing a build failure.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
6 months agoqemu: Allow virDomainBlockJobSetSpeed during migration
Jiri Denemark [Fri, 24 Jan 2025 12:26:39 +0000 (13:26 +0100)] 
qemu: Allow virDomainBlockJobSetSpeed during migration

When a migration with non-shared storage is started with
VIR_MIGRATE_PARAM_BANDWIDTH set, it will be applied to both memory
migration and each block job started for storage migration. Once the
migration is running virDomainMigrateSetMaxSpeed may be used to change
the bandwidth used by memory migration, but there was no way of changing
storage migration speed. Let's allow virDomainBlockJobSetSpeed during
migration to enable the missing functionality.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
6 months agoqemu: Add support for avail-switchover-bandwidth migration parameter
Jiri Denemark [Thu, 23 Jan 2025 09:26:09 +0000 (10:26 +0100)] 
qemu: Add support for avail-switchover-bandwidth migration parameter

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
6 months agovirsh migrate: Add --available-switchover-bandwidth option
Jiri Denemark [Thu, 23 Jan 2025 09:25:10 +0000 (10:25 +0100)] 
virsh migrate: Add --available-switchover-bandwidth option

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
6 months agoAdd a migration parameter for available bandwidth in switchover
Jiri Denemark [Thu, 23 Jan 2025 09:21:10 +0000 (10:21 +0100)] 
Add a migration parameter for available bandwidth in switchover

The new VIR_MIGRATE_PARAM_BANDWIDTH_AVAIL_SWITCHOVER parameter can be
used to override the estimated bandwidth that can be used for
transferring guest memory and device state once virtual CPUs are
stopped.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
6 months agorpm: Unify handling of directories used for loadable modules
Andrea Bolognani [Tue, 21 Jan 2025 13:45:17 +0000 (14:45 +0100)] 
rpm: Unify handling of directories used for loadable modules

Now that meson ensures these directories always exist, we can
move them to the daemon-common package where they belong.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
6 months agorpm: Add missing Requires
Andrea Bolognani [Tue, 21 Jan 2025 14:06:10 +0000 (15:06 +0100)] 
rpm: Add missing Requires

All loadable modules should depend on the daemon-common package.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
6 months agomeson: Unify handling of directories used for loadable modules
Andrea Bolognani [Tue, 21 Jan 2025 10:27:13 +0000 (11:27 +0100)] 
meson: Unify handling of directories used for loadable modules

Currently the directories that are searched for each possible
kind of loadable module are created as a side effect of
installing the corresponding module, which means that their
availability depends on the exact list of features that have
been enabled.

Create them explicitly ahead of time instead, ensuring
consistency.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
6 months agoch: implement domainInterfaceAddresses
Anirudh Rayabharam [Thu, 12 Dec 2024 22:31:04 +0000 (16:31 -0600)] 
ch: implement domainInterfaceAddresses

Implement domainInterfaceAddresses for the Cloud Hypervisor driver.
Support VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_LEASE and
VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_ARP sources. Implementation is
similar to other drivers.

Signed-off-by: Anirudh Rayabharam <anrayabh@linux.microsoft.com>
Signed-off-by: Praveen K Paladugu <praveenkpaladugu@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
6 months agoNEWS: Mention event handling support in ch driver
Purna Pavan Chandra Aekkaladevi [Fri, 17 Jan 2025 17:11:09 +0000 (17:11 +0000)] 
NEWS: Mention event handling support in ch driver

Signed-off-by: Purna Pavan Chandra <paekkaladevi@linux.microsoft.com>
Signed-off-by: Purna Pavan Chandra Aekkaladevi <paekkaladevi@linux.microsoft.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
6 months agoch: events: facilitate lifecycle events handling
Purna Pavan Chandra Aekkaladevi [Fri, 17 Jan 2025 17:11:08 +0000 (17:11 +0000)] 
ch: events: facilitate lifecycle events handling

Implement `virCHProcessEvent` that maps event string to corresponding
event type and take appropriate actions. As part of this, handle the
shutdown event by correctly updating the domain state. This change also
facilitates the handling of other VM lifecycle events, such as booting,
rebooting, pause, resume, etc.

Signed-off-by: Purna Pavan Chandra Aekkaladevi <paekkaladevi@linux.microsoft.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
6 months agoch: events: Read and parse cloud-hypervisor events
Purna Pavan Chandra Aekkaladevi [Fri, 17 Jan 2025 17:11:07 +0000 (17:11 +0000)] 
ch: events: Read and parse cloud-hypervisor events

Implement `chReadProcessEvents` and `chProcessEvents` to read events from
event monitor FIFO file and parse them accordingly.

Signed-off-by: Purna Pavan Chandra Aekkaladevi <paekkaladevi@linux.microsoft.com>
Co-authored-by: Vineeth Pillai <viremana@linux.microsoft.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
6 months agoch: start a new thread for handling ch events
Purna Pavan Chandra Aekkaladevi [Fri, 17 Jan 2025 17:11:06 +0000 (17:11 +0000)] 
ch: start a new thread for handling ch events

Use a FIFO(named pipe) for --event-monitor option in CH. Introduce a new
thread, `virCHEventHandlerLoop`, to continuously monitor and handle
events from cloud-hypervisor.

Signed-off-by: Purna Pavan Chandra Aekkaladevi <paekkaladevi@linux.microsoft.com>
Co-authored-by: Vineeth Pillai <viremana@linux.microsoft.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
6 months agoch: pass --event-monitor option to cloud-hypervisor
Purna Pavan Chandra Aekkaladevi [Fri, 17 Jan 2025 17:11:05 +0000 (17:11 +0000)] 
ch: pass --event-monitor option to cloud-hypervisor

The `--event-monitor` option in cloud-hypervisor outputs events to a
specified file. This file can then be used to monitor VM lifecycle,
other vmm events and trigger appropriate actions.

Signed-off-by: Purna Pavan Chandra Aekkaladevi <paekkaladevi@linux.microsoft.com>
Co-authored-by: Vineeth Pillai <viremana@linux.microsoft.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>