]> git.ipfire.org Git - thirdparty/libvirt.git/log
thirdparty/libvirt.git
7 months agoconf: change virDomainDefMaybeAddVirtioSerialController() to return void
Laine Stump [Wed, 12 Feb 2025 03:53:30 +0000 (22:53 -0500)] 
conf: change virDomainDefMaybeAddVirtioSerialController() to return void

It can't fail.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
7 months agoconf: change virDomainDefAddDiskControllersForType() to return void
Laine Stump [Wed, 12 Feb 2025 03:51:32 +0000 (22:51 -0500)] 
conf: change virDomainDefAddDiskControllersForType() to return void

It can't fail.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
7 months agoconf: change virDomainDefMaybeAddHostdevSCSIcontroller() to return void
Laine Stump [Wed, 12 Feb 2025 03:48:07 +0000 (22:48 -0500)] 
conf: change virDomainDefMaybeAddHostdevSCSIcontroller() to return void

It can't fail.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
7 months agoconf: change virDomainDefMaybeAddController() to return true/false
Laine Stump [Wed, 12 Feb 2025 03:43:22 +0000 (22:43 -0500)] 
conf: change virDomainDefMaybeAddController() to return true/false

This function can't fail, but it has always returned 1 if a controller
is added and 0 if not, and there is one place that checks for a 1
return, so we remove the -1 return and change it to return true/false
instead of 1/0.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
7 months agohyperv: change hypervDomainDefAppendController() to return void
Laine Stump [Wed, 12 Feb 2025 02:43:26 +0000 (21:43 -0500)] 
hyperv: change hypervDomainDefAppendController() to return void

It can't fail. And as a result, hypervDomainDefAppendSCSIController() and
hypervDomainDefAppendIDEController() can also be changed to return void.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
7 months agoconf: change virDomainDefAddUSBController() to return void
Laine Stump [Wed, 12 Feb 2025 02:36:26 +0000 (21:36 -0500)] 
conf: change virDomainDefAddUSBController() to return void

It can't fail.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
7 months agoconf: stop checking for NULL return from virDomainDefAddController()
Laine Stump [Wed, 12 Feb 2025 02:31:09 +0000 (21:31 -0500)] 
conf: stop checking for NULL return from virDomainDefAddController()

It can't fail, so the caller doesn't need to check the return.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
7 months agoconf: stop checking for NULL return from virDomainControllerDefNew()
Laine Stump [Wed, 12 Feb 2025 02:08:03 +0000 (21:08 -0500)] 
conf: stop checking for NULL return from virDomainControllerDefNew()

It can't fail, so the caller doesn't need to check the return.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
7 months agoconf: change qemuDomainDefAddImplicitInputDevice() to return void
Laine Stump [Wed, 12 Feb 2025 01:55:39 +0000 (20:55 -0500)] 
conf: change qemuDomainDefAddImplicitInputDevice() to return void

It can't fail.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
7 months agolibxl: change xenDomainDefAddImplicitInputDevice() to return void
Laine Stump [Wed, 12 Feb 2025 01:44:51 +0000 (20:44 -0500)] 
libxl: change xenDomainDefAddImplicitInputDevice() to return void

It can't fail.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
7 months agoconf: change virDomainDefMaybeAddInput() to return void
Laine Stump [Tue, 11 Feb 2025 22:03:44 +0000 (17:03 -0500)] 
conf: change virDomainDefMaybeAddInput() to return void

It can't fail.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
7 months agoconf: change virDomainShmemDefInsert() to return void
Laine Stump [Tue, 11 Feb 2025 21:55:33 +0000 (16:55 -0500)] 
conf: change virDomainShmemDefInsert() to return void

It can't fail.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
7 months agoconf: change virDomainFSInsert() to return void
Laine Stump [Tue, 11 Feb 2025 21:52:45 +0000 (16:52 -0500)] 
conf: change virDomainFSInsert() to return void

It can't fail.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
7 months agoconf: change virDomainNetInsert() to return void
Laine Stump [Tue, 11 Feb 2025 21:49:17 +0000 (16:49 -0500)] 
conf: change virDomainNetInsert() to return void

It can't fail.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
7 months agoci: refresh with 'lcitool manifest'
Pavel Hrdina [Tue, 18 Feb 2025 18:16:01 +0000 (19:16 +0100)] 
ci: refresh with 'lcitool manifest'

Replace Alpine Linux v3.19 with v3.21.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
7 months agoci: use Fedora 41 to run integration tests
Pavel Hrdina [Tue, 18 Feb 2025 18:14:02 +0000 (19:14 +0100)] 
ci: use Fedora 41 to run integration tests

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
7 months agoci: use iptables to run libvirt-tck
Pavel Hrdina [Tue, 18 Feb 2025 18:10:58 +0000 (19:10 +0100)] 
ci: use iptables to run libvirt-tck

