Re: [libvirt PATCH] nodedev: wait a bit longer for new node devices

2022-08-24 Thread Daniel P . Berrangé
On Wed, Aug 24, 2022 at 10:56:22AM -0500, Jonathon Jongsma wrote: > On 8/24/22 2:09 AM, Erik Skultety wrote: > > On Tue, Aug 23, 2022 at 12:43:03PM -0500, Jonathon Jongsma wrote: > > > Openstack developers reported that newly-created mdevs were not > > > recognized by libvirt until after a libvirt

Re: [libvirt PATCH] nodedev: wait a bit longer for new node devices

2022-08-24 Thread Erik Skultety
On Wed, Aug 24, 2022 at 10:56:22AM -0500, Jonathon Jongsma wrote: > On 8/24/22 2:09 AM, Erik Skultety wrote: > > On Tue, Aug 23, 2022 at 12:43:03PM -0500, Jonathon Jongsma wrote: > > > Openstack developers reported that newly-created mdevs were not > > > recognized by libvirt until after a libvirt

Re: [libvirt PATCH] nodedev: wait a bit longer for new node devices

2022-08-24 Thread Jonathon Jongsma
On 8/24/22 2:09 AM, Erik Skultety wrote: On Tue, Aug 23, 2022 at 12:43:03PM -0500, Jonathon Jongsma wrote: Openstack developers reported that newly-created mdevs were not recognized by libvirt until after a libvirt daemon restart. The source of the problem appears to be that when libvirt gets

[libvirt PATCH] src: warn if client hits the max requests limit

2022-08-24 Thread Daniel P . Berrangé
Since they are simply normal RPC messages, the keep alive packets are subject to the "max_client_requests" limit just like any API calls. Thus, if a client hits the 'max_client_requests' limit and all the pending API calls take a long time to complete, it may result in keep-alives firing and

Re: [PATCH 2/3] conf, docs: Add support for dummy network interface

2022-08-24 Thread Martin Kletzander
On Wed, Aug 24, 2022 at 03:12:53PM +0100, Daniel P. Berrangé wrote: On Wed, Aug 24, 2022 at 04:09:31PM +0200, Martin Kletzander wrote: On Tue, Aug 23, 2022 at 12:10:14PM +0100, Daniel P. Berrangé wrote: > On Tue, Aug 23, 2022 at 01:01:49PM +0200, Martin Kletzander wrote: > > On Tue, Aug 23,

Re: [PATCH 2/3] conf, docs: Add support for dummy network interface

2022-08-24 Thread Martin Kletzander
On Tue, Aug 23, 2022 at 12:10:14PM +0100, Daniel P. Berrangé wrote: On Tue, Aug 23, 2022 at 01:01:49PM +0200, Martin Kletzander wrote: On Tue, Aug 23, 2022 at 11:39:10AM +0100, Daniel P. Berrangé wrote: > On Thu, Aug 04, 2022 at 03:07:17PM +0200, Martin Kletzander wrote: > > Signed-off-by:

[PATCH 11/17] qemu: use virDomainObjEndJob()

2022-08-24 Thread Kristina Hanicova
This patch moves qemuDomainObjEndJob() into src/conf/virdomainjob as universal virDomainObjEndJob(). Signed-off-by: Kristina Hanicova --- docs/kbase/internals/qemu-threads.rst | 6 +- src/conf/virdomainjob.c | 28 + src/conf/virdomainjob.h | 2 +

[PATCH 10/17] CH: use virDomainObjBeginJob()

2022-08-24 Thread Kristina Hanicova
This patch removes virCHDomainObjBeginJob() and replaces it with call to the generalized virDomainObjBeginJob(). Signed-off-by: Kristina Hanicova --- src/ch/ch_domain.c | 51 +- src/ch/ch_domain.h | 4 src/ch/ch_driver.c | 20 +-

Re: [PATCH 2/3] conf, docs: Add support for dummy network interface

