Re: [PATCH 0/9] qemu: support passt as the backend for vhost-user network interfaces

2025-02-14 Thread Ján Tomko
On a Thursday in 2025, Laine Stump wrote: [...] This Resolves: https://issues.redhat.com/browse/RHEL-69455 Laine Stump (9): conf: change virDomainHostdevInsert() to return void qemu: fix qemu validation to forbid guest-side IP address for type='vdpa' qemu: validate that model is virtio f

Re: [PATCH 9/9] qemu: complete vhostuser + passt support

2025-02-14 Thread Laine Stump
On 2/14/25 6:03 AM, Andrea Bolognani wrote: On Thu, Feb 13, 2025 at 01:19:53PM -0500, Laine Stump wrote: The result is that you can now have: ... Then as long as you also have the following as a subelement of : your passt interfaces will benefit

Re: [PATCH] NEWS: Document ccwgroup based qeth device support

2025-02-14 Thread Michal Prívozník
On 2/13/25 15:09, Boris Fiuczynski wrote: > Signed-off-by: Boris Fiuczynski > --- > NEWS.rst | 11 +++ > 1 file changed, 11 insertions(+) Reviewed-by: Michal Privoznik Michal

Re: [PATCH 9/9] qemu: complete vhostuser + passt support

2025-02-14 Thread Andrea Bolognani
On Fri, Feb 14, 2025 at 08:49:29AM -0500, Laine Stump wrote: > On 2/14/25 6:03 AM, Andrea Bolognani wrote: > > On Thu, Feb 13, 2025 at 01:19:53PM -0500, Laine Stump wrote: > > > The result is that you can now have: > > > > > > > > > > > >... > > > > > > > > > Then as lon

Re: [PATCH 9/9] qemu: complete vhostuser + passt support

2025-02-14 Thread Laine Stump
On 2/14/25 9:21 AM, Andrea Bolognani wrote: On Fri, Feb 14, 2025 at 08:49:29AM -0500, Laine Stump wrote: On 2/14/25 6:03 AM, Andrea Bolognani wrote: On Thu, Feb 13, 2025 at 01:19:53PM -0500, Laine Stump wrote: The result is that you can now have: ... Then as lo

Re: [PATCH 0/9] qemu: support passt as the backend for vhost-user network interfaces