On current Fedora libvirt uses nftables by default but the libvirt-tck
tests are not ready for it and most of the nwfilter tests fail. We need
to keep using iptables for now.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
7 months agodocs/api.rst: revert erroneously change of Once -> OnDevice
Cleber Rosa [Tue, 4 Mar 2025 02:19:49 +0000 (21:19 -0500)] 
docs/api.rst: revert erroneously change of Once -> OnDevice

Commit af1b89d1d for some reason changed a perfectly fine statement to
one that I could not understand.  Let's revert it.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
7 months agomeson: Generate runstatedir according to newer standard
Michal Privoznik [Tue, 25 Feb 2025 16:49:20 +0000 (17:49 +0100)] 
meson: Generate runstatedir according to newer standard

While previously FHS 2.3 defined /var/run as a place to store
runtime information [1] it's no longer 2004 and newer
specification was released which favors /run [2]. Since it was
released 10 years ago, maybe it's time we start honouring it.

On majority of Linux systems (if not all), /var/run is a symlink
to /run anyways.

Users can still pass old location via -Drunstatedir.

1: https://refspecs.linuxfoundation.org/FHS_2.3/fhs-2.3.html#VARRUNRUNTIMEVARIABLEDATA
2: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch03s15.html

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
7 months agovirDomainHostdevDefNew: update users not to check return value
Roman Bogorodskiy [Wed, 26 Feb 2025 17:34:14 +0000 (18:34 +0100)] 
virDomainHostdevDefNew: update users not to check return value

virDomainHostdevDefNew() has been using g_new0() for a while now. As it
calls abort() on OOM, it's not necessary to check whether
the return value is NULL.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Laine Stump <laine@redhat.com>
7 months agoqemu: Add support for 'image_format' typed parameter
Jim Fehlig [Sat, 15 Feb 2025 00:01:38 +0000 (17:01 -0700)] 
qemu: Add support for 'image_format' typed parameter

Add support for the 'image_format' typed parameter in virDomainSaveParams.
The parameter overrides the 'save_image_format' setting in qemu.conf.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
7 months agoinclude: Define constant for save image format
Jim Fehlig [Fri, 14 Feb 2025 23:26:12 +0000 (16:26 -0700)] 
include: Define constant for save image format

Add a new VIR_DOMAIN_SAVE_PARAM_IMAGE_FORMAT typed parameter for
specifying the save image format. A format specified via the
virDomainSaveParams API overrides the save_image_format setting
in qemu.conf. The 'raw' format remains the default.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
7 months agoqemu: Check for valid save image formats when loading driver config
Jim Fehlig [Thu, 20 Feb 2025 21:28:35 +0000 (14:28 -0700)] 
qemu: Check for valid save image formats when loading driver config

Checking for valid 'foo_image_format' settings in qemu.conf is not done
until the settings are used. Move the checks to
virQEMUDriverConfigLoadSaveEntry, allowing to report incorrect format
settings at driver startup.

This change was made easier by also changing the corresponding fields
in the virQEMUDriverConfig to 'int', which is more in line with the
other fields that represent enumerated types.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
7 months agoqemu: Change return value of SaveImageGetCompressionProgram
Jim Fehlig [Wed, 12 Feb 2025 04:46:59 +0000 (21:46 -0700)] 
qemu: Change return value of SaveImageGetCompressionProgram

qemuSaveImageGetCompressionProgram is a bit overloaded. Along with
getting a compression program, it checks the validity of the image
format and returns the integer representation of the format. Change
the function to only handle retrieving the specified compression
program, returning success or failure. Checking the validity of
the image format can be left to the calling functions.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
7 months agoqemu: Don't ignore dump image format errors
Jim Fehlig [Thu, 20 Feb 2025 01:02:06 +0000 (18:02 -0700)] 
qemu: Don't ignore dump image format errors

Long ago, without justification, commit 48cb9f0542 changed
qemuGetCompressionProgram (since renamed to
qemuSaveImageGetCompressionProgram) to ignore configuration errors
for dump operations. Like the other save-related operations, user
provided configuration should be verified and an error reported if
it cannot be honored.

Remove the special handling of configuration errors in
qemuSaveImageGetCompressionProgram and change the dump logic to
fail when dump image format cannot be supported.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
7 months agoqemu: Move declaration of virQEMUSaveFormat to header file
Jim Fehlig [Tue, 14 Jan 2025 23:20:31 +0000 (16:20 -0700)] 
qemu: Move declaration of virQEMUSaveFormat to header file

Allow use of the enum outside of qemu_saveimage.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
7 months agoschemas: domaincaps: Add missing schema for '<cpu0Id>'
Peter Krempa [Mon, 3 Mar 2025 08:50:16 +0000 (09:50 +0100)] 
schemas: domaincaps: Add missing schema for '<cpu0Id>'

Fixes: 0236e6154c46603bc443eda2f05c8ce511c55b08
Resolves: https://issues.redhat.com/browse/RHEL-81890
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
7 months agoqemuPrepareNVRAMFile: Fix NVRAM image conversion check
Peter Krempa [Fri, 28 Feb 2025 13:00:23 +0000 (14:00 +0100)] 
qemuPrepareNVRAMFile: Fix NVRAM image conversion check

