Re: [PATCH 00/12] Introduce SEV-SNP support

2025-01-22 Thread Daniel P . Berrangé
On Wed, Jan 22, 2025 at 10:18:41AM -, trued...@gmail.com wrote: > Hi Jonathon, > > Do you have any news/updates around SNP compatibility in Libvirt? It was done 6 months ago https://libvirt.org/news.html#v10-5-0-2024-07-01 "* New features: Introduce SEV-SNP support" With regards, D

Re: [PATCH 2/3] conf,qemu: implement RISC-V 'aia' virt domain feature

2025-01-22 Thread Martin Kletzander
On Wed, Jan 22, 2025 at 09:40:06AM -0300, Daniel Henrique Barboza wrote: On 1/22/25 8:43 AM, Martin Kletzander wrote: On Thu, Oct 24, 2024 at 11:08:19AM -0300, Daniel Henrique Barboza wrote: This feature is implemented as a string that can range from "none", "aplic" and "aplic-imsic". If the

Re: [PATCH v5 00/18] *** qemu: block: Support block disk along with throttle filters ***

2025-01-22 Thread Peter Krempa
On Wed, Jan 22, 2025 at 07:37:22 -, Harikumar Rajkumar wrote: > Hi Peter Krempa, Could you please prioritize reviews for remaining commits so > we can create new patch request with all fix. We have a requirement which > depends on this change and we are currently blocked. > Please refer to

Re: [PATCH v5 09/18] qemu: Implement qemu driver for throttle API

2025-01-22 Thread Peter Krempa
On Mon, Nov 18, 2024 at 19:24:17 +0530, Harikumar R wrote: > From: Chun Feng Wu > > ThrottleGroup lifecycle implementation, note, in QOM, throttlegroup name is > prefixed with > "throttle-" to clearly separate throttle group objects into their own > namespace. > * "qemuDomainSetThrottleGroup",

Re: [PATCH] qemuSnapshotDeleteValidate: Fix crash when disk is not found in VM definition

2025-01-22 Thread Martin Kletzander
On Fri, Nov 29, 2024 at 10:56:45PM +0800, kaihuan wrote: qemuDomainDiskByName() can return a NULL pointer on failure. But this returned value in qemuSnapshotDeleteValidate is not checked.It will make libvirtd crash. Hi, looking through old unreviewed patches I found this one. Sorry for the w

Re: [PATCH 2/3] conf,qemu: implement RISC-V 'aia' virt domain feature

2025-01-22 Thread Martin Kletzander
On Thu, Oct 24, 2024 at 11:08:19AM -0300, Daniel Henrique Barboza wrote: This feature is implemented as a string that can range from "none", "aplic" and "aplic-imsic". If the feature isn't present in the domain XML the hypervisor default will be used. For QEMU, at least up to 9.2, the default is

[PATCH 1/1] virsysinfo: fix RISC-V detection

2025-01-22 Thread Heinrich Schuchardt
The correct compiler define to detect the RISC-V architecture is __riscv. Fixes: b902cfece0db ("virsysinfo: Try reading DMI table") Signed-off-by: Heinrich Schuchardt --- src/util/virsysinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/virsysinfo.c b/src/util/vi

Re: [PATCH 2/3] conf,qemu: implement RISC-V 'aia' virt domain feature

2025-01-22 Thread Daniel Henrique Barboza
On 1/22/25 8:43 AM, Martin Kletzander wrote: On Thu, Oct 24, 2024 at 11:08:19AM -0300, Daniel Henrique Barboza wrote: This feature is implemented as a string that can range from "none", "aplic" and "aplic-imsic". If the feature isn't present in the domain XML the hypervisor default will be u

[PATCH v2 0/3] conf,qemu: add AIA support for RISC-V 'virt'

2025-01-22 Thread Daniel Henrique Barboza
Hi, This new version has improvements suggested by Martin in v1. Most notably we're now doing a proper handling of 'aia=none' by adding a 'default' value that is internal only. Changes from v1: - patch 2: - changed libvirt version to 11.1.0 in 'aia' docs in formatdomain.rst - added a new in

[PATCH v2 1/3] qemu: add capability for RISC-V AIA feature

2025-01-22 Thread Daniel Henrique Barboza
AIA (Advanced Interrupt Architecture) support was introduced in QEMU 7.0 for the 'virt' machine type. It allows the guest to choose from a more modern interrupt model than the default (CLINT - Core Logical Interrupt Controller). Signed-off-by: Daniel Henrique Barboza --- src/qemu/qemu_capabiliti

