Re: [PATCH] vbox: Drop needless g_new0(..., 0) in vbox_snapshot_conf.c

2024-04-12 Thread Pavel Hrdina
On Fri, Apr 12, 2024 at 08:52:37PM +0200, Michal Privoznik wrote: > clang on Fedora started to complain about some calls to g_new0() > we're making in vbox_snapshot_conf.c. Specifically, we're passing > zero as number of elements to allocate. And while usually SA > tools are not clever, in this spe

[PATCH] vbox: Drop needless g_new0(..., 0) in vbox_snapshot_conf.c

2024-04-12 Thread Michal Privoznik
clang on Fedora started to complain about some calls to g_new0() we're making in vbox_snapshot_conf.c. Specifically, we're passing zero as number of elements to allocate. And while usually SA tools are not clever, in this specific case clang is right. There are three cases where such call is made,

Re: [PATCH 5/5] domain_interface: Introduce and use virDomainInterfaceClearQoS()

2024-04-12 Thread Peter Krempa
On Fri, Apr 12, 2024 at 17:18:41 +0200, Michal Prívozník wrote: > On 4/12/24 16:33, Peter Krempa wrote: > > On Fri, Apr 12, 2024 at 12:19:05 +0200, Michal Privoznik wrote: > >> In QEMU and LXC drivers in a few places just > > > > s/just/only/ so that's more clear that something is missing. > > >

Re: [PATCH 5/5] domain_interface: Introduce and use virDomainInterfaceClearQoS()

2024-04-12 Thread Michal Prívozník
On 4/12/24 16:33, Peter Krempa wrote: > On Fri, Apr 12, 2024 at 12:19:05 +0200, Michal Privoznik wrote: >> In QEMU and LXC drivers in a few places just > > s/just/only/ so that's more clear that something is missing. > Fixed locally. Does it warrant your Reviewed-by? ;-) Michal

Re: [PATCH 5/5] domain_interface: Introduce and use virDomainInterfaceClearQoS()

2024-04-12 Thread Peter Krempa
On Fri, Apr 12, 2024 at 12:19:05 +0200, Michal Privoznik wrote: > In QEMU and LXC drivers in a few places just s/just/only/ so that's more clear that something is missing. > virNetDevBandwidthClear() is called. This means that if an > interface is of openvswitch vport profile, its QoS is not > re

Re: [PATCH-for-9.1 v2 2/3] migration: Remove RDMA protocol handling

2024-04-12 Thread Peter Xu
Yu, On Thu, Apr 11, 2024 at 06:36:54PM +0200, Yu Zhang wrote: > > 1) Either a CI test covering at least the major RDMA paths, or at least > > periodically tests for each QEMU release will be needed. > We use a batch of regression test cases for the stack, which covers the > test for QEMU. I di

Re: [RFC PATCH v1 01/15] nodedev: fix mdev add udev event data handling

2024-04-12 Thread Marc Hartmayer
On Fri, Apr 12, 2024 at 03:36 PM +0200, Marc Hartmayer wrote: > From: Boris Fiuczynski > > Two situations will trigger an udev add event: > 1) the mdev is created when started (transient) or > 2) the mdev was defined and is started > In case 1 there is no node object existing and no config dat

[RFC PATCH v1 14/15] node_device_udev: Don't take `mdevctl` lock for querying `mdevctl list`

2024-04-12 Thread Marc Hartmayer
There is no reason to serialize the `mdevctl list` calls. Signed-off-by: Marc Hartmayer --- src/node_device/node_device_udev.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c index 9282afdd3241..77

[RFC PATCH v1 10/15] node_device_udev: Inline `udevRemoveOneDevice`

2024-04-12 Thread Marc Hartmayer
Inline `udevRemoveOneDevice` as it's used only once. Signed-off-by: Marc Hartmayer --- src/node_device/node_device_udev.c | 17 + 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c index a121ad99

[RFC PATCH v1 13/15] node_device_udev: Call `nodeDeviceUpdateMediatedDevices` directly