In case when user provides custom paths (those not covered by the JSON
firmware descriptor files or  the default locations) for the
loader and nvram template no auto-detection will be performed and user's
config will be taken at face value. Historically when 'templateFormat'
didn't exist we assumed that the 'format' field covers both.

Thus if 'templateFormat' is VIR_STORAGE_FILE_NONE we need to skip the
check forbidding image format conversion for 'file' backed to avoid
breaking legacy configs with manual/non-detected format assuming that
user picked the correct format.

Add a comment to the declaration of 'nvramTemplateFormat' noting the
above for future reference.

Resolves: https://issues.redhat.com/browse/RHEL-81731
Fixes: 2aa644a2fc8
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
7 months agoconf: metadata: remove metadata node if all metadata is removed
Ján Tomko [Thu, 20 Feb 2025 21:50:06 +0000 (22:50 +0100)] 
conf: metadata: remove metadata node if all metadata is removed

When removing the last child element from a network or domain
metadata, free the metadata node itself as well, to prevent
displaying an empty metadata element.

https://issues.redhat.com/browse/RHEL-27172

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
7 months agoconf: metadata: ignore empty metadata element
Ján Tomko [Thu, 20 Feb 2025 21:48:40 +0000 (22:48 +0100)] 
conf: metadata: ignore empty metadata element

Do not copy the <metadata> node to domain/network definition
if its empty.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
7 months agoconf: obj: remove extra empty line
Ján Tomko [Thu, 20 Feb 2025 21:45:25 +0000 (22:45 +0100)] 
conf: obj: remove extra empty line

Originally present in virDomainDefSetMetadata it got copied to
virNetworkDefSetMetadata too.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
7 months agoconf: networkobj: fix indentation
Ján Tomko [Thu, 20 Feb 2025 21:36:11 +0000 (22:36 +0100)] 
conf: networkobj: fix indentation

'Network' has one more letter than 'Domain' where these helpers
were copied from. Shift the unaligned lines by one.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
7 months agocpu_map: arm: Add AmpereOne CPU models
Jiri Denemark [Wed, 26 Feb 2025 12:35:41 +0000 (13:35 +0100)] 
cpu_map: arm: Add AmpereOne CPU models

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
7 months agocpu_arm: Report vendor ID for unknown PVRs
Jiri Denemark [Wed, 26 Feb 2025 12:20:56 +0000 (13:20 +0100)] 
cpu_arm: Report vendor ID for unknown PVRs

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
7 months agoqemuDomainGetGuestInfo: Remove temporary infrastructure
Peter Krempa [Wed, 26 Feb 2025 15:49:52 +0000 (16:49 +0100)] 
qemuDomainGetGuestInfo: Remove temporary infrastructure

Now that the refactor was completed the helper infrastructure can be
removed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
7 months agoqemuDomainGetGuestInfo: Convert hostname code to virTypedParamList
Peter Krempa [Wed, 26 Feb 2025 13:42:03 +0000 (14:42 +0100)] 
qemuDomainGetGuestInfo: Convert hostname code to virTypedParamList

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
7 months agoqemuAgentGetUsers: Convert to virTypedParamList
Peter Krempa [Wed, 26 Feb 2025 13:42:03 +0000 (14:42 +0100)] 
qemuAgentGetUsers: Convert to virTypedParamList

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
7 months agoqemuAgentGetOSInfo: Convert to virTypedParamList
Peter Krempa [Wed, 26 Feb 2025 13:42:03 +0000 (14:42 +0100)] 
qemuAgentGetOSInfo: Convert to virTypedParamList

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
7 months agoqemuAgentGetTimezone: Convert to virTypedParamList
Peter Krempa [Wed, 26 Feb 2025 13:42:03 +0000 (14:42 +0100)] 
qemuAgentGetTimezone: Convert to virTypedParamList

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
7 months agoqemuAgentFSInfoFormatParams: Convert interface code to virTypedParamList
Peter Krempa [Wed, 26 Feb 2025 13:42:03 +0000 (14:42 +0100)] 
qemuAgentFSInfoFormatParams: Convert interface code to virTypedParamList

Also remove stale TODO comment as we already report disk target.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
7 months agoqemuAgentDiskInfoFormatParams: Convert interface code to virTypedParamList
Peter Krempa [Wed, 26 Feb 2025 13:42:03 +0000 (14:42 +0100)] 
qemuAgentDiskInfoFormatParams: Convert interface code to virTypedParamList

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
7 months agovirDomainInterfaceFormatParams: Convert interface code to virTypedParamList
Peter Krempa [Wed, 26 Feb 2025 13:42:03 +0000 (14:42 +0100)] 
virDomainInterfaceFormatParams: Convert interface code to virTypedParamList

