Re: [PATCH] tools: fix paths in PKI validation error messages

2024-06-13 Thread Pavel Hrdina
On Wed, Jun 12, 2024 at 11:54:54AM +0100, Daniel P. Berrangé wrote: > A couple of paths passed in the error messages, didnt match the paths > that were actually being tested. > > Signed-off-by: Daniel P. Berrangé > --- > tools/virt-pki-validate.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 de

Re: [PATCH 0/2] network: fix network driver to gracefully skip startup

2024-06-13 Thread Andrea Bolognani
On Tue, Jun 11, 2024 at 05:47:56PM GMT, Daniel P. Berrangé wrote: > We should gracefully skip startup when: > > * No network.conf firewall_backend is explicitly set, and >neither iptables/nftables are present > * Running unprivileged > > The former fixes libvirtd startup on non-Linux, or mini

Re: [PATCH v2 00/20] node_dev_udev: use workerpool and improve nodedev events

2024-06-13 Thread Marc Hartmayer
On Tue, Apr 23, 2024 at 08:08 PM +0200, Marc Hartmayer wrote: > When an udev event occurs for a mediated device (mdev) the mdev config data > requires an update via mdevctl as the udev event does not contain all config > data. This update needs to occur immediately and to be finished before the >

Re: [RFC PATCH 0/1] support deprecated-props from query-cpu-model-expansion

2024-06-13 Thread Jiri Denemark
On Tue, Jun 04, 2024 at 11:42:25 -0400, Collin Walling wrote: > The QEMU portion is designed for s390x such that there is a static list > of hardcoded feature bits that are flagged for deprecation. This list > can be updated in follow-up patches as more features need to be flagged. Good, a single

Re: [PATCH 0/2] network: fix network driver to gracefully skip startup

2024-06-13 Thread Daniel P . Berrangé
On Thu, Jun 13, 2024 at 04:57:14AM -0400, Andrea Bolognani wrote: > On Tue, Jun 11, 2024 at 05:47:56PM GMT, Daniel P. Berrangé wrote: > > We should gracefully skip startup when: > > > > * No network.conf firewall_backend is explicitly set, and > >neither iptables/nftables are present > > * Ru

[PATCH 01/12] qemuBlockJobProcessEventConcludedBackup: Handle potentially NULL 'job->disk'

2024-06-13 Thread Peter Krempa
Similarly to other blockjob handlers, if there's no disk associated with the blockjob the handler needs to behave correctly. This is needed as the disk might have been de-associated on unplug or other operations. Signed-off-by: Peter Krempa --- src/qemu/qemu_backup.c | 6 +++--- src/qemu/qemu_

[PATCH 02/12] qemuDomainDiskPrivateDispose: Prevent dangling 'disk' pointer in blockjob data

2024-06-13 Thread Peter Krempa
Clear the 'disk' member of 'blockjob' as we're freeing the disk object at this point. While this should not normally happen it was observed when other bug allowed the VM to be cleared while other threads didn't yet finish. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 8 +++- 1 fi

[PATCH 03/12] qemuDomainDeviceBackendChardevForeach: Fix typo in comment

2024-06-13 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index a39f361a64..9bbad887e0 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -12302,7 +12302,7 @@ qemuDoma

[PATCH 04/12] qemuDomainObjWait: Add documentation

2024-06-13 Thread Peter Krempa
Document why this function exists and meaning of return values. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 12 1 file changed, 12 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 9bbad887e0..8fe1b1924d 100644 --- a/src/qemu/qemu_domain.

[PATCH 06/12] qemuProcessStop: Move code not depending on 'vm->def->id' after reset of the ID

2024-06-13 Thread Peter Krempa
There are few function calls done while cleaning up a stopped VM which do require the old VM id, to e.g. clean up paths containing the 'short' domain name in the path. Anything else, which doesn't strictly require it can be moved after clearing the 'id' in order to decrease likelyhood of potential

[PATCH 10/12] qemu: migration: Inline 'qemuMigrationDstFinishResume()'