2022-08-24 Thread Daniel P . Berrangé
On Wed, Aug 24, 2022 at 04:09:31PM +0200, Martin Kletzander wrote: > On Tue, Aug 23, 2022 at 12:10:14PM +0100, Daniel P. Berrangé wrote: > > On Tue, Aug 23, 2022 at 01:01:49PM +0200, Martin Kletzander wrote: > > > On Tue, Aug 23, 2022 at 11:39:10AM +0100, Daniel P. Berrangé wrote: > > > > On Thu,

[PATCH 16/17] qemu & conf: move BeginAsyncJob & EndAsyncJob into src/conf

2022-08-24 Thread Kristina Hanicova
Signed-off-by: Kristina Hanicova --- docs/kbase/internals/qemu-threads.rst | 12 +-- src/conf/virdomainjob.c | 30 +++ src/conf/virdomainjob.h | 6 ++ src/libvirt_private.syms | 2 ++ src/qemu/qemu_backup.c

[PATCH 17/17] qemu & conf: move BeginNestedJob & BeginJobNowait into src/conf

2022-08-24 Thread Kristina Hanicova
Signed-off-by: Kristina Hanicova --- src/conf/virdomainjob.c | 44 +++ src/conf/virdomainjob.h | 6 ++ src/libvirt_private.syms | 2 ++ src/qemu/qemu_domain.c| 2 +- src/qemu/qemu_domainjob.c | 44 ---

[PATCH 14/17] CH: use virDomainObjEndJob()

2022-08-24 Thread Kristina Hanicova
This patch removes virCHDomainObjEndJob() and replaces it with call to the generalized virDomainObjEndJob(). Signed-off-by: Kristina Hanicova --- src/ch/ch_domain.c | 18 -- src/ch/ch_domain.h | 3 --- src/ch/ch_driver.c | 20 ++-- 3 files changed, 10

[PATCH 08/17] libxl: use virDomainObjBeginJob()

2022-08-24 Thread Kristina Hanicova
This patch removes libxlDomainObjBeginJob() and replaces it with generalized virDomainObjBeginJob(). Signed-off-by: Kristina Hanicova --- src/libxl/libxl_domain.c| 62 ++--- src/libxl/libxl_domain.h| 6 src/libxl/libxl_driver.c| 48

[PATCH 05/17] conf: extend xmlopt with job config & add job object into domain object

2022-08-24 Thread Kristina Hanicova
This patch adds the generalized job object into the domain object so that it can be used by all drivers without the need to extract it from the private data. Because of this, the job object needs to be created and set during the creation of the domain object. This patch also extends xmlopt with

[PATCH 07/17] qemu: use virDomainObjBeginJob()

2022-08-24 Thread Kristina Hanicova
This patch moves qemuDomainObjBeginJob() into src/conf/virdomainjob as universal virDomainObjBeginJob(). Signed-off-by: Kristina Hanicova --- docs/kbase/internals/qemu-threads.rst | 8 +- src/conf/virdomainjob.c | 18 +++ src/conf/virdomainjob.h | 4 +

[PATCH 15/17] qemu & conf: move BeginAgentJob & EndAgentJob into src/conf/virdomainjob

2022-08-24 Thread Kristina Hanicova
Although these and functions in the following two patches are for now just being used by the qemu driver, it makes sense to have all begin job functions in the same file. Signed-off-by: Kristina Hanicova --- docs/kbase/internals/qemu-threads.rst | 10 ++-- src/conf/virdomainjob.c

[PATCH 02/17] libxl: remove usage of virDomainJobData

2022-08-24 Thread Kristina Hanicova
Struct virDomainJobData is meant for statistics for async jobs. It was used to keep track of only two attributes, one of which is also in the generalized virDomainJobObj ("started") and one which is always set to the same value, if any job is active ("jobType"). This patch removes usage &

[PATCH 06/17] virdomainjob: make drivers use job object in the domain object

2022-08-24 Thread Kristina Hanicova
This patch uses the job object directly in the domain object and removes the job object from private data of all drivers that use it as well as other relevant code (initializing and freeing the structure). Signed-off-by: Kristina Hanicova --- src/ch/ch_domain.c | 29 ++--

[PATCH 01/17] qemu & hypervisor: move qemuDomainObjBeginJobInternal() into hyperisor