2025-02-14 Thread Laine Stump
On 2/14/25 6:17 AM, Andrea Bolognani wrote: On Thu, Feb 13, 2025 at 01:19:44PM -0500, Laine Stump wrote: passt (https://passt.top) provides a method of connecting QEMU virtual machines to the external network without requiring special privileges or capabilities of any participating processes - e

Re: [PATCH 9/9] qemu: complete vhostuser + passt support

2025-02-14 Thread Laine Stump
On 2/14/25 8:49 AM, Laine Stump wrote: On 2/14/25 6:03 AM, Andrea Bolognani wrote: On Thu, Feb 13, 2025 at 01:19:53PM -0500, Laine Stump wrote: The result is that you can now have:       ... Then as long as you also have the following as a subelement of :     

Re: [PATCH 0/9] qemu: support passt as the backend for vhost-user network interfaces

2025-02-14 Thread Andrea Bolognani
On Fri, Feb 14, 2025 at 09:08:36AM -0500, Laine Stump wrote: > On 2/14/25 6:17 AM, Andrea Bolognani wrote: > > Speaking of SELinux, with the current policy on Fedora 41 I get a > > couple of AVC denials related to accessing the shared memory file. > > I understand that's expected, based on the abov

[PATCH 03/13] hypervisor: domain: Extract code for checking iothread usage

2025-02-14 Thread Peter Krempa
The code will be also needed for 'virtio-scsi' controller definitions. Signed-off-by: Peter Krempa --- src/hypervisor/domain_driver.c | 31 ++- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/src/hypervisor/domain_driver.c b/src/hypervisor/domain_drive

[PATCH 01/13] conf: Rename 'virDomainDiskIothreadDef' to 'virDomainIothreadMappingDef'

2025-02-14 Thread Peter Krempa
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 --- src/conf/domain_conf.c | 10 +- src/conf/domain_conf.h | 10 +- src/hypervisor/domain_driver.c | 2 +-

[PATCH 06/13] qemuValidateCheckSCSIControllerIOThreads: Return '0' and '-1' instead of bools

2025-02-14 Thread Peter Krempa
The function reports libvirt errors so stick with the usual '0' and '-1' return values. Signed-off-by: Peter Krempa --- src/qemu/qemu_validate.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 8ac3e65e9d..

[PATCH 05/13] qemu: validate: Extract iothread mapping validation code

2025-02-14 Thread Peter Krempa
Extract the code to 'qemuDomainValidateIothreadMapping'. It will be reused to validate the mapping for 'virtio-scsi' iothreads. Signed-off-by: Peter Krempa --- src/qemu/qemu_validate.c | 192 +-- 1 file changed, 104 insertions(+), 88 deletions(-) diff --git a

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

2025-02-14 Thread Peter Krempa
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. Also note that we should discuss the libvirt

[PATCH 04/13] qemu: command: Rename 'qemuBuildDiskDeviceIothreadMappingProps' to 'qemuBuildIothreadMappingProps'

2025-02-14 Thread Peter Krempa
Prepare for reuse of the code for 'virtio-scsi' controller. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 35a71b73a7..b76fec27c5 100644 --- a/src/qemu/qemu_co

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

2025-02-14 Thread Peter Krempa
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 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 22b

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

2025-02-14 Thread Peter Krempa
The schema definition will be reused when adding iotrhead<->virtuqueue mapping for 'virtio-scsi'. Signed-off-by: Peter Krempa --- src/conf/schemas/domaincommon.rng | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domain

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

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

[PATCH 09/13] qemucapabilitiestest: Update 'caps_10.0.0_x86_64' to XXXXXX

2025-02-14 Thread Peter Krempa
Notable changes: - 'virtio-scsi' supports 'iothread-vq-mapping' - 'nbd-server-start' command supports 'handshake-max-seconds' argument --- .../qemucapabilitiesdata/caps_10.0.0_x86_64.replies | 12 +++- tests/qemucapabilitiesdata/caps_10.0.0_x86_64.xml| 2 +- 2 files changed, 12 ins

[PATCH 12/13] qemu: Implement support for iothread <-> virtqueue mapping for 'virtio-scsi' controllers

2025-02-14 Thread Peter Krempa
Similarly to 'virtio-blk' users can map multiple iothreads and pin them appropriately for 'virtio-scsi' controllers to ensure the best performance. Implement the validation and command line generation based on the helpers we have for 'virtio-blk'. Signed-off-by: Peter Krempa --- src/qemu/qemu_c

[PATCH 11/13] conf: Add support for iothread to queue mapping config for 'virtio-scsi'

2025-02-14 Thread Peter Krempa
Upcoming qemu release will support configuring mapping iothreads to virtio queues for 'virtio-scsi' controllers in order to improve performance. Reuse the infrastructure we have from the same configuration for 'virti-blk' to implement the conf support for this feature. Signed-off-by: Peter Krempa

[PATCH 13/13] qemuxmlconftest: Add 'iothreads-virtio-scsi-mapping' case

2025-02-14 Thread Peter Krempa
Test the XML and commandline for iothread<->virtqueue mapping for 'virtio-scsi' controllers. Signed-off-by: Peter Krempa --- ...ads-virtio-scsi-mapping.x86_64-latest.args | 39 ++ ...eads-virtio-scsi-mapping.x86_64-latest.xml | 54 +++ .../iothreads-virtio-scsi-mappin

[PATCH 10/13] qemu: capabilities: Introduce QEMU_CAPS_VIRTIO_SCSI_IOTHREAD_MAPPING

2025-02-14 Thread Peter Krempa
The 'virtio-scsi' controller now supports iothread<->virtqueue mapping configuration. Signed-off-by: Peter Krempa --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + tests/qemucapabilitiesdata/caps_10.0.0_x86_64.xml | 1 + 3 file

[PATCH 0/3] qemu: Small cleanups to SaveImageGetCompressionProgram and callers

2025-02-14 Thread Jim Fehlig via Devel
Even though my work on supporting mapped-ram is the main motivation for this small cleanup series, IMO is useful in its own right. Jim Fehlig (3): qemu: Move declaration of virQEMUSaveFormat to header file qemu: Move special handling of invalid dump format to only caller qemu: Change return

[PATCH 2/3] qemu: Move special handling of invalid dump format to only caller

2025-02-14 Thread Jim Fehlig via Devel
The 'use_raw_on_fail' logic in qemuSaveImageGetCompressionProgram is only used by doCoreDump in qemu_driver.c. Move the logic to the single call site and remove the parameter from qemuSaveImageGetCompressionProgram. Signed-off-by: Jim Fehlig --- src/qemu/qemu_driver.c| 29 +++

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

2025-02-14 Thread Jim Fehlig via Devel
Allow use of the enum outside of qemu_saveimage. Signed-off-by: Jim Fehlig --- 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_saveimage.c b/src/qemu/qemu_saveim

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

2025-02-14 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 0/2] qemu: Support specifying save image format

