[PATCH] qemu: Don't report error from domblkinfo if vm is inactive

2022-09-05 Thread huangy81
From: Hyman Huang(黄勇) Libvirt logs and reports error when executing domblkinfo if vm configured rbd storage and in inactive state. The steps to reproduce the problem: 1. define and start domain with its storage configured rbd disk, and corresponding disk label is 'vda'. 2. set vm in inactive

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

2022-09-05 Thread Kristina Hanicova
On Mon, Sep 5, 2022 at 6:21 PM Ján Tomko wrote: > On a Monday in 2022, Kristina Hanicova wrote: > >This patch removes virCHDomainObjBeginJob() and replaces it with > >call to the generalized virDomainObjBeginJob(). > > > >Signed-off-by: Kristina Hanicova > >--- > > src/ch/ch_domain.c | 51

Re: [PATCH v2 00/17] jobs: finish generalization

2022-09-05 Thread Ján Tomko
On a Monday in 2022, Kristina Hanicova wrote: v1 here: https://listman.redhat.com/archives/libvir-list/2022-August/233908.html diff to v1: * changes in the first commit: typo, currentAPI in warning I forgot to move and renamed VIR_FROM_HYPERV to VIR_FROM_NONE as Jano suggested Kristina

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

2022-09-05 Thread Ján Tomko
On a Monday in 2022, Kristina Hanicova wrote: 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

[(pushed) PATCH] tests: qemuxml2argvdata: Remove two unused output files

2022-09-05 Thread Peter Krempa
Commit d7ae7ce363aa51ab46 forgot to clean up unused error output files 'boot-dev+order.err' and 'boot-menu-enable-with-timeout-invalid' after converting tests to DO_TEST_CAPS_LATEST. Fixes: d7ae7ce363aa51ab4600261b5934075388843142 Signed-off-by: Peter Krempa --- Pushed as trivial.

Re: [libvirt PATCH 12/12] qemu: do not probe for properties of nec-usb-xhci

2022-09-05 Thread Peter Krempa
On Thu, Aug 25, 2022 at 17:59:35 +0200, Ján Tomko wrote: > Signed-off-by: Ján Tomko > --- Hopefully we will not need to probe any other property. Reviewed-by: Peter Krempa

Re: [libvirt PATCH 11/12] qemu: remove qemuValidateDomainVirtioOptions

2022-09-05 Thread Peter Krempa
On Thu, Aug 25, 2022 at 17:59:34 +0200, Ján Tomko wrote: > Now that we assume all the virtio capabilities, this function does not > check anything. > > Signed-off-by: Ján Tomko > --- > src/qemu/qemu_validate.c | 54 +++- > 1 file changed, 4 insertions(+), 50

Re: [libvirt PATCH 10/12] qemu: retire QEMU_CAPS_VIRTIO_PACKED_QUEUES

2022-09-05 Thread Peter Krempa
On Thu, Aug 25, 2022 at 17:59:33 +0200, Ján Tomko wrote: > Signed-off-by: Ján Tomko > --- Reviewed-by: Peter Krempa

Re: [libvirt PATCH 09/12] qemu: assume QEMU_CAPS_VIRTIO_PACKED_QUEUES

2022-09-05 Thread Peter Krempa
On Thu, Aug 25, 2022 at 17:59:32 +0200, Ján Tomko wrote: > Added by QEMU commit: > > commit 74b3e46630446568aecb0be1c77c4875d7a52f6d > Author: Jason Wang > CommitDate: 2019-10-25 07:46:22 -0400 > > virtio: add property to enable packed virtqueue > > Signed-off-by: Jason Wang >

Re: [libvirt PATCH 08/12] qemu: retire QEMU_CAPS_VIRTIO_SCSI_IOTHREAD

2022-09-05 Thread Peter Krempa
On Thu, Aug 25, 2022 at 17:59:31 +0200, Ján Tomko wrote: > Signed-off-by: Ján Tomko > --- Reviewed-by: Peter Krempa

Re: [libvirt PATCH 07/12] qemu: assume QEMU_CAPS_VIRTIO_SCSI_IOTHREAD

