[PATCH] qemu: forbid a few unsupported things for vhost-user/passt interfaces

2025-02-20 Thread Laine Stump
passt in vhost-user mode doesn't support using multiple queues. The path of the socket is auto-generated by libvirt for vhost-user/passt; it can't be set by the user The passt end of a vhost-user socket is always the server, and the qemu end is always a client. Signed-off-by: Laine Stump --- s

[PATCH 2/2] schema: fix errors when validating subelements

2025-02-20 Thread Laine Stump
I first noticed a problem when I added a 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

[PATCH 1/2] tests: be consistent about following DO_TEST_*() with a ;

2025-02-20 Thread Laine Stump
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 em

[PATCH 0/2] schema: fix errors when validating subelements

2025-02-20 Thread Laine Stump
More explanation in 2/2 (such as it is) Laine Stump (2): tests: be consistent about following DO_TEST_*() with a ; schema: fix errors when validating subelements src/conf/schemas/domaincommon.rng | 53 +++- ...rder-domain-subelements.x86_64-latest.args | 40

Re: [PATCH V2 4/4] qemu: Check for valid save image formats when loading driver config

2025-02-20 Thread Jim Fehlig via Devel
On 2/20/25 17:11, Jim Fehlig wrote: 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 changi

[PATCH V2 2/2] qemu: Add support for 'image_format' typed parameter

2025-02-20 Thread Jim Fehlig via Devel
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 --- src/qemu/qemu_driver.c | 20 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/qemu

[PATCH V2 1/2] include: Define constant for save image format

2025-02-20 Thread Jim Fehlig via Devel
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 Reviewed-by: Daniel P. Berran

[PATCH V2 0/2] qemu: Support specifying save image format

2025-02-20 Thread Jim Fehlig via Devel
V2 of https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/message/ISSWUH6FM4IMWG5HLUMIKCYRJC2XTAZM/ Changes in V2: * Adjusted patch2 after moving verification of save image formats to driver startup in the series this one is based on https://lists.libvirt.org/archives/list/devel@list

[PATCH V2 4/4] qemu: Check for valid save image formats when loading driver config

2025-02-20 Thread Jim Fehlig via Devel
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 vir

[PATCH V2 3/4] qemu: Change return value of SaveImageGetCompressionProgram

2025-02-20 Thread Jim Fehlig via Devel
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 fa

[PATCH V2 2/4] qemu: Don't ignore dump image format errors

2025-02-20 Thread Jim Fehlig via Devel
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

[PATCH V2 1/4] qemu: Move declaration of virQEMUSaveFormat to header file

2025-02-20 Thread Jim Fehlig via Devel
Allow use of the enum outside of qemu_saveimage. Signed-off-by: Jim Fehlig Reviewed-by: Daniel P. Berrangé --- src/qemu/qemu_saveimage.c | 19 --- src/qemu/qemu_saveimage.h | 19 +++ 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/qemu/qemu_s

[PATCH V2 0/4] qemu: Small cleanups to SaveImageGetCompressionProgram

2025-02-20 Thread Jim Fehlig via Devel
V2 of https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/message/SKVPVQ36ND7GHZN27RTYLUXHP5GCUI4B/ Changes in V2: * V1 moved the special-case handling of invalid dump image format to doCoreDump. V2 removes it, and fails on invalid configuration similar to the other save-related op

[libvirt PATCH] tools: virsh: metadata: do not report error on missing metadata

2025-02-20 Thread Ján Tomko
Similarly to `desc` and `net-desc`, return an empty string if there is no metadata to be returned. https://issues.redhat.com/browse/RHEL-27172 Signed-off-by: Ján Tomko --- tools/virsh-domain.c | 10 -- tools/virsh-network.c | 10 -- 2 files changed, 16 insertions(+), 4 deletion

[libvirt PATCHv1 0/4] do not format empty metadata element

2025-02-20 Thread Ján Tomko
https://issues.redhat.com/browse/RHEL-27172 Ján Tomko (4): conf: networkobj: fix indentation conf: obj: remove extra empty line conf: metadata: ignore empty metadata element conf: metadata: remove metadata node if all metadata is removed src/conf/domain_conf.c | 8 +-- src/conf/ne

[libvirt PATCHv1 4/4] conf: metadata: remove metadata node if all metadata is removed

2025-02-20 Thread Ján Tomko
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 --- src/conf/domain_conf.c | 3 +++ src/conf/virnetworkobj.c | 3