[PATCH v2 1/1] cpu_riscv64.c: add update() implementation

2025-01-22 Thread Daniel Henrique Barboza
At this moment it is not possible to launch a 'riscv64' domain if a CPU definition is presented in the domain. For example, adding this CPU definition: rv64 Will trigger the following error: $ sudo ./run tools/virsh start riscv-virt1 error: Failed to start domain 'riscv-virt1' error: t

[PATCH v2 3/3] qemu: add RISC-V 'aia' command line

2025-01-22 Thread Daniel Henrique Barboza
The 'aia' feature is added as a machine type option for the 'virt' RISC-V machine, e.g. "-machine virt,aia=". Signed-off-by: Daniel Henrique Barboza --- src/qemu/qemu_command.c | 5 +++ ...cv64-virt-features-aia.riscv64-latest.args | 31 +++ ...scv64-virt-f

[PATCH v2 2/3] conf,qemu: implement RISC-V 'aia' virt domain feature

2025-01-22 Thread Daniel Henrique Barboza
This feature is implemented as a string that can range from "none", "aplic" and "aplic-imsic". If the feature isn't present in the domain XML the hypervisor default will be used. For QEMU, at least up to 9.2, the default is "none". Signed-off-by: Daniel Henrique Barboza --- docs/formatdomain.rs

Re: [PATCH 00/12] Introduce SEV-SNP support

2025-01-22 Thread truedoom
Hi Jonathon, Do you have any news/updates around SNP compatibility in Libvirt? I'm working on a project around SNP enabled cloud systems, and would be great to have SNP via Libvirt. Wondering do you know of any roadmap, or any info on when that might be supported? Coming up blank on my own res

[PATCH] qemu: snapshot: Remove dead code in qemuSnapshotDeleteBlockJobFinishing()

2025-01-22 Thread Alexander Kuznetsov
qemuSnapshotDeleteBlockJobFinishing() returns only 0 and 1. Convert it to bool and remove the dead code handling -1 return in the caller. Found by Linux Verification Center (linuxtesting.org) with Svace. Reported-by: Reported-by: Andrey Slepykh Signed-off-by: Alexander Kuznetsov --- src/qemu/q

[PATCH] util: netdevvlan: Change return type of virNetDevVlanCopy to void

2025-01-22 Thread Alexander Kuznetsov
This function return value is invariant since 1022e0ee, so change its type and remove all dependent checks. Found by Linux Verification Center (linuxtesting.org) with Svace. Reported-by: Alexander Rudyuk Signed-off-by: Alexander Kuznetsov --- src/conf/domain_conf.c | 9 +++-- src/netw

Re: [PATCH 2/3] conf,qemu: implement RISC-V 'aia' virt domain feature

2025-01-22 Thread Daniel Henrique Barboza
On 1/22/25 10:11 AM, Martin Kletzander wrote: On Wed, Jan 22, 2025 at 09:40:06AM -0300, Daniel Henrique Barboza wrote: On 1/22/25 8:43 AM, Martin Kletzander wrote: On Thu, Oct 24, 2024 at 11:08:19AM -0300, Daniel Henrique Barboza wrote: This feature is implemented as a string that can ran

Re: [PATCH v5 08/18] qemu: Refactor qemuDomainSetBlockIoTune to extract common methods

2025-01-22 Thread Peter Krempa
On Mon, Nov 18, 2024 at 19:24:16 +0530, Harikumar R wrote: > From: Chun Feng Wu > > extract common methods from "qemuDomainSetBlockIoTune" to be reused > by throttle handling later, common methods include: > * "qemuDomainValidateBlockIoTune", which is to validate that PARAMS > contains only rec

[PATCH V2 14/20] qemu: Add support for mapped-ram on restore

2025-01-22 Thread Jim Fehlig via Devel
Add support for the mapped-ram migration capability on restore. Signed-off-by: Jim Fehlig --- src/qemu/qemu_driver.c| 26 +- src/qemu/qemu_migration.c | 12 src/qemu/qemu_process.c | 58 +++ src/qemu/qemu_process.h | 15 ++-

[PATCH V2 16/20] qemu: Support O_DIRECT with mapped-ram on restore