2025-02-14 Thread Jim Fehlig via Devel
This series is based on a cleanup of qemuSaveImageGetCompressionProgram [1] and demonstrates the usefulness of that cleanup. Patch1 adds the VIR_DOMAIN_SAVE_PARAM_IMAGE_FORMAT typed parameter to virDomainSaveParams, allowing to specify the image format on a per-operation basis. The format can still

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

2025-02-14 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 | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_dr

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

2025-02-14 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 --- include/libvirt/libvirt-

[PATCH 11/12] docs: improve type='user' docs to higlight differences between SLIRP and passt

2025-02-14 Thread Laine Stump
This reorganizes the section about and describes the differences in behavior between SLIRP and passt. Resolves: https://issues.redhat.com/browse/RHEL-46601 Signed-off-by: Laine Stump --- docs/formatdomain.rst | 116 -- 1 file changed, 78 insertions(+), 38

[PATCH 10/12] qemu: fail validation if a domain def has vhostuser/passt but no shared mem

2025-02-14 Thread Laine Stump
This can/should also be done for a traditional vhost-user interface (ie not backend type='passt') but that will be a separate change. Signed-off-by: Laine Stump --- src/qemu/qemu_validate.c | 9 ++- ...vhostuser-passt-no-shmem.x86_64-latest.err | 1 + .../net-vhostuser-pas

[PATCH 08/12] qemu: make qemuPasstCreateSocketPath() public

2025-02-14 Thread Laine Stump
When passt is used with vhostuser, the vhostuser code that builds the qemu commandline will need to have the same socket path that is given to the passt command, so this patch makes it visible outside of qemu_passt.c. Signed-off-by: Laine Stump --- src/qemu/qemu_passt.c | 2 +- src/qemu/qemu_pas

[PATCH 09/12] qemu: complete vhostuser + passt support

2025-02-14 Thread Laine Stump
needs to run the passt command just as is done for interface type='user', but then add vhostuser bits to the qemu commandline/monitor command. There are some changes to the parsing/validation along with changes to the vhostuser codepath do do the extra stuff for passt. I tried keeping them separa

[PATCH 12/12] docs: document using passt backend with

2025-02-14 Thread Laine Stump
Almost everything is already there (in the section for using passt with type='user'), so we just need to point to that from the type='vhostuser' section (and vice versa), and add a bit of glue. Also updated a few related details that have changed (e.g. default model type for vhostuser is now 'virt

Re: [PATCH 0/3] qemu: Small cleanups to SaveImageGetCompressionProgram and callers

2025-02-14 Thread Jim Fehlig via Devel
On 2/14/25 15:48, Jim Fehlig wrote: Even though my work on supporting mapped-ram is the main motivation for this small cleanup series, IMO is useful in its own right. Here's an example of that usefulness https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread/ISSWUH6FM4IMWG5HLUM

[PATCH 00/12] [PATCH v2 00/12] qemu: support passt as a backend for vhost-user network interfaces

2025-02-14 Thread Laine Stump
Changes from V1: * fixed missing change to error log message pointed out by abologna * added a validation check to assure that shared memory is enabled if there is a type='vhostuser' interface in the domain definition * included a patch documenting differences between type='user'

[PATCH 03/12] qemu: validate that model is virtio for vhostuser and vdpa interfaces in the same place

2025-02-14 Thread Laine Stump
Both vhostuser and vdpa interface types must use the virtio model in the guest (because part of the functionality is implemented in the guest virtio driver). Due to ["because that's the way it happened"] this has been validated for vhostuser in the hypervisor-agnostic validate function, but for vdp

[PATCH 01/12] conf: change virDomainHostdevInsert() to return void

2025-02-14 Thread Laine Stump
We haven't checked for memalloc failure in many years, and that was the only reason this function would have ever failed. Signed-off-by: Laine Stump --- src/conf/domain_conf.c | 15 +-- src/conf/domain_conf.h | 2 +- src/libxl/libxl_domain.c | 5 + src/libxl/libxl_driver.c

[PATCH 05/12] qemu: do all vhostuser attribute validation in qemu driver

2025-02-14 Thread Laine Stump
Since vhostuser is only used/supported by the QEMU driver, and all the rest of the vhostuser-specific validation is done in QEMU's validation, lets move the final check (to see if they've tried to enable auto-reconnect when this interface is on the server side of the vhostuser socket) to the QEMU v