[libvirt PATCHv1 3/4] conf: metadata: ignore empty metadata element

2025-02-20 Thread Ján Tomko
Do not copy the node to domain/network definition if its empty. Signed-off-by: Ján Tomko --- src/conf/domain_conf.c | 4 +++- src/conf/network_conf.c | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 878d1f68c1..6ca604

[libvirt PATCHv1 2/4] conf: obj: remove extra empty line

2025-02-20 Thread Ján Tomko
Originally present in virDomainDefSetMetadata it got copied to virNetworkDefSetMetadata too. Signed-off-by: Ján Tomko --- src/conf/domain_conf.c | 1 - src/conf/virnetworkobj.c | 1 - 2 files changed, 2 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 49555efc56

[libvirt PATCHv1 1/4] conf: networkobj: fix indentation

2025-02-20 Thread Ján Tomko
'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 --- src/conf/virnetworkobj.c | 44 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/src/conf/virnet

Re: [PATCH] NEWS: Improve mention of vTPM transient VM crash fix in v11.0.0

2025-02-20 Thread Peter Krempa
On Thu, Feb 20, 2025 at 11:59:00 +0100, Ján Tomko wrote: > On a Wednesday in 2025, Peter Krempa wrote: > > The original NEWS entry for the vTPM transient VM crash was rather > > vague and non-actionable. > > > > Apologies for not making it more descriptive. > > > I'm not convinced the NEWS shou

[PATCH 06/13] virsh: Introduce vshWarn

2025-02-20 Thread Jiri Denemark
This new function can be used for printing warnings about suboptimal usage. Signed-off-by: Jiri Denemark --- tools/virsh-secret.c | 2 +- tools/vsh.c | 13 - tools/vsh.h | 2 ++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/tools/virsh-secret.c b

[PATCH v2 0/6] qemu: acpi-generic-initiator support

2025-02-20 Thread Andrea Righi via Devel
= Overview = This patch set introduces support for acpi-generic-initiator devices, supported by QEMU [1]. The acpi-generic-initiator object is required to support Multi-Instance GPU (MIG) configurations on NVIDIA GPUs [2]. MIG enables partitioning of GPU resources into multiple isolated instances

[PATCH 13/13] build: Enable syntax checks for vshError and vshWarn

2025-02-20 Thread Jiri Denemark
To make sure both error and warning messages printed by virsh are properly marked for translation. Signed-off-by: Jiri Denemark --- build-aux/syntax-check.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index bd3dd6cb

[PATCH 02/13] docs: Clarify documentation of virsh hypervisor-cpu-baseline

2025-02-20 Thread Jiri Denemark
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 -

[PATCH 12/13] virsh: Let prohibit_newline_at_end_of_diagnostic check pass

2025-02-20 Thread Jiri Denemark
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 Denema

[PATCH 11/13] virsh: Drop extra newlines at the end of error messages

2025-02-20 Thread Jiri Denemark
Signed-off-by: Jiri Denemark --- tools/virsh-domain.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 2db88a1a7d..c8c341b3d1 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -2648,7 +2648,7 @@ virshBlockJob

[PATCH 10/13] virsh: Avoid using translated messages without format

2025-02-20 Thread Jiri Denemark
Signed-off-by: Jiri Denemark --- tools/virsh-domain-monitor.c | 8 ++-- tools/virsh-domain.c | 72 ++-- tools/virsh-host.c | 2 +- tools/virsh-secret.c | 4 +- tools/virsh-snapshot.c | 2 +- tools/virsh-util.c | 8 ++--

[PATCH 09/13] virsh: Properly mark all error messages for translation

2025-02-20 Thread Jiri Denemark
Signed-off-by: Jiri Denemark --- tools/virsh-domain-monitor.c | 6 ++--- tools/virsh-domain.c | 12 - tools/virsh-host.c | 2 +- tools/virsh-nodedev.c| 6 ++--- tools/virsh-secret.c | 2 +- tools/virsh.c| 4 +-- tools/virt-admin.c

[PATCH 08/13] virsh: Do not require \n in vshDebug messages

2025-02-20 Thread Jiri Denemark
Having to put a newline at the end of each debug message in virsh has always felt strange. Signed-off-by: Jiri Denemark --- tools/virsh-domain-monitor.c | 2 +- tools/virsh-domain.c | 32 tools/virsh-interface.c | 6 +++--- tools/virsh-network.c