2024-06-13 Thread Peter Krempa
The function is a pointless wrapper on top of qemuMigrationDstWaitForCompletion. Signed-off-by: Peter Krempa --- src/qemu/qemu_migration.c | 19 ++- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 0d8d3fd9

[PATCH 12/12] qemu: migration: Preserve error across qemuDomainSetMaxMemLock() on error paths

2024-06-13 Thread Peter Krempa
When a VM terminates itself while it's being migrated in running state libvirt would report wrong error: error: cannot get locked memory limit of process 2502057: No such file or directory rather than the proper error: error: operation failed: domain is not running Remember the error on erro

[PATCH 09/12] qemu: migration: Properly check for live VM after qemuDomainObjWait()

2024-06-13 Thread Peter Krempa
Similarly to the one change in commit 4d1a1fdffda19a62d62fa2457d162362 we should be checking that the VM is not being yet destroyed if we've invoked qemuDomainObjWait(). Use the new helper qemuDomainObjIsActive(). Signed-off-by: Peter Krempa --- src/qemu/qemu_migration.c | 11 +-- 1 fil

[PATCH] qemu: Don't specify vfio-pci.ramfb when ramfb is false

2024-06-13 Thread Jonathon Jongsma
Commit 7c8e606b64c73ca56d7134cb16d01257f39c53ef attempted to fix the specification of the ramfb property for vfio-pci devices, but it failed when ramfb is explicitly set to 'off'. This is because only the 'vfio-pci-nohotplug' device supports the 'ramfb' property. Since we use the base 'vfio-pci' de

Re: [libvirt PATCH 00/28] native support for nftables in virtual network driver

2024-06-13 Thread Roman Bogorodskiy
Laine Stump wrote: > On 6/12/24 2:32 PM, Roman Bogorodskiy wrote: > >Laine Stump wrote: > > > > > On 6/10/24 2:54 PM, Roman Bogorodskiy wrote: > > > > Laine Stump wrote: > > > > > > > > > This patch series enables libvirt to use nftables rules rather than > > > > > iptables *when setti

[PATCH 08/12] qemu: domain: Introduce qemuDomainObjIsActive helper

2024-06-13 Thread Peter Krempa
The helper checks whether VM is active including the internal qemu state. This helper will become useful in situations when an async job is in use as VIR_JOB_DESTROY can run along async jobs thus both checks are necessary. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 18 +

[PATCH 05/12] qemuProcessStop: Prevent crash when qemuDomainObjStopWorker() unlocks the VM

2024-06-13 Thread Peter Krempa
'qemuDomainObjStopWorker()' which is meant to dispose of the event loop thread for the monitor unlocks the VM object while disposing the thread to prevent possible deadlocks with events waiting on the monitor thread. Unfortunately 'qemuDomainObjStopWorker()' is called *before* the VM is marked as

[PATCH 00/12] qemu: migration: Fix crashes when VM shutdowns itself during migration in active state

2024-06-13 Thread Peter Krempa
The daemon crashes due to unexpected cleanup happening due to bad assumptions about locking and state. See patch 5. Peter Krempa (12): qemuBlockJobProcessEventConcludedBackup: Handle potentially NULL 'job->disk' qemuDomainDiskPrivateDispose: Prevent dangling 'disk' pointer in blockjob

[PATCH 11/12] qemuMigrationSrcRun: Re-check whether VM is active before accessing job data

2024-06-13 Thread Peter Krempa
'qemuProcessStop()' clears the 'current' job data. While the code under the 'error' label in 'qemuMigrationSrcRun()' does check that the VM is active before accessing the job, it also invokes multiple helper functions to clean up the migration including 'qemuMigrationSrcNBDCopyCancel()' which calls

Re: [libvirt PATCH 00/28] native support for nftables in virtual network driver

2024-06-13 Thread Daniel P . Berrangé
On Wed, Jun 12, 2024 at 07:31:51PM -0400, Laine Stump wrote: > On 6/12/24 2:32 PM, Roman Bogorodskiy wrote: > >Laine Stump wrote: > > > > > On 6/10/24 2:54 PM, Roman Bogorodskiy wrote: > > > > Laine Stump wrote: > > > > > > > > > This patch series enables libvirt to use nftables rules rat