Also deletes pre-existing broken formatting.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
7 months agoqemuDomainGetGuestInfo: Convert load code to virTypedParamList
Peter Krempa [Wed, 26 Feb 2025 13:42:03 +0000 (14:42 +0100)] 
qemuDomainGetGuestInfo: Convert load code to virTypedParamList

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
7 months agoqemuDomainGetGuestInfo: Prepare for refactor to virTypedParamList
Peter Krempa [Wed, 26 Feb 2025 13:38:15 +0000 (14:38 +0100)] 
qemuDomainGetGuestInfo: Prepare for refactor to virTypedParamList

Use of raw typed param APIs is very clunky. Prepare
qemuDomainGetGuestInfo for step-by-step refactor to virTypedParamList.

The two lists will coexist until the refactor is complete.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
7 months agoqemu: Report disk bus as reported by agent in virDomainGetGuestInfo
Peter Krempa [Wed, 26 Feb 2025 11:44:02 +0000 (12:44 +0100)] 
qemu: Report disk bus as reported by agent in virDomainGetGuestInfo

KubeVirt decided to report this to the users. In order to allow them to
use proper APIs expose the field as well.

Resolves: https://issues.redhat.com/browse/RHEL-80688
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
7 months agovirsh: Add support for VIR_DOMAIN_GUEST_INFO_LOAD
Martin Kletzander [Tue, 25 Feb 2025 14:22:35 +0000 (15:22 +0100)] 
virsh: Add support for VIR_DOMAIN_GUEST_INFO_LOAD

Resolves: https://issues.redhat.com/browse/RHEL-71883
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
7 months agoqemu: Add support for VIR_DOMAIN_GUEST_INFO_LOAD
Martin Kletzander [Tue, 25 Feb 2025 14:36:32 +0000 (15:36 +0100)] 
qemu: Add support for VIR_DOMAIN_GUEST_INFO_LOAD

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
7 months agoqemu_agent: Add qemuAgentGetLoadAvg()
Martin Kletzander [Tue, 25 Feb 2025 14:23:07 +0000 (15:23 +0100)] 
qemu_agent: Add qemuAgentGetLoadAvg()

With qemu guest agent 9.3 we are able to get the load averages with a
new command.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
7 months agoAdd load average information type into virDomainGetGuestInfo
Martin Kletzander [Tue, 25 Feb 2025 14:36:03 +0000 (15:36 +0100)] 
Add load average information type into virDomainGetGuestInfo

The public API part.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
7 months agoPost-release version bump to 11.2.0
Jiri Denemark [Mon, 3 Mar 2025 12:42:18 +0000 (13:42 +0100)] 
Post-release version bump to 11.2.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
7 months agoRelease of libvirt-11.1.0 v11.1.0
Jiri Denemark [Mon, 3 Mar 2025 12:12:30 +0000 (13:12 +0100)] 
Release of libvirt-11.1.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
7 months agoTranslated using Weblate (Korean)
김인수 [Sat, 1 Mar 2025 03:12:33 +0000 (03:12 +0000)] 
Translated using Weblate (Korean)

Currently translated at 99.4% (10783 of 10838 strings)

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

Signed-off-by: 김인수 <simmon@nplob.com>
7 months agoNEWS: Document crasher fix in qemuDomainCheckCPU
Jiri Denemark [Thu, 27 Feb 2025 15:09:45 +0000 (16:09 +0100)] 
NEWS: Document crasher fix in qemuDomainCheckCPU

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
7 months agoNEWS: Document features/improvements/bug fixes I've participated in
Michal Privoznik [Thu, 27 Feb 2025 14:14:54 +0000 (15:14 +0100)] 
NEWS: Document features/improvements/bug fixes I've participated in

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

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
7 months agoTranslated using Weblate (Ukrainian) v11.1.0-rc2
Yuri Chornoivan [Tue, 25 Feb 2025 14:49:16 +0000 (15:49 +0100)] 
Translated using Weblate (Ukrainian)

Currently translated at 100.0% (10838 of 10838 strings)

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

Signed-off-by: Yuri Chornoivan <yurchor@ukr.net>
Translated using Weblate (Ukrainian)

Currently translated at 99.4% (10774 of 10838 strings)

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

Signed-off-by: Yuri Chornoivan <yurchor@ukr.net>
7 months agoTranslated using Weblate (Korean)
김인수 [Tue, 25 Feb 2025 14:49:15 +0000 (15:49 +0100)] 
Translated using Weblate (Korean)

Currently translated at 99.4% (10781 of 10838 strings)

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

Signed-off-by: 김인수 <simmon@nplob.com>
7 months agodocs: formatdomain: fix typo in passt section
Ján Tomko [Wed, 26 Feb 2025 09:45:20 +0000 (10:45 +0100)] 
docs: formatdomain: fix typo in passt section

A mismatch in backticks happened.