[PATCH 07/13] virsh: Warn when hypervisor-cpu-* is used with host CPU

2025-02-20 Thread Jiri Denemark
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 --- tools/virsh-host.c | 18 +- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/too

[PATCH 05/13] virsh: Refactor vshError

2025-02-20 Thread Jiri Denemark
The code is moved into a newly introduced generic vshPrintStderr and vshError changed into a tiny wrapper. Signed-off-by: Jiri Denemark --- tools/vsh.c | 23 +-- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/tools/vsh.c b/tools/vsh.c index 64507fe560..91e2ae2

[PATCH 04/13] virsh: Make messages printed by vshError properly translatable

2025-02-20 Thread Jiri Denemark
Signed-off-by: Jiri Denemark --- tools/vsh.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/vsh.c b/tools/vsh.c index 1b650bdd9b..64507fe560 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -2128,9 +2128,7 @@ vshError(vshControl *ctl, const char *format, ...) * pr

[PATCH 03/13] virsh: Do not format messages twice

2025-02-20 Thread Jiri Denemark
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 --- tools/vsh.c | 27 +++ tools/vsh.h | 4 +--- 2 files cha

[PATCH 01/13] docs: Clarify documentation of virsh hypervisor-cpu-compare

2025-02-20 Thread Jiri Denemark
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 --

[PATCH 00/13] virsh: Enhancements for hypervisor-cpu-* commands and their documentation

2025-02-20 Thread Jiri Denemark
This series originally started as a documentation update for hypervisor-cpu-compare and hypervisor-cpu-baseline commands with an idea to print a warning if the commands are used suboptimally. The rest is a refactor and a lot of fixes of (mostly) error messages printed by virsh. Jiri Denemark (13):

[PATCH 6/6] qemu: Add test case for acpi-generic-initiator

2025-02-20 Thread Andrea Righi via Devel
Implement a sub-test in qemuxmlconftest that uses acpi-generic-initiator to link a PCI device with multiple NUMA node definitions (without any memory/cpu resource assigned). Then translate the VM definition to the corresponding qemu command line that associates the hostdev with the NUMA nodes. Si

[PATCH 6/6] qemu: Add test case for acpi-generic-initiator

2025-02-20 Thread Andrea Righi via Devel
Implement a sub-test in qemuxmlconftest that uses acpi-generic-initiator to link a PCI device with multiple NUMA node definitions (without any memory/cpu resource assigned). Then translate the VM definition to the corresponding qemu command line that associates the hostdev with the NUMA nodes. Si

[PATCH 5/6] qemu: support acpi-generic-initiator

2025-02-20 Thread Andrea Righi via Devel
Add support to the qemu driver to generate the proper command line for the acpi-generic-initiator definitions. Signed-off-by: Andrea Righi --- src/qemu/qemu_command.c | 25 + 1 file changed, 25 insertions(+) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c

[PATCH 4/6] qemu: capabilies: Introduce QEMU_CAPS_ACPI_GENERIC_INITIATOR

2025-02-20 Thread Andrea Righi via Devel
This capability tracks whether QEMU supports the acpi-generic-initiator object type. This object has been introduced in QEMU with the commit: b64b7ed8bb ("qom: new object to associate device to NUMA node"). Signed-off-by: Andrea Righi --- src/qemu/qemu_capabilities.c | 2 ++

[PATCH 3/6] qemu: Allow to define NUMA nodes without memory or CPUs assigned

2025-02-20 Thread Andrea Righi via Devel
Allow to define NUMA nodes without memory or CPUs assigned to properly support the new acpi-generic-initiator device. This is required because the NUMA nodes passed to the acpi-generic-initiator object must be independent and not be shared with other resources, such as CPU or memory. Signed-off-b

[PATCH 2/6] conf: Introduce acpi-generic-initiator device

2025-02-20 Thread Andrea Righi via Devel
Introduce apci-generic-initiator device to the domain XML. Example definition: dev0 1 This enables partitioning of PCI resources into multiple isolated instances, each requiring a dedicated NUMA node definition, that can be represented by the acpi-generic-initiator object. Si

[PATCH 1/6] schema: Introduce acpi-generic-initiator definition

2025-02-20 Thread Andrea Righi via Devel
Introduce the definition of a new acpi-generic-initiator object that can be used to link a PCI device with multiple NUMA nodes. Link: https://mail.gnu.org/archive/html/qemu-arm/2024-03/msg00358.html Signed-off-by: Andrea Righi --- src/conf/domain_conf.c| 25 +