Re: [libvirt PATCH 00/28] native support for nftables in virtual network driver

2024-06-13 Thread Roman Bogorodskiy
Andrea Bolognani wrote: > On Wed, Jun 12, 2024 at 07:31:51PM GMT, Laine Stump wrote: > > On 6/12/24 2:32 PM, Roman Bogorodskiy wrote: > > > I'm using it with the following network configuration: > > > > > > virsh # net-dumpxml default > > > > > >default > > >2a1415c9-325b-41e4-82c6-e805

[PATCH 07/12] qemu: process: Ensure that 'beingDestroyed' gets cleared only after VM id is reset

2024-06-13 Thread Peter Krempa
Prevent the possibility that a VM could be considered as alive while inside qemuProcessStop. A recently fixed bug which unlocked the domain object while inside qemuProcessStop showed that there's possibility to confuse the state of the VM to be considered active while 'qemuProcessStop' is processi

Re: [PATCH] network: introduce a "none" firewall backend type

2024-06-13 Thread Roman Bogorodskiy
Daniel P. Berrangé wrote: > There are two scenarios identified after the recent firewall backend > selection was introduced, which result in libvirtd failing to startup > due to an inability to find either iptables/nftables > > - On Linux if running unprivileged with $PATH lacking the dir >

Re: [libvirt PATCH 00/28] native support for nftables in virtual network driver

2024-06-13 Thread Andrea Bolognani
On Wed, Jun 12, 2024 at 07:31:51PM GMT, Laine Stump wrote: > On 6/12/24 2:32 PM, Roman Bogorodskiy wrote: > > I'm using it with the following network configuration: > > > > virsh # net-dumpxml default > > > >default > >2a1415c9-325b-41e4-82c6-e805162d8934 > > > > > > > > >

Re: [libvirt PATCH 00/28] native support for nftables in virtual network driver

2024-06-13 Thread Andrea Bolognani
On Thu, Jun 13, 2024 at 06:24:00PM GMT, Roman Bogorodskiy wrote: > Laine Stump wrote: > > On 6/12/24 2:32 PM, Roman Bogorodskiy wrote: > > > So basically all the mechanics like creating tap devices, bridges, > > > serving dhcp, etc, all these work for me. On top of that I had a few > > > iteratio

[PATCH] network: introduce a "none" firewall backend type

2024-06-13 Thread Daniel P . Berrangé
There are two scenarios identified after the recent firewall backend selection was introduced, which result in libvirtd failing to startup due to an inability to find either iptables/nftables - On Linux if running unprivileged with $PATH lacking the dir containing iptables/nftables - On non-L

Re: [libvirt PATCH 00/28] native support for nftables in virtual network driver

2024-06-13 Thread Roman Bogorodskiy
Andrea Bolognani wrote: > On Thu, Jun 13, 2024 at 06:24:00PM GMT, Roman Bogorodskiy wrote: > > Laine Stump wrote: > > > On 6/12/24 2:32 PM, Roman Bogorodskiy wrote: > > > > So basically all the mechanics like creating tap devices, bridges, > > > > serving dhcp, etc, all these work for me. On t

Re: [PATCH v2 00/20] node_dev_udev: use workerpool and improve nodedev events

2024-06-13 Thread Jonathon Jongsma
On 6/13/24 6:13 AM, Marc Hartmayer wrote: On Tue, Apr 23, 2024 at 08:08 PM +0200, Marc Hartmayer wrote: When an udev event occurs for a mediated device (mdev) the mdev config data requires an update via mdevctl as the udev event does not contain all config data. This update needs to occur imme

Re: [libvirt PATCH 00/28] native support for nftables in virtual network driver

2024-06-13 Thread Daniel P . Berrangé
On Thu, Jun 13, 2024 at 05:33:43PM +0100, Daniel P. Berrangé wrote: > On Wed, Jun 12, 2024 at 07:31:51PM -0400, Laine Stump wrote: > > On 6/12/24 2:32 PM, Roman Bogorodskiy wrote: > > > > > > Unfortunately, I don't have access to that setup anymore and I haven't > > > re-created it yet. IIRC, it c