2022-09-05 Thread Peter Krempa
On Thu, Aug 25, 2022 at 17:59:30 +0200, Ján Tomko wrote: > All the supported QEMU versions should have iothread support > on the virtio-scsi controllers if they are compiled in. > > Signed-off-by: Ján Tomko > --- > src/qemu/qemu_process.c | 16 > 1 file changed, 16 deletions(-)

Re: [libvirt PATCH 06/12] qemu: retire QEMU_CAPS_NEC_USB_XHCI_PORTS

2022-09-05 Thread Peter Krempa
On Thu, Aug 25, 2022 at 17:59:29 +0200, Ján Tomko wrote: > Signed-off-by: Ján Tomko > --- Reviewed-by: Peter Krempa

Re: [libvirt PATCH 05/12] qemu: assume QEMU_CAPS_NEC_USB_XHCI_PORTS

2022-09-05 Thread Peter Krempa
On Thu, Aug 25, 2022 at 17:59:28 +0200, Ján Tomko wrote: > Introduced by QEMU commit 91062ae00fd4a88a40c28288e8ac7fe50ee83adf > released in QEMU 1.3.0 The release is correct, but the 'p3' property was added by 0846e6359c4. > > Signed-off-by: Ján Tomko > --- > src/qemu/qemu_command.c | 3 +--

Re: [libvirt PATCH 04/12] qemu: retire QEMU_CAPS_CHARDEV_LOGFILE

2022-09-05 Thread Peter Krempa
On Thu, Aug 25, 2022 at 17:59:27 +0200, Ján Tomko wrote: > Signed-off-by: Ján Tomko > --- Reviewed-by: Peter Krempa

Re: [libvirt PATCH 03/12] qemu: assume QEMU_CAPS_CHARDEV_LOGFILE

2022-09-05 Thread Peter Krempa
On Thu, Aug 25, 2022 at 17:59:26 +0200, Ján Tomko wrote: > Introduced in QEMU 2.6 > > Signed-off-by: Ján Tomko > --- Reviewed-by: Peter Krempa

Re: [libvirt PATCH 02/12] qemu: retire QEMU_CAPS_CHARDEV_FILE_APPEND

2022-09-05 Thread Peter Krempa
On Thu, Aug 25, 2022 at 17:59:25 +0200, Ján Tomko wrote: > Signed-off-by: Ján Tomko > --- Reviewed-by: Peter Krempa

Re: [libvirt PATCH 01/12] qemu: assume QEMU_CAPS_CHARDEV_FILE_APPEND

2022-09-05 Thread Peter Krempa
On Thu, Aug 25, 2022 at 17:59:24 +0200, Ján Tomko wrote: > Introduced in QEMU 2.6 > > Signed-off-by: Ján Tomko > --- > src/qemu/qemu_process.c | 5 + > src/qemu/qemu_validate.c | 10 +- > tests/qemuxml2argvtest.c | 4 +--- > 3 files changed, 3 insertions(+), 16 deletions(-)

[PATCH 2/2] kbase: Document QEMU private mount NS limitations

2022-09-05 Thread Michal Privoznik
There are two points I've taken for granted: 1) the mount points are set before starting a guest, 2) the / and its submounts are marked as shared, so that mount events propagate into child namespaces when assumption 1) is not held. But what's obvious to me might not be obvious to

[PATCH 1/2] qemu_process: Don't require a hugetlbfs mount for memfd

2022-09-05 Thread Michal Privoznik
The aim of qemuProcessNeedHugepagesPath() is to determine whether a hugetlbfs mount point is required for given domain (as in whether qemuBuildMemoryBackendProps() picks up memory-backend-file pointing to a hugetlbfs mount point). Well, when domain is configured to use memfd backend then that

[PATCH 0/2] qemu: Two improvements wrt mount namespaces

2022-09-05 Thread Michal Privoznik
While investigating a bug (which I believe is just a misconfiguration; linked in 2/2) I've found a problem with memfd (patch 1/2). Michal Prívozník (2): qemu_process: Don't require a hugetlbfs mount for memfd kbase: Document QEMU private mount NS limitations

Re: [PATCH 0/7] Clean up virFileIsSharedFSType