2025-01-22 Thread Jim Fehlig via Devel
When using the mapped-ram migration capability, direct IO is enabled by setting the "direct-io" migration parameter to "true" and passing QEMU an additional fd with O_DIRECT set. Signed-off-by: Jim Fehlig --- src/qemu/qemu_migration.c | 11 ++- src/qemu/qemu_process.c | 27

[PATCH V2 17/20] include: Define constants for parallel save/restore

2025-01-22 Thread Jim Fehlig via Devel
From: Claudio Fontana Add a new VIR_DOMAIN_SAVE_PARALLEL flag to the save and restore APIs, which can be used to specify the use of multiple, parallel channels for saving a domain. The number of parallel channels can be set using the VIR_DOMAIN_SAVE_PARAM_PARALLEL_CHANNELS typed parameter. Signe

[PATCH V2 00/20] qemu: support mapped-ram+directio+mulitfd

2025-01-22 Thread Jim Fehlig via Devel
I'm claiming this to be V2 of a series to support QEMU's mapped-ram stream format [1] and migration capability, even though the approach to control the feature is different than V1. To control mapped-ram in V1, I bumped the save format version and added a 'features' field to the save image header.

[PATCH V2 02/20] qemu_fd: Add function to retrieve fdset ID

2025-01-22 Thread Jim Fehlig via Devel
Add new function qemuFDPassGetId() for retrieving the fdset ID of provided qemuFDPass object. Signed-off-by: Jim Fehlig Reviewed-by: Daniel P. Berrangé --- src/qemu/qemu_fd.c | 18 ++ src/qemu/qemu_fd.h | 3 +++ 2 files changed, 21 insertions(+) diff --git a/src/qemu/qemu_fd.c

[PATCH V2 04/20] qemu: Add function to get bool value from migration params

2025-01-22 Thread Jim Fehlig via Devel
Signed-off-by: Jim Fehlig Reviewed-by: Daniel P. Berrangé --- src/qemu/qemu_migration_params.c | 18 ++ src/qemu/qemu_migration_params.h | 5 + 2 files changed, 23 insertions(+) diff --git a/src/qemu/qemu_migration_params.c b/src/qemu/qemu_migration_params.c index c3c9120c2

[PATCH V2 01/20] lib: virDomain{Save,Restore}Params: Ensure absolute path

2025-01-22 Thread Jim Fehlig via Devel
When invoking virDomainSaveParams with a relative path, the image is saved to the daemon's CWD. Similarly, when providing virDomainRestoreParams with a relative path, it attempts to restore from the daemon's CWD. In most configurations, the daemon's CWD is set to '/'. Ensure a relative path is conv

[PATCH V2 03/20] qemu: Add function to check capability in migration params

2025-01-22 Thread Jim Fehlig via Devel
Add new function qemuMigrationParamsCapEnabled() to check if a capability is set in the caller-provided migration parameters. Signed-off-by: Jim Fehlig Reviewed-by: Daniel P. Berrangé --- src/qemu/qemu_migration_params.c | 16 src/qemu/qemu_migration_params.h | 4 2 files

[PATCH V2 08/20] qemu: Add helper function for creating save image fd

2025-01-22 Thread Jim Fehlig via Devel
Move the code in qemuSaveImageCreate that opens, labels, and wraps the save image fd to a helper function, providing more flexibility for upcoming mapped-ram support. Signed-off-by: Jim Fehlig --- src/qemu/qemu_saveimage.c | 65 +++ 1 file changed, 45 insertio

[PATCH V2 05/20] qemu: Add mapped-ram migration capability

2025-01-22 Thread Jim Fehlig via Devel
Add the mapped-ram migration capability introduced in QEMU 9.0. Reviewed-by: Daniel P. Berrangé Signed-off-by: Jim Fehlig --- src/qemu/qemu_migration_params.c | 1 + src/qemu/qemu_migration_params.h | 1 + 2 files changed, 2 insertions(+) diff --git a/src/qemu/qemu_migration_params.c b/src/qemu

[PATCH V2 06/20] qemu: Add function to get migration params for save

2025-01-22 Thread Jim Fehlig via Devel
Introduce qemuMigrationParamsForSave() to create a qemuMigrationParams object initialized with appropriate migration capabilities and parameters for a save operation. Note that mapped-ram capability also requires the multifd capability. For now, the number of multifd channels is set to 1. Future w