Fixes: a47a89a9d335c111a9c2fbb3f4e1c3a13001e74b
Reported-by: Yalan Zhang <yalzhang@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 months agoqemucapabilitiestest: Update 'caps_10.0.0_x86_64' to 'v9.2.0-1967-gb69801dd6b'
Peter Krempa [Mon, 24 Feb 2025 15:52:20 +0000 (16:52 +0100)] 
qemucapabilitiestest: Update 'caps_10.0.0_x86_64' to 'v9.2.0-1967-gb69801dd6b'

Notable changes:
 - 'NETDEV_VHOST_USER_CONNECTED'/'NETDEV_VHOST_USER_DISCONNECTED' events
   added
 - 'handshake-max-seconds' argument for 'nbd-server-start' added

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 months agoapparmor: Allow SGX if configured
Michal Privoznik [Tue, 25 Feb 2025 10:01:04 +0000 (11:01 +0100)] 
apparmor: Allow SGX if configured

If SGX memory model is configured for domain then we need to
allow QEMU access some additional files:

  1) /dev/sgx_vepc needs to be RW
  2) /dev/sgx_provision needs to be RO

We already do this in SELinux driver but not in AppArmor.

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/751

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
7 months agocpu: Do not call g_strv_contains on NULL list
Jiri Denemark [Mon, 24 Feb 2025 10:24:27 +0000 (11:24 +0100)] 
cpu: Do not call g_strv_contains on NULL list

When virCPUx86UpdateLive checks whether a feature was added to a CPU
model after the model was already released (vmx-* features in most Intel
models), the following assert could be logged by glib:

    g_strv_contains: assertion 'strv != NULL' failed

While most of our CPU models have a non-empty list of added feature, new
models added in 2024 and versioned variants of older models have
addedFeatures == NULL.

Fixes: e622970c8785ec1f7e142d72f792d89f870e07d0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
7 months agorun: Use correct SELinux context for modular daemons
Jiri Denemark [Mon, 24 Feb 2025 11:15:39 +0000 (12:15 +0100)] 
run: Use correct SELinux context for modular daemons

Only libvirtd uses virtd_t/virt_exec_t context, modular daemons use
their specific context each.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
7 months agoUpdate translation files
Weblate [Mon, 24 Feb 2025 11:52:22 +0000 (12:52 +0100)] 
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>
7 months agopo: Refresh potfile for v11.1.0 v11.1.0-rc1
Jiri Denemark [Mon, 24 Feb 2025 11:54:04 +0000 (12:54 +0100)] 
po: Refresh potfile for v11.1.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
7 months agobuild: Enable syntax checks for vshError and vshWarn
Jiri Denemark [Thu, 20 Feb 2025 13:02:33 +0000 (14:02 +0100)] 
build: Enable syntax checks for vshError and vshWarn

To make sure both error and warning messages printed by virsh are
properly marked for translation.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
7 months agovirsh: Let prohibit_newline_at_end_of_diagnostic check pass
Jiri Denemark [Thu, 20 Feb 2025 13:41:32 +0000 (14:41 +0100)] 
virsh: Let prohibit_newline_at_end_of_diagnostic check pass

The prohibit_newline_at_end_of_diagnostic syntax check is confused when
another unrelated translatable message with a newline is too close to
the function it is supposed to check. Refactoring the code to make the
two strings further apart seems like the easiest solution.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
7 months agovirsh: Drop extra newlines at the end of error messages
Jiri Denemark [Thu, 20 Feb 2025 13:28:22 +0000 (14:28 +0100)] 
virsh: Drop extra newlines at the end of error messages

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
7 months agovirsh: Avoid using translated messages without format
Jiri Denemark [Thu, 20 Feb 2025 13:23:33 +0000 (14:23 +0100)] 
virsh: Avoid using translated messages without format

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
7 months agovirsh: Properly mark all error messages for translation
Jiri Denemark [Thu, 20 Feb 2025 13:03:48 +0000 (14:03 +0100)] 
virsh: Properly mark all error messages for translation

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
7 months agovirsh: Do not require \n in vshDebug messages
Jiri Denemark [Thu, 20 Feb 2025 13:04:08 +0000 (14:04 +0100)] 
virsh: Do not require \n in vshDebug messages

Having to put a newline at the end of each debug message in virsh has
always felt strange.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
7 months agovirsh: Warn when hypervisor-cpu-* is used with host CPU
Jiri Denemark [Thu, 20 Feb 2025 12:30:36 +0000 (13:30 +0100)] 
virsh: Warn when hypervisor-cpu-* is used with host CPU

While using host CPU definition from capabilities XML is allowed for
historical reasons, it will likely provide incorrect results and should
be avoided.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
7 months agovirsh: Introduce vshWarn
Jiri Denemark [Thu, 20 Feb 2025 12:17:47 +0000 (13:17 +0100)] 
virsh: Introduce vshWarn

This new function can be used for printing warnings about suboptimal
usage.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
7 months agovirsh: Refactor vshError
Jiri Denemark [Thu, 20 Feb 2025 12:12:22 +0000 (13:12 +0100)] 
virsh: Refactor vshError