2022-08-24 Thread Kristina Hanicova
This patch moves qemuDomainObjBeginJobInternal() as virDomainObjBeginJobInternal() into hypervisor in order to be used by other hypervisors in the following patches. Signed-off-by: Kristina Hanicova --- po/POTFILES | 1 + src/hypervisor/domain_job.c | 250

[PATCH 09/17] LXC: use virDomainObjBeginJob()

2022-08-24 Thread Kristina Hanicova
This patch removes virLXCDomainObjBeginJob() and replaces it with call to the generalized virDomainObjBeginJob(). Signed-off-by: Kristina Hanicova --- src/lxc/lxc_domain.c | 57 src/lxc/lxc_domain.h | 6 - src/lxc/lxc_driver.c | 46

[PATCH 13/17] LXC: use virDomainObjEndJob()

2022-08-24 Thread Kristina Hanicova
This patch removes virLXCDomainObjEndJob() and replaces it with call to the generalized virDomainObjEndJob(). Signed-off-by: Kristina Hanicova --- src/lxc/lxc_domain.c | 20 src/lxc/lxc_domain.h | 4 src/lxc/lxc_driver.c | 57 +++-

[PATCH 12/17] libxl: use virDomainObjEndJob()

2022-08-24 Thread Kristina Hanicova
This patch removes libxlDomainObjEndJob() and replaces it with call to the generalized virDomainObjEndJob(). Signed-off-by: Kristina Hanicova --- src/libxl/libxl_domain.c| 27 ++-- src/libxl/libxl_domain.h| 4 --- src/libxl/libxl_driver.c| 51

[PATCH 00/17] jobs: finish generalization

2022-08-24 Thread Kristina Hanicova
This series finishes the generalization of the jobs-related code across jobs-using drivers. This is the last one, I promise. Kristina Hanicova (17): qemu & hypervisor: move qemuDomainObjBeginJobInternal() into hyperisor libxl: remove usage of virDomainJobData move files:

[PATCH 04/17] virdomainjob: add check for callbacks

2022-08-24 Thread Kristina Hanicova
There may be a case that the callback structure will exist with no callbacks (following patches). This patch adds check for specific callbacks before using them. Signed-off-by: Kristina Hanicova --- src/conf/virdomainjob.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff

[PATCH 03/17] move files: hypervisor/domain_job -> conf/virdomainjob

2022-08-24 Thread Kristina Hanicova
The following patches move job object as a member into the domain object. Because of this, domain_conf (where the domain object is defined) needs to import the file with the job object. It makes sense to move jobs to the same level as the domain_conf: into src/conf/ Signed-off-by: Kristina

Re: [PATCH] qemu: Do not keep swtmp pidfile around after stopping

2022-08-24 Thread Michal Prívozník
On 8/24/22 13:19, Michal Prívozník wrote: > On 8/23/22 16:19, Michal Prívozník wrote: >> On 8/18/22 16:20, Martin Kletzander wrote: >>> Just like the socket, remove the pidfile when TPM emulator is being >>> stopped. In >>> order to make this a bit cleaner, try to remove it even if swtpm_ioctl

Re: [PATCH] qemu: Do not keep swtmp pidfile around after stopping

2022-08-24 Thread Michal Prívozník
On 8/23/22 16:19, Michal Prívozník wrote: > On 8/18/22 16:20, Martin Kletzander wrote: >> Just like the socket, remove the pidfile when TPM emulator is being stopped. >> In >> order to make this a bit cleaner, try to remove it even if swtpm_ioctl does >> not >> exist. >> >> Signed-off-by:

[PATCH v4 5/8] qemu_process: Enable SCHED_CORE for QEMU process

2022-08-24 Thread Michal Privoznik
For QEMU_SCHED_CORE_EMULATOR or QEMU_SCHED_CORE_FULL the QEMU process (and its vCPU threads) should be placed into its own scheduling group. Since we have the dummy process running for exactly this purpose use its PID as an argument to virCommandSetRunAmong(). Signed-off-by: Michal Privoznik