[PATCH 04/12] qemu: automatically set model type='virtio' for interface type='vhostuser'

2025-02-14 Thread Laine Stump
Both vdpa and vhostuser require that the guest device be virtio, and for interface type='vdpa', we already set if it is unspecified in the input XML, so let's be just as courteous for interface type='vhostuser'. Signed-off-by: Laine Stump --- src/qemu/qemu_postparse.c | 3 ++- 1 file changed, 2

[PATCH 02/12] qemu: fix qemu validation to forbid guest-side IP address for type='vdpa'

2025-02-14 Thread Laine Stump
Because all the checks for VIR_DOMAIN_NET_TYPE_VDPA were inside an else-if clause that was immediately followed by another else-if clause that forbid setting guestIP.ips or guestIP.routes, we've been allowing users to set guestIP.* for vdpa interfaces (but then not doing validation of the attribute

[PATCH 06/12] conf/qemu: make element *almost* optional for type=vhostuser

2025-02-14 Thread Laine Stump
For some reason, when vhostuser interface support was added in 2014, the parser required that the XML for the have a element with type, mode, and path, all 3 also required. This in spite of the fact that 'unix' is the only possible valid setting for type, and 95% of the time the mode is set to 'c

[PATCH 07/12] qemu: use switch instead of if in qemuProcessPrepareDomainNetwork()