The code is moved into a newly introduced generic vshPrintStderr and
vshError changed into a tiny wrapper.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
7 months agovirsh: Make messages printed by vshError properly translatable
Jiri Denemark [Thu, 20 Feb 2025 12:06:38 +0000 (13:06 +0100)] 
virsh: Make messages printed by vshError properly translatable

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
7 months agovirsh: Do not format messages twice
Jiri Denemark [Thu, 20 Feb 2025 11:49:43 +0000 (12:49 +0100)] 
virsh: Do not format messages twice

The same message was formatted both in vshOutputLogFile and in vshDebug
and vshError functions. This patch refactor vshOutputLogFile and its
callers to only format each message once.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
7 months agodocs: Clarify documentation of virsh hypervisor-cpu-baseline
Jiri Denemark [Wed, 19 Feb 2025 15:16:58 +0000 (16:16 +0100)] 
docs: Clarify documentation of virsh hypervisor-cpu-baseline

Using host CPU definition with hypervisor-cpu-baseline is possible, but
it provide incorrect results and thus it should not be documented the
same way we describe the correct usage. Also using host-model CPU from
domain capabilities was not described clearly enough.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
7 months agodocs: Clarify documentation of virsh hypervisor-cpu-compare
Jiri Denemark [Wed, 19 Feb 2025 13:42:04 +0000 (14:42 +0100)] 
docs: Clarify documentation of virsh hypervisor-cpu-compare

Using host CPU definition with hypervisor-cpu-compare is possible, but
it provide incorrect results and thus it should not be documented the
same way we describe the correct usage. Also using host-model CPU from
domain capabilities was not described clearly enough.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
7 months agoTranslated using Weblate (Chinese (Simplified) (zh_CN))
jianqing yan [Thu, 20 Feb 2025 14:49:27 +0000 (15:49 +0100)] 
Translated using Weblate (Chinese (Simplified) (zh_CN))

Currently translated at 93.6% (10094 of 10781 strings)

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

Signed-off-by: jianqing yan <yanjianqing@kylinos.cn>
7 months agoTranslated using Weblate (Telugu)
Anonymous [Thu, 20 Feb 2025 14:49:26 +0000 (15:49 +0100)] 
Translated using Weblate (Telugu)

Currently translated at 43.9% (4742 of 10781 strings)

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

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

Currently translated at 19.4% (2099 of 10781 strings)

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

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

Currently translated at 44.2% (4768 of 10781 strings)

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

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

Currently translated at 27.2% (2940 of 10781 strings)

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

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

Currently translated at 93.5% (10086 of 10781 strings)

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

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

Currently translated at 44.7% (4829 of 10781 strings)

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

Signed-off-by: Anonymous <noreply@weblate.org>
7 months agoschema: fix <interleave> errors when validating <domain> subelements
Laine Stump [Fri, 21 Feb 2025 01:13:06 +0000 (20:13 -0500)] 
schema: fix <interleave> errors when validating <domain> subelements

I first noticed a problem when I added a <memoryBacking> element at an
unusual (but still correct) place in the domain XML, and validation
failed. Then I tried adding that element in several different places
and it failed in many, but not all of them.

(NB: from here on, I will use '' for the names of attributes in the
domain XML, <> for elements in the domain XML, and "" for the names of
grammar rule definitions in the RNG file, and "<>" for the names of
elements in the RNG file's own XML. Confused yet? If so, please tell
me a better way - everything I know about RNG I've picked up
informally by looking at examples in already existing RNG files)

Starting from the top level of the grammar for <domain>
("domaincontents" in domaincommon.rng), I noticed that

1) the "<attribute>" for the 'id' attribute of <domain> is defined
   inside an "<interleave>" down in the definition of "ids" (which is
   referenced from "domaincontents") (I'm not familiar with the
   nomenclature - does that make it a "sub-grammer", "child-grammar",
   ???)

2) although the definition of "ids", had all of its
   "<attribute>"s/"<element>"s inside an "<interleave>",
   "domaincontents" already had the reference to "ids" inside an
   "<interleave>", so there were nested "<interleave>"s.

It's not clear to me how an "<attribute>" or "<interleave>" inside
another "<interleave>" is supposed to behave, but they both seemed a
bit suspicious.

I tried all of the below modifications:

1) moving the grammar for the 'id' attribute out of the "<interleave>"
   but still inside "ids"

2) moving the grammer for the 'id' attribute directly into
   "domaincontents" (and outside of its "interleave"

3) removing the "<interleave>" that was inside "ids"

4) (2) + (3)

5) move the entire grammar rule "ids" up directly in place of <ref
   name="ids"> in "domaincontents".

6) (5), but with the grammar for the 'id' attribute moved outside of
   the "<interleave>"

(6) was the only change that allowed all of the following (using
modifications to the subelements of <domain> in
net-vhostuser-passt.xml as example):