Re: [PATCH 2/2] docs: formatdomain: Mention that vhostuser interface with mode='server' waits for connection

2025-02-20 Thread Peter Krempa
On Thu, Feb 20, 2025 at 11:13:19 +0100, Ján Tomko wrote: > On a Thursday in 2025, Peter Krempa wrote: > > 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

[PATCH v2] NEWS: Improve mention of vTPM transient VM crash fix in v11.0.0

2025-02-20 Thread Peter Krempa
The original NEWS entry for the vTPM transient VM crash was rather vague and non-actionable. As the bug is still actively experienced by users [1] of distros that didn't yet ship an update to v11.0.0 and is hit by relatively common usage improve the entry to mention situations when it happens and

Re: [PATCH RFC 00/13] qemu: Add support for iothread to virtqueue mapping for 'virtio-scsi'

2025-02-20 Thread Ján Tomko
On a Friday in 2025, Peter Krempa wrote: The first part of the series refactors the existing code for reuse and then uses the new helpers to implement the feature. Note that this series is in RFC state as the qemu patches are still being discussed. Thus also the capability bump is not final. Al

Re: [PATCH 08/13] conf: Validate that iohtreads are used only with 'virtio-scsi' controllers

2025-02-20 Thread Ján Tomko
In the commit summary: *iothreads On a Friday in 2025, Peter Krempa wrote: 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 valid

Re: [PATCH 07/13] conf: schemas: Rename 'diskDriverIothreads' to 'iothreadMapping'

2025-02-20 Thread Ján Tomko
On a Friday in 2025, Peter Krempa wrote: The schema definition will be reused when adding iotrhead<->virtuqueue iothread<->virtqueue mapping for 'virtio-scsi'. Signed-off-by: Peter Krempa --- src/conf/schemas/domaincommon.rng | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Revie

Re: [PATCH 0/5] qemu: Introduce nvme disk emulation support

2025-02-20 Thread honglei . wang
> On Tue, Feb 18, 2025 at 07:45:45PM +0800, honglei.wang(a)smartx.com wrote: > > What is the reason for wanting to have both these config > approaches ? With the first appearing to be a subset of > the second, the first seems to lack a compelling reason > to exist. > > Consider if someone deploye

Re: [PATCH 02/13] conf: domain: Extract code for parsing and formatting iotrhead mapping definition

2025-02-20 Thread Ján Tomko
s/trhead/thread/ in the commit summary On a Friday in 2025, Peter Krempa wrote: The code will be also needed for 'virtio-scsi' controller definitions. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 143 +++-- 1 file changed, 81 insertions(+), 62 del

Re: [PATCH] NEWS: Improve mention of vTPM transient VM crash fix in v11.0.0

2025-02-20 Thread Andrea Bolognani
On Thu, Feb 20, 2025 at 11:59:00AM +0100, Ján Tomko wrote: > On a Wednesday in 2025, Peter Krempa wrote: > > The original NEWS entry for the vTPM transient VM crash was rather > > vague and non-actionable. > > Apologies for not making it more descriptive. > > > I'm not convinced the NEWS should con

Re: [PATCH] NEWS: Improve mention of vTPM transient VM crash fix in v11.0.0

2025-02-20 Thread Ján Tomko
On a Wednesday in 2025, Peter Krempa wrote: The original NEWS entry for the vTPM transient VM crash was rather vague and non-actionable. Apologies for not making it more descriptive. I'm not convinced the NEWS should contain step-by-step workarounds for bugs that are already fixed - that alr

Re: [PATCH 2/2] docs: formatdomain: Mention that vhostuser interface with mode='server' waits for connection

2025-02-20 Thread Ján Tomko
On a Thursday in 2025, Peter Krempa wrote: 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-of

Re: [PATCH 1/2] docs: formatdomain: Document few NVRAM config limitations

2025-02-20 Thread Ján Tomko
On a Thursday in 2025, Peter Krempa wrote: 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 --- docs/formatdomain.rst | 10 -- 1 file changed, 8 insertions(+), 2

Re: [PATCH 00/21] qemu: Refactor domstats code to avoid error reporting