2022-09-05 Thread Ján Tomko
On a Monday in 2022, Peter Krempa wrote: Few cleanups for problems I've noticed when I had to understand how the shared FS detection is supposed to work. Peter Krempa (7): util: virFileIsSharedFSType: Pass bitmap of checked fs types as unsigned util: virFileIsSharedFSType: Annotate (some)

Re: [PATCH 6/7] util: virfile: Drop QB_MAGIC constant

2022-09-05 Thread Ján Tomko
On a Monday in 2022, Peter Krempa wrote: The filesystem type magic constant was added for the 'quobyte' shared filesystem in commit 451094bd153 but is present neither in the kernel sources nor in coreutils which we've historically used as source of information. I'm afraid the constant is some

Re: [PATCH 1/7] util: virFileIsSharedFSType: Pass bitmap of checked fs types as unsigned

2022-09-05 Thread Ján Tomko
On a Monday in 2022, Peter Krempa wrote: We populate the bits individualy so unsigned is the proper type. *individually Signed-off-by: Peter Krempa --- src/util/virfile.c | 4 ++-- src/util/virfile.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) Reviewed-by: Ján Tomko Jano

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

2022-09-05 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 v2 13/17] LXC: use virDomainObjEndJob()

2022-09-05 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 v2 16/17] qemu & conf: move BeginAsyncJob & EndAsyncJob into src/conf

2022-09-05 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 v2 07/17] qemu: use virDomainObjBeginJob()

2022-09-05 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 v2 17/17] qemu & conf: move BeginNestedJob & BeginJobNowait into src/conf

2022-09-05 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 v2 10/17] CH: use virDomainObjBeginJob()

2022-09-05 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 +-

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

2022-09-05 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 v2 05/17] conf: extend xmlopt with job config & add job object into domain object

2022-09-05 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 v2 09/17] LXC: use virDomainObjBeginJob()

2022-09-05 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 v2 08/17] libxl: use virDomainObjBeginJob()

2022-09-05 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 v2 11/17] qemu: use virDomainObjEndJob()

2022-09-05 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 v2 02/17] libxl: remove usage of virDomainJobData

2022-09-05 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 v2 06/17] virdomainjob: make drivers use job object in the domain object

2022-09-05 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 v2 03/17] move files: hypervisor/domain_job -> conf/virdomainjob

2022-09-05 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

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

2022-09-05 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 v2 04/17] virdomainjob: add check for callbacks

2022-09-05 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 v2 01/17] qemu & hypervisor: move qemuDomainObjBeginJobInternal() into hypervisor

2022-09-05 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 | 251

[PATCH v2 00/17] jobs: finish generalization

2022-09-05 Thread Kristina Hanicova
v1 here: https://listman.redhat.com/archives/libvir-list/2022-August/233908.html diff to v1: * changes in the first commit: typo, currentAPI in warning I forgot to move and renamed VIR_FROM_HYPERV to VIR_FROM_NONE as Jano suggested Kristina Hanicova (17): qemu & hypervisor: move

[PATCH 7/7] util: virFileIsSharedFSType: Simplify shared fs type declarations

2022-09-05 Thread Peter Krempa
Use approach similar to virFileIsSharedFsFUSE to declaratively handle the filesystem magic numbers mapping to libvirt's fstypes. Signed-off-by: Peter Krempa --- src/util/virfile.c | 48 +++--- 1 file changed, 20 insertions(+), 28 deletions(-) diff --git

[PATCH 6/7] util: virfile: Drop QB_MAGIC constant

2022-09-05 Thread Peter Krempa
The filesystem type magic constant was added for the 'quobyte' shared filesystem in commit 451094bd153 but is present neither in the kernel sources nor in coreutils which we've historically used as source of information. Since the code dealing with FUSE-based filesystems doesn't need the constand

[PATCH 3/7] util: virFileIsSharedFixFUSE: Refactor cleanup

2022-09-05 Thread Peter Krempa
Automatically free memory of 'canonPath' so that the failure of 'setmntent' doesn't have to go to 'cleanup'. This allows us to remove the cleanup section and the 'ret' variable as the rest of the function can't fail. Signed-off-by: Peter Krempa --- src/util/virfile.c | 21 +++--