a) a <memoryBacking> element in between *any* two existing elements

b) moving <name> in between any two elements

c) oddly, in addition to the problem with putting <memoryBacking> in
   odd places, I also found that the original RNG did not allow the
   <clock> element to be placed in between <on_poweroff> and
   <on_reboot>, but once I'd made the change in (6), this was no
   longer problematic. Why should this have any effect? No idea, but
   it works :-/

(NB: there are many other cases of referencing "sub-grammar" from
inside an "<interleave>", and they all seem to work just fine;
possibly in this case it was problematic because the sub-grammar a)
also contained an "<interleave>", b) had an "<attribute>" at its
toplevel, or c) had multiple "<element>"s.)

(inexplicably (to me) at one point during my experimentation, I tried
reordering the references to "clock", "resources", "features", and
"events", and that *also* made it legal to put a <clock> element in
between the <on_*> elements:-O)

Since I was no longer able to reproduce the error described in (c)
once I had made mod (6) (move all of "ids" directly into
"domaincontent", I decided it was pointless for me to spend any more
time randomly poking and just add that to the new test case for that
in case some other random change to the RNG causes it to start failing
again.

(I thought of writing a test program that would try all possible
orderings of the subelements of <domain>, but since doing that for
even 10 subelements would mean testing > 3.2 million different XML
documents, I decided we could continue in this adhoc manner, just
adding a single new test case if/when a new validation failure is
found.)

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
7 months agotests: be consistent about following DO_TEST_*() with a ;
Laine Stump [Fri, 21 Feb 2025 04:24:05 +0000 (23:24 -0500)] 
tests: be consistent about following DO_TEST_*() with a ;

As is often the case with macros (especially those that resolve to
multiple statements), it isn't technically necessary to end any of the
invocations of the DO_TEST_*() macros with a semicolon (as evidenced
by the lines changed in this path). Having does make some
auto-indenters (e.g. cc-mode in emacs) more likely to do the right
thing, though, and it also looks nicer if all the lines are similar.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
8 months agoconf: Validate that iothreads are used only with 'virtio-scsi' controllers
Peter Krempa [Fri, 14 Feb 2025 15:30:58 +0000 (16:30 +0100)] 
conf: Validate that iothreads are used only with 'virtio-scsi' controllers

The documentation states:

 ``iothread``
    Supported for controller type ``scsi`` using model ``virtio-scsi`` for
    ``address`` types ``pci`` and ``ccw`` :since:`since 1.3.5 (QEMU 2.4)`. The

The code itself didn't validate if iothread is specified for any other
controller type.

Add test case showing the issue on one example.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
8 months agoconf: schemas: Rename 'diskDriverIothreads' to 'iothreadMapping'
Peter Krempa [Fri, 14 Feb 2025 13:07:43 +0000 (14:07 +0100)] 
conf: schemas: Rename 'diskDriverIothreads' to 'iothreadMapping'

The schema definition will be reused when adding iothread<->virtqueue
mapping for 'virtio-scsi'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
8 months agoqemuValidateCheckSCSIControllerIOThreads: Return '0' and '-1' instead of bools
Peter Krempa [Fri, 14 Feb 2025 14:23:54 +0000 (15:23 +0100)] 
qemuValidateCheckSCSIControllerIOThreads: Return '0' and '-1' instead of bools

The function reports libvirt errors so stick with the usual '0' and '-1'
return values.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
8 months agoqemu: validate: Extract iothread mapping validation code
Peter Krempa [Fri, 14 Feb 2025 12:31:25 +0000 (13:31 +0100)] 
qemu: validate: Extract iothread mapping validation code

Extract the code to 'qemuDomainValidateIothreadMapping'. It will be
reused to validate the mapping for 'virtio-scsi' iothreads.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
8 months agoqemu: command: Rename 'qemuBuildDiskDeviceIothreadMappingProps' to 'qemuBuildIothread...
Peter Krempa [Fri, 14 Feb 2025 11:38:49 +0000 (12:38 +0100)] 
qemu: command: Rename 'qemuBuildDiskDeviceIothreadMappingProps' to 'qemuBuildIothreadMappingProps'

Prepare for reuse of the code for 'virtio-scsi' controller.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
8 months agohypervisor: domain: Extract code for checking iothread usage
Peter Krempa [Fri, 14 Feb 2025 11:13:02 +0000 (12:13 +0100)] 
hypervisor: domain: Extract code for checking iothread usage

The code will be also needed for 'virtio-scsi' controller definitions.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
8 months agoconf: domain: Extract code for parsing and formatting iothread mapping definition
Peter Krempa [Fri, 14 Feb 2025 11:13:02 +0000 (12:13 +0100)] 
conf: domain: Extract code for parsing and formatting iothread mapping definition

The code will be also needed for 'virtio-scsi' controller definitions.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
8 months agoconf: Rename 'virDomainDiskIothreadDef' to 'virDomainIothreadMappingDef'
Peter Krempa [Tue, 11 Feb 2025 16:59:57 +0000 (17:59 +0100)] 
conf: Rename 'virDomainDiskIothreadDef' to 'virDomainIothreadMappingDef'

The iothread mapping will be also possible for 'virtio-scsi' controllers
so rename the corresponding structs to a generic name.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
8 months agodocs: formatdomain: Mention that vhostuser interface with mode='server' waits for...
Peter Krempa [Mon, 17 Feb 2025 15:11:23 +0000 (16:11 +0100)] 
docs: formatdomain: Mention that vhostuser interface with mode='server' waits for connection

When starting a VM with a vhost-user interface in server mode qemu will
wait for the incoming connection without running CPUs. This isn't really
documented in our XML. Additionally when hotplugging the same interface
the above will not happen.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
8 months agodocs: formatdomain: Document few NVRAM config limitations
Peter Krempa [Mon, 17 Feb 2025 14:56:08 +0000 (15:56 +0100)] 
docs: formatdomain: Document few NVRAM config limitations

Note that 'block' backed NVRAM may need to use 'qcow2' images to work
properly and that populating from template may not support format
conversion.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
8 months agoqemuDomainGetStats: Convert worker functions to void
Peter Krempa [Mon, 17 Feb 2025 13:33:31 +0000 (14:33 +0100)] 
qemuDomainGetStats: Convert worker functions to void

The presence of a return value made it seem that it's expected to fail
on errors which is not the case. The function is designed to skip
anything it can't fill and not fail when fetching individual stats.

Convert the workers to void to make it clear that it's expected not
to fail.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
8 months agoqemuDomainGetStatsDirtyRate: Don't error out
Peter Krempa [Mon, 17 Feb 2025 12:55:08 +0000 (13:55 +0100)] 
qemuDomainGetStatsDirtyRate: Don't error out

The bulk domain stats API is meant to collect as much data as possible
without erroring out.

If fetching of the dirty rate stats fails just skip outputting them.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
8 months agoqemuDomainGetStatsMemoryBandwidth: Don't error out
Peter Krempa [Mon, 17 Feb 2025 12:55:08 +0000 (13:55 +0100)] 
qemuDomainGetStatsMemoryBandwidth: Don't error out

The bulk domain stats API is meant to collect as much data as possible
without erroring out.

If fetching of the memory bandwidth stats fails just skip outputting them.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
8 months agoqemuDomainGetStatsIOThread: Don't error out if fetching iothread info fails
Peter Krempa [Mon, 17 Feb 2025 13:22:46 +0000 (14:22 +0100)] 
qemuDomainGetStatsIOThread: Don't error out if fetching iothread info fails

The bulk domain stats API is meant to collect as much data as possible
without erroring out. Ignore errors from 'qemuDomainGetIOThreadsMon()'
and skip the data if an error happens.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
8 months agoqemuDomainGetStatsPerfOneEvent: Ignore erros from 'virPerfReadEvent'
Peter Krempa [Mon, 17 Feb 2025 13:19:54 +0000 (14:19 +0100)] 
qemuDomainGetStatsPerfOneEvent: Ignore erros from 'virPerfReadEvent'

The bulk domain stats API is meant to collect as much data as possible
without erroring out. Skip the perf stats if we can't fetch them instead
of erroring out.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
8 months agovirPerfReadEvent: Refactor to return -errno on failure
Peter Krempa [Mon, 17 Feb 2025 13:16:04 +0000 (14:16 +0100)] 
virPerfReadEvent: Refactor to return -errno on failure

The function didn't comply with libvirt's error reporting scheme as it
reported libvirt errors only sometimes. As callers may want to ignore
errors convert it to returning -errno on failure instead.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
8 months agoqemuDomainGetStatsCpuCache: Don't error out
Peter Krempa [Mon, 17 Feb 2025 12:55:08 +0000 (13:55 +0100)] 
qemuDomainGetStatsCpuCache: Don't error out

The bulk domain stats API is meant to collect as much data as possible
without erroring out.

If fetching of the cache stats fails just skip outputting them.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
8 months agoqemuDomainGetStatsCpuHaltPollTime: Remove return value
Peter Krempa [Mon, 17 Feb 2025 12:51:10 +0000 (13:51 +0100)] 
qemuDomainGetStatsCpuHaltPollTime: Remove return value

The function can't fail. Remove return value and refactor callers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
8 months agoqemuDomainGetStatsCpuProc: Remove return value
Peter Krempa [Mon, 17 Feb 2025 12:51:10 +0000 (13:51 +0100)] 
qemuDomainGetStatsCpuProc: Remove return value

The function can't fail. Remove return value and refactor callers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
8 months agoqemuDomainGetStatsCpuCgroup: Remove return value
Peter Krempa [Mon, 17 Feb 2025 12:51:10 +0000 (13:51 +0100)] 
qemuDomainGetStatsCpuCgroup: Remove return value

The function can't fail. Remove return value and refactor callers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>