2025-02-20 Thread Ján Tomko
On a Thursday in 2025, Peter Krempa wrote: The workers of qemuDomainGetStats should not report errors if they can't fetch data; but rather omit the entries. Refactor the code to de-incentivize error reporting. Peter Krempa (21): qemuDomainGetStatsBlockExportHeader: Remove return value qemuDoma

Re: [PATCH 00/21] qemu: Refactor domstats code to avoid error reporting

2025-02-20 Thread Michal Prívozník
On 2/20/25 10:01, Peter Krempa wrote: > The workers of qemuDomainGetStats should not report errors if they can't > fetch data; but rather omit the entries. Refactor the code to > de-incentivize error reporting. > > Peter Krempa (21): > qemuDomainGetStatsBlockExportHeader: Remove return value >

[PATCH 2/2] docs: formatdomain: Mention that vhostuser interface with mode='server' waits for connection

2025-02-20 Thread Peter Krempa
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 --- docs/formatdomain.rs

[PATCH 1/2] docs: formatdomain: Document few NVRAM config limitations

2025-02-20 Thread Peter Krempa
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 --- docs/formatdomain.rst | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/formatdoma

[PATCH 0/2] docs: two fixes

2025-02-20 Thread Peter Krempa
Please see individual patches. Peter Krempa (2): docs: formatdomain: Document few NVRAM config limitations docs: formatdomain: Mention that vhostuser interface with mode='server' waits for connection docs/formatdomain.rst | 15 +-- 1 file changed, 13 insertions(+), 2 deletion

Re: [PATCH 11/21] virBitmapFormat: Don't check return value

2025-02-20 Thread Peter Krempa
On Thu, Feb 20, 2025 at 10:01:24 +0100, Peter Krempa wrote: > 'virBitmapFormat' always returns a string; remove pointless checks. > > Signed-off-by: Peter Krempa > --- > src/ch/ch_driver.c | 3 +-- > src/conf/capabilities.c| 9 + > src/conf/domain_conf.c | 2

[PATCH 19/21] qemuDomainGetStatsMemoryBandwidth: Don't error out

2025-02-20 Thread Peter Krempa
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 outputing them. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 23 +++ 1 file changed, 11 insertions(+), 12 deleti

[PATCH 02/21] qemuDomainGetStatsBlockExportFrontend: Remove return value

2025-02-20 Thread Peter Krempa
The function always returns 0. Remove return value and fix callers. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 7a39e83d39..3dee0a4a91 100644 --- a/src

[PATCH 21/21] qemuDomainGetStats: Convert worker functions to void

2025-02-20 Thread Peter Krempa
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:

[PATCH 20/21] qemuDomainGetStatsDirtyRate: Don't error out