2024-04-12 Thread Marc Hartmayer
When an udev event occurs the mdev active config data requires an update via mdevctl as the udev does not contain all config data. This update needs to occur immediate and to be finished before the libvirt nodedev event is issued to keep the API usage reliable. The only case where a direct `nodeDe

[RFC PATCH v1 12/15] node_device_udev: Use a worker pool for processing the udev events

2024-04-12 Thread Marc Hartmayer
Use a worker pool for processing the udev events and the initialization instead of a separate initThread and a mdevctl-thread. This has the large advantage that we can leverage the job API and now this thread pool is responsible to do all the "costly-work" and the libvirt nodedev event creation. T

[RFC PATCH v1 15/15] node_device_udev: Make the code easier to read

2024-04-12 Thread Marc Hartmayer
There is only one case where force is true, therefore let's inline that case. Signed-off-by: Marc Hartmayer --- src/node_device/node_device_udev.c | 25 +++-- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/node_device/node_device_udev.c b/src/node_device

[RFC PATCH v1 11/15] node_device_udev: Use `stateShutdownPrepare` and `stateShutdownWait`

2024-04-12 Thread Marc Hartmayer
Use the proper driver functions for the node state shutdown preparation and wait. In the next patch, these functions will be extended. Signed-off-by: Marc Hartmayer --- src/node_device/node_device_udev.c | 54 +++--- 1 file changed, 42 insertions(+), 12 deletions(-) diff

[RFC PATCH v1 08/15] node_device_udev: Take lock if `driver->privateData` is modified

2024-04-12 Thread Marc Hartmayer
Since @driver->privateData is modified take the lock. Reviewed-by: Boris Fiuczynski Signed-off-by: Marc Hartmayer --- src/node_device/node_device_udev.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/node_device/node_device_udev.c b/src/node_device/nod

[RFC PATCH v1 03/15] nodedev: immediate update of active config on udev add

2024-04-12 Thread Marc Hartmayer
From: Boris Fiuczynski When an udev add event occurs the mdev active config data requires an update via mdevctl as the udev does not contain all config data. This update needs to occur immediate and to be finished before the libvirt CREATE event is issued to keep the API usage reliable. After th

[RFC PATCH v1 09/15] node_device_udev: Add prefix `udev` for udev related data

2024-04-12 Thread Marc Hartmayer
The new names make it easier to understand the purpose of the data. Reviewed-by: Boris Fiuczynski Signed-off-by: Marc Hartmayer --- src/node_device/node_device_udev.c | 48 +++--- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/node_device/node_device

[RFC PATCH v1 07/15] node_device_udev: Add comments about locking

2024-04-12 Thread Marc Hartmayer
Commit a99d876a0f58 ("node_device: Use automatic mutex management") replaced the locking mechanism and accidentally removed the comment with the reason why the lock is taken. Restore this comment and add a new comment about the lock. Reviewed-by: Boris Fiuczynski Signed-off-by: Marc Hartmayer --

[RFC PATCH v1 06/15] node_device_udev: Test for mdevctlTimeout != -1

2024-04-12 Thread Marc Hartmayer
It is done a little differently everywhere in libvirt, but most common is to test for != -1. Reviewed-by: Boris Fiuczynski Signed-off-by: Marc Hartmayer --- src/node_device/node_device_udev.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/node_device/node_device_

[RFC PATCH v1 05/15] node_device_udev: Remove the timeout if the data is disposed

2024-04-12 Thread Marc Hartmayer
Remove the timeout when the udevEventData is disposed, analogous to priv->watch. Reviewed-by: Boris Fiuczynski Signed-off-by: Marc Hartmayer --- src/node_device/node_device_udev.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_d

[RFC PATCH v1 04/15] nodedev: reset active config data on udev remove event

2024-04-12 Thread Marc Hartmayer
From: Boris Fiuczynski When a mdev device is destroyed or stopped the udev remove event handling needs to reset the active config data of the node object representing a persisted mdev. Reviewed-by: Marc Hartmayer Signed-off-by: Boris Fiuczynski Signed-off-by: Marc Hartmayer --- src/node_devi

[RFC PATCH v1 02/15] node_device_udev: Set @def to NULL

2024-04-12 Thread Marc Hartmayer
@def is owned by @obj after adding it the node device object list. As soon as the @obj lock has been released, another thread could free @obj and therefore @def. If now someone accesses @def this would lead to a heap-use-after-free and therefore most likely to a segmentation fault, therefore set @d

[RFC PATCH v1 01/15] nodedev: fix mdev add udev event data handling

2024-04-12 Thread Marc Hartmayer
From: Boris Fiuczynski Two situations will trigger an udev add event: 1) the mdev is created when started (transient) or 2) the mdev was defined and is started In case 1 there is no node object existing and no config data is copied. In case 2 copying the active config data of an existing node o

[RFC PATCH v1 00/15] node_dev_udev: use workerpool and improve nodedev events

2024-04-12 Thread Marc Hartmayer
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 immediate and to be finished before the libvirt nodedev event is issued to keep the API usage reliable. This pat

Re: [PATCH 4/5] conf: Move virDomainClearNetBandwidth() to src/hypervisor/

2024-04-12 Thread Peter Krempa
On Fri, Apr 12, 2024 at 12:19:04 +0200, Michal Privoznik wrote: > The reason virDomainClearNetBandwidth() exists in src/conf/ is > that at the time its introduction we did not have a better place. > But now we do. Firstly, virDomainClearNetBandwidth() is > hypervisor agnostic code, but really has n

Re: [PATCH 3/5] virnetdevopenvswitch: Drop @brname arg from virNetDevOpenvswitchRemovePort()

2024-04-12 Thread Peter Krempa
On Fri, Apr 12, 2024 at 12:19:03 +0200, Michal Privoznik wrote: > The @brname argument of virNetDevOpenvswitchRemovePort() is and > was unused ever since its introduction in v0.9.11-rc1~257. Just > remove it. > > Signed-off-by: Michal Privoznik > --- Reviewed-by: Peter Krempa __

Re: [PATCH 2/5] hypervisor: Introduce and use virDomainInterfaceVportRemove()

2024-04-12 Thread Peter Krempa
On Fri, Apr 12, 2024 at 12:19:02 +0200, Michal Privoznik wrote: > Both LXC and QEMU drivers have the same code to remove vport when > removing a domain's interface. Instead of repeating the same > pattern in both drivers, move the code into hypervisor agnostic > location (src/hypervisor/) and switc

Re: [PATCH 1/5] virnetdevopenvswitch: Fix comment to virNetDevOpenvswitchInterfaceGetMaster()

2024-04-12 Thread Peter Krempa
On Fri, Apr 12, 2024 at 12:19:01 +0200, Michal Privoznik wrote: > The comment to virNetDevOpenvswitchInterfaceGetMaster() contains > wrong function name. Fix this. > > Signed-off-by: Michal Privoznik > --- Reviewed-by: Peter Krempa ___ Devel mailing l

Re: [PATCH] vsh: Drop fwd declaration of a nonexistent function

2024-04-12 Thread Peter Krempa
On Fri, Apr 12, 2024 at 12:31:26 +0200, Michal Privoznik wrote: > The vshFindTypedParamByName() function no longer exists (as of > v1.0.2-rc1~82), but its header file declaration was still kept > around. Drop it. > > Signed-off-by: Michal Privoznik > --- Trivial; Reviewed-by: Peter Krempa

[PATCH] vsh: Drop fwd declaration of a nonexistent function

2024-04-12 Thread Michal Privoznik
The vshFindTypedParamByName() function no longer exists (as of v1.0.2-rc1~82), but its header file declaration was still kept around. Drop it. Signed-off-by: Michal Privoznik --- tools/vsh.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/vsh.h b/tools/vsh.h index f06d65407d..eeba1d4

[PATCH 5/5] domain_interface: Introduce and use virDomainInterfaceClearQoS()

2024-04-12 Thread Michal Privoznik
In QEMU and LXC drivers in a few places just virNetDevBandwidthClear() is called. This means that if an interface is of openvswitch vport profile, its QoS is not removed. And to make matters worse - OVS is designed to remember state even when corresponding interface is gone. This leads to stale QoS

[PATCH 4/5] conf: Move virDomainClearNetBandwidth() to src/hypervisor/

2024-04-12 Thread Michal Privoznik
The reason virDomainClearNetBandwidth() exists in src/conf/ is that at the time its introduction we did not have a better place. But now we do. Firstly, virDomainClearNetBandwidth() is hypervisor agnostic code, but really has nothing to do with domain configuration (it doesn't parse/format XML). Se

[PATCH 2/5] hypervisor: Introduce and use virDomainInterfaceVportRemove()

2024-04-12 Thread Michal Privoznik
Both LXC and QEMU drivers have the same code to remove vport when removing a domain's interface. Instead of repeating the same pattern in both drivers, move the code into hypervisor agnostic location (src/hypervisor/) and switch to calling this new function. Signed-off-by: Michal Privoznik --- s

[PATCH 3/5] virnetdevopenvswitch: Drop @brname arg from virNetDevOpenvswitchRemovePort()

2024-04-12 Thread Michal Privoznik
The @brname argument of virNetDevOpenvswitchRemovePort() is and was unused ever since its introduction in v0.9.11-rc1~257. Just remove it. Signed-off-by: Michal Privoznik --- src/hypervisor/domain_interface.c | 4 +--- src/util/virnetdevopenvswitch.c | 2 +- src/util/virnetdevopenvswitch.h |

[PATCH 1/5] virnetdevopenvswitch: Fix comment to virNetDevOpenvswitchInterfaceGetMaster()

2024-04-12 Thread Michal Privoznik
The comment to virNetDevOpenvswitchInterfaceGetMaster() contains wrong function name. Fix this. Signed-off-by: Michal Privoznik --- src/util/virnetdevopenvswitch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/virnetdevopenvswitch.c b/src/util/virnetdevopenvswitch.

[PATCH 0/5] Clear QoS for OVS more frequently

2024-04-12 Thread Michal Privoznik
*** BLURB HERE *** Michal Prívozník (5): virnetdevopenvswitch: Fix comment to virNetDevOpenvswitchInterfaceGetMaster() hypervisor: Introduce and use virDomainInterfaceVportRemove() virnetdevopenvswitch: Drop @brname arg from virNetDevOpenvswitchRemovePort() conf: Move virDomainClea

Re: [RFC PATCH v1 4/5] node_device_udev: Take lock if driver->privateData is modified

2024-04-12 Thread Marc Hartmayer
On Thu, Apr 11, 2024 at 05:50 PM +0200, Boris Fiuczynski wrote: > Reviewed-by: Boris Fiuczynski > > On 4/3/24 16:03, Marc Hartmayer wrote: >> Since @driver->privateData is modified take the lock. >> >> Question: In theory we could take the udevEventData->mdevctlLock? > > Isn't that protecting t