2025-02-14 Thread Laine Stump
qemuProcessPrepareDomain()'s comments say that it should be the only place to change the "live XML" of a domain (i.e. the public parts of the virDomainDef object that is shown in the domain's status XML), and that seems like a reasonable idea (although there aren't many users of it to date). qemuP

Re: [PATCH 12/19] qemu: limit to one

2025-02-14 Thread Marc-André Lureau
Hi On Wed, Jan 29, 2025 at 5:58 PM Daniel P. Berrangé wrote: > > On Wed, Jan 29, 2025 at 05:40:34PM +0400, marcandre.lur...@redhat.com wrote: > > From: Marc-André Lureau > > > > Signed-off-by: Marc-André Lureau > > --- > > src/qemu/qemu_command.c | 8 ++-- > > 1 file changed, 6 insertions(

Re: [PATCH 9/9] qemu: complete vhostuser + passt support

2025-02-14 Thread Andrea Bolognani
On Fri, Feb 14, 2025 at 11:07:17AM +, Daniel P. Berrangé wrote: > On Fri, Feb 14, 2025 at 03:03:20AM -0800, Andrea Bolognani wrote: > > How does passt know where the backing file is located in the first > > place? It's not passed on its command line, and I didn't spot any > > logic to hand the

Re: [PATCH 13/19] qemu/dbus: keep a connection to the VM D-Bus

2025-02-14 Thread Marc-André Lureau
Hi On Wed, Feb 12, 2025 at 8:16 PM Daniel P. Berrangé wrote: > > On Wed, Jan 29, 2025 at 05:40:35PM +0400, marcandre.lur...@redhat.com wrote: > > From: Marc-André Lureau > > > > The following changes are going to communicate with the qemu-rdp server > > through the VM D-Bus bus, keep a connectio

Re: [PATCH 9/9] qemu: complete vhostuser + passt support

2025-02-14 Thread Andrea Bolognani
On Thu, Feb 13, 2025 at 01:19:53PM -0500, Laine Stump wrote: > The result is that you can now have: > > > > ... > > > Then as long as you also have the following as a subelement of > : > > > > > > your passt interfaces will benefit from the greatly improved >

Re: [PATCH 9/9] qemu: complete vhostuser + passt support

2025-02-14 Thread Daniel P . Berrangé
On Fri, Feb 14, 2025 at 03:03:20AM -0800, Andrea Bolognani wrote: > On Thu, Feb 13, 2025 at 01:19:53PM -0500, Laine Stump wrote: > > The result is that you can now have: > > > > > > > > ... > > > > > > Then as long as you also have the following as a subelement of > > : > > >

Re: [PATCH 05/19] qemu: report an error for unsupported graphics

2025-02-14 Thread Marc-André Lureau
Hi On Wed, Feb 12, 2025 at 7:44 PM Daniel P. Berrangé wrote: > > On Wed, Jan 29, 2025 at 05:40:27PM +0400, marcandre.lur...@redhat.com wrote: > > From: Marc-André Lureau > > > > Without an error message, it can be tedious to figure out failure to start. > > > > Signed-off-by: Marc-André Lureau

Re: [PATCH 0/9] qemu: support passt as the backend for vhost-user network interfaces

2025-02-14 Thread Andrea Bolognani
On Thu, Feb 13, 2025 at 01:19:44PM -0500, Laine Stump wrote: > passt (https://passt.top) provides a method of connecting QEMU virtual > machines to the external network without requiring special privileges > or capabilities of any participating processes - even libvirt itself > can run unprivileged

Re: [PATCH 16/19] qemu: if -display dbus capability is supported, accept rdp

2025-02-14 Thread Marc-André Lureau
Hi On Wed, Feb 12, 2025 at 8:21 PM Daniel P. Berrangé wrote: > > On Wed, Jan 29, 2025 at 05:40:38PM +0400, marcandre.lur...@redhat.com wrote: > > From: Marc-André Lureau > > > > We may want to check qemu-rdp presence, instead of failing later? > > Yes, we should validate qemu-rdp, because the ca

Re: [PATCH 16/19] qemu: if -display dbus capability is supported, accept rdp

2025-02-14 Thread Marc-André Lureau
Hi On Fri, Feb 14, 2025 at 4:03 PM Marc-André Lureau wrote: > > Hi > > On Wed, Feb 12, 2025 at 8:21 PM Daniel P. Berrangé > wrote: > > > > On Wed, Jan 29, 2025 at 05:40:38PM +0400, marcandre.lur...@redhat.com wrote: > > > From: Marc-André Lureau > > > > > > We may want to check qemu-rdp presen

Re: [PATCH 0/9] qemu: support passt as the backend for vhost-user network interfaces

2025-02-14 Thread Stefano Brivio
On Fri, 14 Feb 2025 03:17:06 -0800 Andrea Bolognani wrote: > On Thu, Feb 13, 2025 at 01:19:44PM -0500, Laine Stump wrote: > > passt (https://passt.top) provides a method of connecting QEMU virtual > > machines to the external network without requiring special privileges > > or capabilities of any

Re: [PATCH 0/9] qemu: support passt as the backend for vhost-user network interfaces

2025-02-14 Thread Stefano Brivio
On Fri, 14 Feb 2025 06:47:53 -0800 Andrea Bolognani wrote: > On Fri, Feb 14, 2025 at 09:08:36AM -0500, Laine Stump wrote: > > On 2/14/25 6:17 AM, Andrea Bolognani wrote: > > > Speaking of SELinux, with the current policy on Fedora 41 I get a > > > couple of AVC denials related to accessing the

Re: [PATCH v3 1/1] qemu: Add support for RAPL MSRs feature

2025-02-14 Thread Anthony Harivel
Hi Peter, Peter Krempa, Feb 12, 2025 at 17:17: > On Wed, Feb 12, 2025 at 16:36:48 +0100, Anthony Harivel wrote: >> Add the support in libvirt to activate the RAPL feature in QEMU. >> >> This feature is activated with -accel kvm,rapl=true,path=/path/sock.sock >> in QEMU. >> >> The feature is acti

Re: [PATCH 9/9] qemu: complete vhostuser + passt support

2025-02-14 Thread Andrea Bolognani
On Fri, Feb 14, 2025 at 10:59:11AM -0500, Laine Stump wrote: > On 2/14/25 9:21 AM, Andrea Bolognani wrote: > > You can restrict the check to just the vhost-user passt case, leaving > > other vhost-user cases alone, so that we don't have to worry about > > accidentally breaking existing configuratio