[PATCH RFC 0/9] qemu: Support mapped-ram migration capability

2024-06-13 Thread Jim Fehlig via Devel
This series is a RFC for support of QEMU's mapped-ram migration capability [1] for saving and restoring VMs. It implements the first part of the design approach we discussed for supporting parallel save/restore [2]. In summary, the approach is 1. Add mapped-ram migration capability 2. Steal an ele

[PATCH RFC 1/9] qemu: Enable mapped-ram migration capability

2024-06-13 Thread Jim Fehlig via Devel
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/qemu_migration_params.c index 48f8657f71..201286e58c 100644 --- a/src/qemu/qemu_migration_params

[PATCH RFC 2/9] qemu_fd: Add function to retrieve fdset ID

2024-06-13 Thread Jim Fehlig via Devel
Add new function qemuFDPassGetId(), to be used when adding support for mapped-ram save format. Signed-off-by: Jim Fehlig --- 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 b/src/qemu/qemu_fd.c index e847

[PATCH RFC 3/9] qemu: Add function to get migration params for save

2024-06-13 Thread Jim Fehlig via Devel
Introduce qemuMigrationParamsForMappedSave() to create a qemuMigrationParams object initialized with appropriate migration capabilities and parameters for a save operation using mapped-ram. Note that mapped-ram also requires the multifd capability. For now, the number of multifd channels is set to

[PATCH RFC 4/9] qemu: Add a 'features' element to save image header and bump version

2024-06-13 Thread Jim Fehlig via Devel
QEMU's new mapped-ram stream format [1] is incompatible with the existing sequential format. In order to support the new format in libvirt, a new 'features' element is added to the saved image header. This element can be used now indicate the use of mapped-ram feature, and provides a mechanism to s

[PATCH RFC 5/9] qemu: conf: Add setting for save image version

2024-06-13 Thread Jim Fehlig via Devel
Add a 'save_image_version' setting to qemu.conf to control the image version when saving a VM with 'virsh save' or 'virsh managedsave'. Default to the new version 3. Signed-off-by: Jim Fehlig --- src/qemu/libvirtd_qemu.aug | 1 + src/qemu/qemu.conf.in | 6 ++ src/qemu/

[PATCH RFC 6/9] qemu: Add support for mapped-ram on save

2024-06-13 Thread Jim Fehlig via Devel
Signed-off-by: Jim Fehlig --- src/qemu/qemu_driver.c| 2 +- src/qemu/qemu_migration.c | 79 src/qemu/qemu_migration.h | 7 +++ src/qemu/qemu_monitor.c | 32 src/qemu/qemu_monitor.h | 4 ++ src/qemu/qemu_saveimage.c | 105 ++

[PATCH RFC 7/9] qemu: Enable mapped-ram on restore

2024-06-13 Thread Jim Fehlig via Devel
Signed-off-by: Jim Fehlig --- src/qemu/qemu_migration.c | 19 +++ src/qemu/qemu_migration.h | 3 ++- src/qemu/qemu_process.c | 49 --- src/qemu/qemu_process.h | 13 +++ src/qemu/qemu_saveimage.c | 26 ++--- 5 files chang

[PATCH RFC 8/9] qemu: Support O_DIRECT with mapped-ram on save

2024-06-13 Thread Jim Fehlig via Devel
Signed-off-by: Jim Fehlig --- I'm not happy with this and the subsequent patch, which pass another FD around for QEMU to use for reading/writing unaligned state when BYPASS_CACHE has been specified. One idea is to pass the qemuFdPass object around the various functions, but qemu_fd.h already incl

[PATCH RFC 9/9] qemu: Support O_DIRECT with mapped-ram on restore

2024-06-13 Thread Jim Fehlig via Devel
Signed-off-by: Jim Fehlig --- src/qemu/qemu_driver.c| 22 +- src/qemu/qemu_migration.c | 2 +- src/qemu/qemu_process.c | 20 src/qemu/qemu_process.h | 3 +++ src/qemu/qemu_saveimage.c | 29 + src/qemu/qemu_saveimage.h