[PATCH v4 6/8] qemu: Enable SCHED_CORE for helper processes

2022-08-24 Thread Michal Privoznik
For QEMU_SCHED_CORE_FULL case, all helper processes should be placed into the same scheduling group as the QEMU process they serve. It may happen though, that a helper process is started before QEMU (cold start of a domain). But we have the dummy process running from which the QEMU process will

[PATCH v4 8/8] qemu: Enable for vCPUs on hotplug

2022-08-24 Thread Michal Privoznik
As advertised in the previous commit, QEMU_SCHED_CORE_VCPUS case is implemented for hotplug case. The implementation is very similar to the cold boot case, except here we fork off for every vCPU (because the implementation is done in qemuProcessSetupVcpu() which is also the function that's called

[PATCH v4 3/8] qemu_conf: Introduce a knob to set SCHED_CORE

2022-08-24 Thread Michal Privoznik
Ideally, we would just pick the best default and users wouldn't have to intervene at all. But in some cases it may be handy to not bother with SCHED_CORE at all or place helper processes into the same group as QEMU. Introduce a knob in qemu.conf to allow users control this behaviour.

[PATCH v4 4/8] qemu_domain: Introduce qemuDomainSchedCoreStart()

2022-08-24 Thread Michal Privoznik
The aim of this helper function is to spawn a child process in which new scheduling group is created. This dummy process will then used to distribute scheduling group from (e.g. when starting helper processes or QEMU itself). The process is not needed for QEMU_SCHED_CORE_NONE case (obviously) nor

[PATCH v4 7/8] qemu: Enable SCHED_CORE for vCPUs

2022-08-24 Thread Michal Privoznik
For QEMU_SCHED_CORE_VCPUS case, the vCPU threads should be placed all into one scheduling group, but not the emulator or any of its threads. Therefore, as soon as vCPU TIDs are detected, fork off a child which then creates a separate scheduling group and adds all vCPU threads into it. Please

[PATCH v4 0/8] qemu: Enable SCHED_CORE for domains and helper processes

2022-08-24 Thread Michal Privoznik
v4 of: https://listman.redhat.com/archives/libvir-list/2022-August/233683.html diff to v3: - Fixed wording in qemu.conf, - Removed dead code in qemuProcessSetupVcpuSchedCoreHelper(), - Made the dummy child process (qemuDomainSchedCoreStart()) exit early, instead of jumping onto error label.

[PATCH v4 1/8] virprocess: Core Scheduling support

2022-08-24 Thread Michal Privoznik
Since its 5.14 release the Linux kernel allows userspace to define trusted groups of processes/threads that can run on sibling Hyper Threads (HT) at the same time. This is to mitigate side channel attacks like L1TF or MDS. If there are no tasks to fully utilize all HTs, then a HT will idle instead

[PATCH v4 2/8] virCommand: Introduce APIs for core scheduling

2022-08-24 Thread Michal Privoznik
There are two modes of core scheduling that are handy wrt virCommand: 1) create new trusted group when executing a virCommand 2) place freshly executed virCommand into the trusted group of another process. Therefore, implement these two new operations as new APIs: virCommandSetRunAlone() and

Re: [libvirt PATCH] nodedev: wait a bit longer for new node devices

2022-08-24 Thread Erik Skultety
On Tue, Aug 23, 2022 at 12:43:03PM -0500, Jonathon Jongsma wrote: > Openstack developers reported that newly-created mdevs were not > recognized by libvirt until after a libvirt daemon restart. The source > of the problem appears to be that when libvirt gets the udev 'add' > event, the sysfs tree

Re: [libvirt PATCH v2 2/2] nwfilter: Fix timeout data type reported by coverity

2022-08-24 Thread Erik Skultety
On Tue, Aug 23, 2022 at 06:43:26PM +0200, Peter Krempa wrote: > On Tue, Aug 23, 2022 at 18:22:37 +0200, Erik Skultety wrote: > > Coverity reports: > > virNWFilterSnoopIPLeaseUpdate(virNWFilterSnoopIPLease *ipl, > > time_t timeout) > > { > > if