[PATCH V2 07/20] qemu_saveimage: add "sparse" to supported save image formats

2025-01-22 Thread Jim Fehlig via Devel
Extend the list of formats to include "sparse", which uses QEMU's mapped-ram stream format [1] to write guest memory blocks at fixed offsets in the save image file. [1] https://gitlab.com/qemu-project/qemu/-/blob/master/docs/devel/migration/mapped-ram.rst?ref_type=heads Signed-off-by: Jim Fehlig

[PATCH V2 11/20] qemu: Decompose qemuSaveImageOpen

2025-01-22 Thread Jim Fehlig via Devel
Split the reading of libvirt's save image metadata from the opening of the fd that will be passed to QEMU. This provides flexibility for an upcoming patch adding mapped-ram support for restore. Signed-off-by: Jim Fehlig --- src/qemu/qemu_driver.c| 37 src/qemu/qemu_saveimage

[PATCH V2 09/20] qemu: Move declaration of virQEMUSaveFormat to header file

2025-01-22 Thread Jim Fehlig via Devel
Allow use of the enum outside of qemu_saveimage. Signed-off-by: Jim Fehlig --- src/qemu/qemu_saveimage.c | 20 src/qemu/qemu_saveimage.h | 20 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/qemu/qemu_saveimage.c b/src/qemu/qemu_save

[PATCH V2 12/20] qemu: Move creation of qemuProcessIncomingDef struct

2025-01-22 Thread Jim Fehlig via Devel
qemuProcessStartWithMemoryState() is the only caller of qemuProcessStart() that uses the qemuProcessIncomingDef struct. Move creation of the struct to qemuProcessStartWithMemoryState(). Signed-off-by: Jim Fehlig --- src/qemu/qemu_process.c | 44 - src/qemu

[PATCH V2 10/20] qemu: Add support for mapped-ram on save

2025-01-22 Thread Jim Fehlig via Devel
Introduce support for QEMU's new mapped-ram stream format [1]. mapped-ram is enabled by default if the underlying QEMU advertises the mapped-ram migration capability. It can be disabled by changing the 'save_image_version' setting in qemu.conf to version '2'. To use mapped-ram with QEMU: - The 'ma

[PATCH V2 13/20] qemu: Apply migration parameters in qemuMigrationDstRun

2025-01-22 Thread Jim Fehlig via Devel
Similar to qemuMigrationSrcRun, apply migration parameters in qemuMigrationDstRun. This allows callers to create customized migration parameters, but delegates their application to the function performing the migration. Signed-off-by: Jim Fehlig --- src/qemu/qemu_migration.c | 16 ++-

[PATCH V2 18/20] qemu: Add support for parallel save and restore

2025-01-22 Thread Jim Fehlig via Devel
Add support for parallel save and restore by mapping libvirt's "parallel-connections" parameter to QEMU's "multifd-channels" migration parameter. Signed-off-by: Jim Fehlig --- src/qemu/qemu_driver.c | 32 +--- src/qemu/qemu_migration_params.c | 31 ++

[PATCH V2 19/20] tools: add parallel parameter to virsh save command

2025-01-22 Thread Jim Fehlig via Devel
From: Claudio Fontana Signed-off-by: Claudio Fontana Signed-off-by: Jim Fehlig --- docs/manpages/virsh.rst | 12 +++- tools/virsh-domain.c| 41 + 2 files changed, 48 insertions(+), 5 deletions(-) diff --git a/docs/manpages/virsh.rst b/docs/m

[PATCH V2 20/20] tools: add parallel parameter to virsh restore command

2025-01-22 Thread Jim Fehlig via Devel
From: Claudio Fontana Signed-off-by: Claudio Fontana Signed-off-by: Jim Fehlig --- docs/manpages/virsh.rst | 9 +++-- tools/virsh-domain.c| 38 ++ 2 files changed, 41 insertions(+), 6 deletions(-) diff --git a/docs/manpages/virsh.rst b/docs/manpage

[PATCH V2 15/20] qemu: Support O_DIRECT with mapped-ram on save

2025-01-22 Thread Jim Fehlig via Devel
When using the mapped-ram migration capability, direct IO is enabled by setting the "direct-io" migration parameter to "true" and passing QEMU an additional fd with O_DIRECT set. Signed-off-by: Jim Fehlig --- src/qemu/qemu_driver.c | 10 ++ src/qemu/qemu_migration.c| 32