[PATCH 4/7] util: virfile: Rewrite matching of FUSE-based shared filesystems

2022-09-05 Thread Peter Krempa
'virFileIsSharedFixFUSE' was used to update the 'f_type' field for certain shared filesystem types. This patch renames it to 'virFileIsSharedFsFUSE' and makes it directly return whether the FUSE filesystem is shared or not and simplifies additions to the list of shared FUSE filesystems.

[PATCH 5/7] util: virfile: Don't use VIR_FILE_SHFS_GFS2 for glusterfs

2022-09-05 Thread Peter Krempa
While the code works properly as no code path is specifically wanting to check for glusterfs, we should properly declare glusterfs as a separate from GFS2. Fixes: 478da65fb46 Signed-off-by: Peter Krempa --- src/util/virfile.c | 8 +--- src/util/virfile.h | 1 + 2 files changed, 6

[PATCH 1/7] util: virFileIsSharedFSType: Pass bitmap of checked fs types as unsigned

2022-09-05 Thread Peter Krempa
We populate the bits individualy so unsigned is the proper type. Signed-off-by: Peter Krempa --- src/util/virfile.c | 4 ++-- src/util/virfile.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util/virfile.c b/src/util/virfile.c index ce541b8946..1def05b6c4 100644 ---

[PATCH 2/7] util: virFileIsSharedFSType: Annotate (some) shared filesystem names

2022-09-05 Thread Peter Krempa
Expand some of the uncommon or unobvious filesystem names in a comment. Signed-off-by: Peter Krempa --- src/util/virfile.h | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/util/virfile.h b/src/util/virfile.h index 8d6df034f8..c4d11ea21a 100644 ---

[PATCH 0/7] Clean up virFileIsSharedFSType

2022-09-05 Thread Peter Krempa
Few cleanups for problems I've noticed when I had to understand how the shared FS detection is supposed to work. Peter Krempa (7): util: virFileIsSharedFSType: Pass bitmap of checked fs types as unsigned util: virFileIsSharedFSType: Annotate (some) shared filesystem names util:

Re: [PATCH 0/2] Implement qemuDomainGetStatsCpu fallback for qemu:///session

2022-09-05 Thread Ján Tomko
On a Monday in 2022, Michal Privoznik wrote: *** BLURB HERE *** Michal Prívozník (2): util: Extend virProcessGetStatInfo() for sysTime and userTime qemu: Implement qemuDomainGetStatsCpu fallback for qemu:///session src/ch/ch_driver.c | 1 + src/qemu/qemu_driver.c | 39

Re: [PATCH 1/2] util: Extend virProcessGetStatInfo() for sysTime and userTime

2022-09-05 Thread Ján Tomko
On a Monday in 2022, Michal Privoznik wrote: The virProcessGetStatInfo() helper parses /proc stat file for given PID and/or TID and reports cumulative cpuTime which is just a sum of user and sys times. But in near future, we'll need those times separately, so make the function return them too

[PATCH 0/2] Implement qemuDomainGetStatsCpu fallback for qemu:///session

2022-09-05 Thread Michal Privoznik
*** BLURB HERE *** Michal Prívozník (2): util: Extend virProcessGetStatInfo() for sysTime and userTime qemu: Implement qemuDomainGetStatsCpu fallback for qemu:///session src/ch/ch_driver.c | 1 + src/qemu/qemu_driver.c | 39 --- src/util/virprocess.c

[PATCH 2/2] qemu: Implement qemuDomainGetStatsCpu fallback for qemu:///session

2022-09-05 Thread Michal Privoznik
For domains started under session URI, we don't set up CGroups (well, how could we since we're not running as root anyways). Nevertheless, fetching CPU statistics exits early because of lacking cpuacct controller. But with recent extension to virProcessGetStatInfo() we can get the values we need

[PATCH 1/2] util: Extend virProcessGetStatInfo() for sysTime and userTime

2022-09-05 Thread Michal Privoznik
The virProcessGetStatInfo() helper parses /proc stat file for given PID and/or TID and reports cumulative cpuTime which is just a sum of user and sys times. But in near future, we'll need those times separately, so make the function return them too (if caller desires). Signed-off-by: Michal