2025-02-20 Thread Peter Krempa
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 outputing them. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 25 ++--- 1 file changed, 10 insertions(+), 15 deletions(

[PATCH 18/21] qemuDomainGetStatsIOThread: Don't error out if fetching iothread info fails

2025-02-20 Thread Peter Krempa
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 --- src/qemu/qemu_driver.c | 21 - 1 file changed, 8 insertions(+),

[PATCH 16/21] virPerfReadEvent: Refactor to return -errno on failure

2025-02-20 Thread Peter Krempa
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 --- src/qemu/qemu_driver.c | 6 +- src/util/virperf.c | 19 +

[PATCH 17/21] qemuDomainGetStatsPerfOneEvent: Ignore erros from 'virPerfReadEvent'

2025-02-20 Thread Peter Krempa
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 --- src/qemu/qemu_driver.c | 15 --- 1 file changed, 4 insertions(+), 11 deletions(-) diff --g

[PATCH 15/21] qemuDomainGetStatsCpuCache: Don't error out

2025-02-20 Thread Peter Krempa
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 outputing them. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 18 -- 1 file changed, 8 insertions(+), 10 deletions(-) diff --gi

[PATCH 14/21] qemuDomainGetStatsCpuHaltPollTime: Remove return value

2025-02-20 Thread Peter Krempa
The function can't fail. Remove return value and refactor callers. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index a93899ceb5..e2db449a7a 100644 --- a/src/

[PATCH 11/21] virBitmapFormat: Don't check return value

2025-02-20 Thread Peter Krempa
'virBitmapFormat' always returns a string; remove pointless checks. Signed-off-by: Peter Krempa --- src/ch/ch_driver.c | 3 +-- src/conf/capabilities.c| 9 + src/conf/domain_conf.c | 27 +++ src/conf/numa_conf.c | 18 ++-

[PATCH 13/21] qemuDomainGetStatsCpuProc: Remove return value

2025-02-20 Thread Peter Krempa
The function can't fail. Remove return value and refactor callers. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 1b5e7b1d70..a93899ceb5 100644 --- a/src/qem

[PATCH 12/21] qemuDomainGetStatsCpuCgroup: Remove return value

2025-02-20 Thread Peter Krempa
The function can't fail. Remove return value and refactor callers. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index d486169bc8..1b5e7b1d70 100644 --- a/src/qem

[PATCH 09/21] virDomainResctrlMonDefParse: Refactor temporary variables

2025-02-20 Thread Peter Krempa
Decrease scope of temporary variables so that they don't have to be autofreed and VIR_FREE()d at the same time. Remove unneeded checks and temporary variables. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --gi

[PATCH 10/21] virDomainCputuneDefFormat: Refactor bitmap formatting

2025-02-20 Thread Peter Krempa
Use g_autofree for the temporary variables, remove error checks for virBitmapFormat and simplify formatting of multiple attributes. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 28 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/src/conf/do

[PATCH 08/21] virBitmapFormat: Clarify returned values

2025-02-20 Thread Peter Krempa
NULL can't be returned; don't mention it in the docs. Avoid extra cofusing variable when returning copy of empty string. Signed-off-by: Peter Krempa --- src/util/virbitmap.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/util/virbitmap.c b/src/util/virbitmap

[PATCH 07/21] qemuDomainGetStatsBlockExportHeader: Remove return value

2025-02-20 Thread Peter Krempa
The function always returns 0. Remove return value and fix callers. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 877fefaa38..174dad64b0 100644 --- a/

[PATCH 06/21] qemuDomainStorageAlias: Remove NULL checks from callers

2025-02-20 Thread Peter Krempa
'qemuDomainStorageAlias' always returns non-NULL pointer if it gets a non-NULL string on input. Remove unneeded checks from callers. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 5 ++--- src/qemu/qemu_monitor_json.c | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) d

[PATCH 05/21] qemuDomainGetStatsOneBlock: Remove return value

2025-02-20 Thread Peter Krempa
The function always returns 0. Remove return value and fix callers. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 32 +++- 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 7318c145d0..aee6

[PATCH 04/21] qemuDomainGetStatsOneBlockFallback: Remove return value

2025-02-20 Thread Peter Krempa
The function always returns 0. Remove return value and fix callers. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 18 +++--- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 327edfe506..7318c145d0 100644 -

[PATCH 03/21] qemuDomainGetStatsBlockExportBackendStorage: Remove return value

2025-02-20 Thread Peter Krempa
The function always returns 0. Remove return value and fix callers. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 25 + 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 3dee0a4a91..327edfe506 1

[PATCH 01/21] qemuDomainGetStatsBlockExportHeader: Remove return value

2025-02-20 Thread Peter Krempa
The function always returns 0. Remove return value and fix callers. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 25 +++-- 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 1d0da1028f..7a39e83d39 1

[PATCH 00/21] qemu: Refactor domstats code to avoid error reporting

2025-02-20 Thread Peter Krempa
The workers of qemuDomainGetStats should not report errors if they can't fetch data; but rather omit the entries. Refactor the code to de-incentivize error reporting. Peter Krempa (21): qemuDomainGetStatsBlockExportHeader: Remove return value qemuDomainGetStatsBlockExportFrontend: Remove retur

Re: virsh console hangs when ssh connection is lost

2025-02-20 Thread Martin Kletzander
On Wed, Feb 12, 2025 at 11:08:09AM +0100, Olaf Hering via Devel wrote: Hello, the command 'virsh -c qemu+ssh://root@remotehost/system console vm' from libvirt 10.0.0 just hangs when the remotehost is rebooted. It prints error: Disconnected from qemu+ssh://root@remotehost/system due to end of fil

Re: [PATCH 2/4] src: validate permitted ACPI table types in libxl/qemu drivers

2025-02-20 Thread Michal Prívozník
On 2/19/25 17:01, Daniel P. Berrangé wrote: > On Wed, Feb 19, 2025 at 04:57:07PM +0100, Michal Prívozník wrote: >> On 2/18/25 19:12, Daniel P. Berrangé wrote: >>> Signed-off-by: Daniel P. Berrangé >>> --- >>> src/libxl/libxl_domain.c | 14 ++ >>> src/qemu/qemu_validate.c | 15