Re: [PATCH] remote: Add libvirtd dependency to virt-guest-shutdown.target

2021-01-28 Thread Jim Fehlig
On 1/27/21 12:58 AM, Christian Ehrhardt wrote: On Wed, Nov 4, 2020 at 7:47 AM Neal Gompa wrote: On Tue, Nov 3, 2020 at 9:26 PM Jim Fehlig wrote: When restarting libvirt services and sockets *and* libvirt-guests.service is running, the latter will sometimes hang when trying to connect to

[PATCH] Revert "remote: Add libvirtd dependency to virt-guest-shutdown.target"

2021-01-28 Thread Jim Fehlig
Further testing revealed commit f035f53baa regresses Debian bug 955216 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=955216 Restarting libvirt-guests on libvirtd restart is worse than the original dependency issue, so revert the commit until a better solution is found. This reverts commit

Re: [libvirt PATCH v3 00/21] Add support for persistent mediated devices

2021-01-28 Thread Jonathon Jongsma
On Thu, 7 Jan 2021 17:43:54 +0100 Erik Skultety wrote: > > > > 4.Define a mdev device with the uuid specified, but the mdev device > > defined seems using another uuid. Maybe it make a little confusion > > about the use of uuid in the xml: > > #cat mdev.xml > > > >

Re: [libvirt PATCH 0/7] Add boot order to virtiofs

2021-01-28 Thread Michal Privoznik
On 1/28/21 4:15 PM, Ján Tomko wrote: Sadly, the replies changes for older QEMUs are synthetic. Separated for easier review. Also available on gitlab: git fetch https://gitlab.com/janotomko/libvirt/ virtiofs-bootindex https://gitlab.com/janotomko/libvirt/-/tree/virtiofs-bootindex And a broken

Re: [libvirt PATCH 0/7] Add boot order to virtiofs

2021-01-28 Thread Laszlo Ersek
On 01/28/21 16:15, Ján Tomko wrote: > Sadly, the replies changes for older QEMUs are synthetic. > Separated for easier review. > > Also available on gitlab: > git fetch https://gitlab.com/janotomko/libvirt/ virtiofs-bootindex > https://gitlab.com/janotomko/libvirt/-/tree/virtiofs-bootindex > >

[libvirt PATCH 2/7] conf: add boot order to filesystem

2021-01-28 Thread Ján Tomko
Signed-off-by: Ján Tomko --- docs/schemas/domaincommon.rng | 3 +++ src/conf/domain_conf.c | 5 +++-- tests/qemuxml2argvdata/vhost-user-fs-hugepages.xml | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git

[libvirt PATCH 6/7] Add validation for virtiofs boot order setting

2021-01-28 Thread Ján Tomko
Signed-off-by: Ján Tomko --- src/conf/domain_validate.c | 17 - src/qemu/qemu_validate.c | 6 ++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c index 649fc335ac..404eee09a9 100644 ---

[libvirt PATCH 4/7] fixup: vhost-user-fs-device properties

2021-01-28 Thread Ján Tomko
--- .../caps_4.2.0.aarch64.replies| 79 + .../caps_4.2.0.s390x.replies | 79 + .../caps_4.2.0.x86_64.replies | 79 + .../caps_5.0.0.aarch64.replies| 84 ++

[libvirt PATCH 1/7] tests: switch vhost-user-fs-hugepages to use boot order

2021-01-28 Thread Ján Tomko
Signed-off-by: Ján Tomko --- tests/qemuxml2argvdata/vhost-user-fs-hugepages.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemuxml2argvdata/vhost-user-fs-hugepages.xml b/tests/qemuxml2argvdata/vhost-user-fs-hugepages.xml index 96b9774704..e9982150c7 100644 ---

[libvirt PATCH 0/7] Add boot order to virtiofs

2021-01-28 Thread Ján Tomko
Sadly, the replies changes for older QEMUs are synthetic. Separated for easier review. Also available on gitlab: git fetch https://gitlab.com/janotomko/libvirt/ virtiofs-bootindex https://gitlab.com/janotomko/libvirt/-/tree/virtiofs-bootindex And a broken pipeline:

[libvirt PATCH 7/7] qemu: format bootindex for vhost-user-fs

2021-01-28 Thread Ján Tomko
Wire up the QEMU command line for this option. Signed-off-by: Ján Tomko --- src/qemu/qemu_command.c| 3 +++ .../vhost-user-fs-hugepages.x86_64-latest.args | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git

[libvirt PATCH 5/7] fixup: renumber

2021-01-28 Thread Ján Tomko
--- .../caps_4.2.0.aarch64.replies| 56 +-- .../caps_4.2.0.s390x.replies | 44 +++ .../caps_4.2.0.x86_64.replies | 56 +-- .../caps_5.0.0.aarch64.replies| 56 +--

[libvirt PATCH 3/7] qemu: add QEMU_CAPS_VHOST_USER_FS_BOOTINDEX

2021-01-28 Thread Ján Tomko
Introduced by QEMU commit: commit 6da32fe5efdd71c9d254a436ce972194ff631285 Author: Laszlo Ersek AuthorDate: 2021-01-12 14:16:03 +0100 Commit: Michael S. Tsirkin CommitDate: 2021-01-13 09:06:37 -0500 vhost-user-fs: add the "bootindex" property Signed-off-by: Ján Tomko ---

Re: [libvirt PATCH 10/11] vircommand: Remove NULL check in virCommandAddArg

2021-01-28 Thread Tim Wiederhake
On Thu, 2021-01-28 at 11:54 +0100, Peter Krempa wrote: > On Thu, Jan 28, 2021 at 11:24:40 +0100, Tim Wiederhake wrote: > > `val` is declared `ATTRIBUTE_NONNULL`. > > Please see: > > https://gitlab.com/libvirt/libvirt/-/blob/master/src/internal.h#L127 > > ATTRIBUTE_NONNULL is unfortunately lead

Re: [libvirt PATCH 00/11] Random bits found by clang-tidy

2021-01-28 Thread Tim Wiederhake
On Thu, 2021-01-28 at 10:35 +, Daniel P. Berrangé wrote: > On Thu, Jan 28, 2021 at 11:24:30AM +0100, Tim Wiederhake wrote: > > clang-tidy is a static code analysis tool under the llvm umbrella. > > It is > > primarily meant to be used on C++ code bases, but some of the > > checks it > >

[PATCH 3/3] conf: Improve virDomainVirtioOptionsCheckABIStability()

2021-01-28 Thread Michal Privoznik
The virDomainVirtioOptionsCheckABIStability() function is called from various ABI stability check functions. Every caller checks if both old and new definitions have virtio options set and only after that they call the function. This is suboptimal because: a) this check can be done in the

[PATCH 2/3] conf: Drop empty virDomainNetDefPostParse()

2021-01-28 Thread Michal Privoznik
The previous commit rendered this function empty and needless. Remove it. Signed-off-by: Michal Privoznik --- src/conf/domain_conf.c | 12 +--- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 69ebd5d66d..6e90b8e180

[PATCH 1/3] conf: Move virDomainCheckVirtioOptions() into domain_validate.c

2021-01-28 Thread Michal Privoznik
The aim of virDomainCheckVirtioOptions() function is to check whether no virtio options are set, i.e. no @iommu no @ats and no @packed attributes were present in given device's XML (yeah, the function has very misleading name). Nevertheless, this kind of check belongs to validation phase, but now

[PATCH 0/3] conf: Couple of virtio options related improvements

2021-01-28 Thread Michal Privoznik
I've noticed these while reviewing Boris' patch: https://www.redhat.com/archives/libvir-list/2021-January/msg01149.html Michal Prívozník (3): conf: Move virDomainCheckVirtioOptions() into domain_validate.c conf: Drop empty virDomainNetDefPostParse() conf: Improve

Re: [libvirt PATCH 06/11] udevGetIntSysfsAttr: Return -1 for missing attributes

2021-01-28 Thread Daniel P . Berrangé
On Thu, Jan 28, 2021 at 02:03:25PM +0100, Michal Privoznik wrote: > On 1/28/21 1:47 PM, Daniel P. Berrangé wrote: > > On Thu, Jan 28, 2021 at 01:18:07PM +0100, Michal Privoznik wrote: > > > On 1/28/21 11:44 AM, Peter Krempa wrote: > > > > On Thu, Jan 28, 2021 at 11:24:36 +0100, Tim Wiederhake

Re: [libvirt PATCH 06/11] udevGetIntSysfsAttr: Return -1 for missing attributes

2021-01-28 Thread Michal Privoznik
On 1/28/21 1:47 PM, Daniel P. Berrangé wrote: On Thu, Jan 28, 2021 at 01:18:07PM +0100, Michal Privoznik wrote: On 1/28/21 11:44 AM, Peter Krempa wrote: On Thu, Jan 28, 2021 at 11:24:36 +0100, Tim Wiederhake wrote: If "udevGetDeviceSysfsAttr()" returns NULL, "udevGetIntSysfsAttr" would return

Re: [libvirt PATCH 06/11] udevGetIntSysfsAttr: Return -1 for missing attributes

2021-01-28 Thread Daniel P . Berrangé
On Thu, Jan 28, 2021 at 01:18:07PM +0100, Michal Privoznik wrote: > On 1/28/21 11:44 AM, Peter Krempa wrote: > > On Thu, Jan 28, 2021 at 11:24:36 +0100, Tim Wiederhake wrote: > > > If "udevGetDeviceSysfsAttr()" returns NULL, "udevGetIntSysfsAttr" > > > would return "0", indicating success, without

Re: [PATCH] qemu: Add virtio related options to vsock

2021-01-28 Thread Michal Privoznik
On 1/27/21 7:46 PM, Boris Fiuczynski wrote: Add virtio related options iommu, ats and packed as driver element attributes to vsock devices. Ex: Signed-off-by: Boris Fiuczynski --- docs/formatdomain.rst | 2 + docs/schemas/domaincommon.rng

Re: [libvirt PATCH 06/11] udevGetIntSysfsAttr: Return -1 for missing attributes

2021-01-28 Thread Tim Wiederhake
On Thu, 2021-01-28 at 11:44 +0100, Peter Krempa wrote: > On Thu, Jan 28, 2021 at 11:24:36 +0100, Tim Wiederhake wrote: > > If "udevGetDeviceSysfsAttr()" returns NULL, "udevGetIntSysfsAttr" > > would return "0", indicating success, without writing to "value". > > > > This was found by clang-tidy's

Re: [libvirt PATCH 06/11] udevGetIntSysfsAttr: Return -1 for missing attributes

2021-01-28 Thread Michal Privoznik
On 1/28/21 11:44 AM, Peter Krempa wrote: On Thu, Jan 28, 2021 at 11:24:36 +0100, Tim Wiederhake wrote: If "udevGetDeviceSysfsAttr()" returns NULL, "udevGetIntSysfsAttr" would return "0", indicating success, without writing to "value". This was found by clang-tidy's

Re: failed to start vm after add vsock device

2021-01-28 Thread Michal Privoznik
On 1/28/21 12:08 PM, longguang.yue wrote: Michal, thanks. i have another question which is related to kata-container. when there is only one  virtiofs-device , how does it do that   in guest there are 4 times of virtiofs-mounts that have same src and different targets. # in guest [root@kvm

Re: [libvirt PATCH 05/11] Replace bzero() with memset()

2021-01-28 Thread Peter Krempa
On Thu, Jan 28, 2021 at 10:59:41 +, Daniel Berrange wrote: > On Thu, Jan 28, 2021 at 11:45:07AM +0100, Peter Krempa wrote: > > On Thu, Jan 28, 2021 at 11:24:35 +0100, Tim Wiederhake wrote: > > > This was found by clang-tidy's > > > "clang-analyzer-security.insecureAPI.bzero" check. > > > >

Re: [libvirt PATCH 00/11] Random bits found by clang-tidy

2021-01-28 Thread Peter Krempa
On Thu, Jan 28, 2021 at 11:24:30 +0100, Tim Wiederhake wrote: [...] > Tim Wiederhake (11): > virfile: Remove redundant #ifndef > xen: Fix indentation in xenParseXLSpice > qemu_tpm: Fix indentation in qemuTPMEmulatorBuildCommand > virsh-domain: Fix error handling of pthread_sigmask >

Re: [libvirt PATCH 05/11] Replace bzero() with memset()

2021-01-28 Thread Daniel P . Berrangé
On Thu, Jan 28, 2021 at 12:03:36PM +0100, Peter Krempa wrote: > On Thu, Jan 28, 2021 at 10:59:41 +, Daniel Berrange wrote: > > On Thu, Jan 28, 2021 at 11:45:07AM +0100, Peter Krempa wrote: > > > On Thu, Jan 28, 2021 at 11:24:35 +0100, Tim Wiederhake wrote: > > > > This was found by

Re:Re: failed to start vm after add vsock device

2021-01-28 Thread longguang.yue
Michal, thanks. i have another question which is related to kata-container. when there is only one  virtiofs-device , how does it do that   in guest there are 4 times of virtiofs-mounts that have same src and different targets. # in guest [root@kvm kata-containers]# docker exec

Re: [libvirt PATCH 05/11] Replace bzero() with memset()

2021-01-28 Thread Daniel P . Berrangé
On Thu, Jan 28, 2021 at 11:45:07AM +0100, Peter Krempa wrote: > On Thu, Jan 28, 2021 at 11:24:35 +0100, Tim Wiederhake wrote: > > This was found by clang-tidy's > > "clang-analyzer-security.insecureAPI.bzero" check. > > Any reasoning behind why bzero is bad? Yeah, it is wierd to call this an

Re: [libvirt PATCH 10/11] vircommand: Remove NULL check in virCommandAddArg

2021-01-28 Thread Peter Krempa
On Thu, Jan 28, 2021 at 11:24:40 +0100, Tim Wiederhake wrote: > `val` is declared `ATTRIBUTE_NONNULL`. Please see: https://gitlab.com/libvirt/libvirt/-/blob/master/src/internal.h#L127 ATTRIBUTE_NONNULL is unfortunately lead to wrong optimizations done by gcc. > Found by clang-tidy's

Re: [libvirt PATCH 05/11] Replace bzero() with memset()

2021-01-28 Thread Peter Krempa
On Thu, Jan 28, 2021 at 11:24:35 +0100, Tim Wiederhake wrote: > This was found by clang-tidy's > "clang-analyzer-security.insecureAPI.bzero" check. Any reasoning behind why bzero is bad? > > Signed-off-by: Tim Wiederhake > --- > src/util/virarptable.c | 2 +- > tests/virpcimock.c | 2 +-

Re: [libvirt PATCH 08/11] tests: Prevent malloc with size 0

2021-01-28 Thread Peter Krempa
On Thu, Jan 28, 2021 at 11:24:38 +0100, Tim Wiederhake wrote: > Found by clang-tidy's "clang-analyzer-optin.portability.UnixAPI" check. > > Signed-off-by: Tim Wiederhake > --- > tests/commandhelper.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tests/commandhelper.c

Re: [libvirt PATCH 06/11] udevGetIntSysfsAttr: Return -1 for missing attributes

2021-01-28 Thread Peter Krempa
On Thu, Jan 28, 2021 at 11:24:36 +0100, Tim Wiederhake wrote: > If "udevGetDeviceSysfsAttr()" returns NULL, "udevGetIntSysfsAttr" > would return "0", indicating success, without writing to "value". > > This was found by clang-tidy's > "clang-analyzer-core.UndefinedBinaryOperatorResult" check in >

Re: [libvirt PATCH 00/11] Random bits found by clang-tidy

2021-01-28 Thread Daniel P . Berrangé
On Thu, Jan 28, 2021 at 11:24:30AM +0100, Tim Wiederhake wrote: > clang-tidy is a static code analysis tool under the llvm umbrella. It is > primarily meant to be used on C++ code bases, but some of the checks it > provides also apply to C. > > The findings vary in severity and contain

[libvirt PATCH 10/11] vircommand: Remove NULL check in virCommandAddArg

2021-01-28 Thread Tim Wiederhake
`val` is declared `ATTRIBUTE_NONNULL`. Found by clang-tidy's "clang-diagnostic-tautological-pointer-compare" check. Signed-off-by: Tim Wiederhake --- src/util/vircommand.c | 5 - 1 file changed, 5 deletions(-) diff --git a/src/util/vircommand.c b/src/util/vircommand.c index

[libvirt PATCH 11/11] vircommand: Simplify virCommandAddArg

2021-01-28 Thread Tim Wiederhake
Signed-off-by: Tim Wiederhake --- src/util/vircommand.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/util/vircommand.c b/src/util/vircommand.c index 223010c6aa..f83d49ffac 100644 --- a/src/util/vircommand.c +++ b/src/util/vircommand.c @@ -1520,21 +1520,16 @@

[libvirt PATCH 08/11] tests: Prevent malloc with size 0

2021-01-28 Thread Tim Wiederhake
Found by clang-tidy's "clang-analyzer-optin.portability.UnixAPI" check. Signed-off-by: Tim Wiederhake --- tests/commandhelper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/commandhelper.c b/tests/commandhelper.c index ba5681b715..9394a42726 100644 ---

[libvirt PATCH 05/11] Replace bzero() with memset()

2021-01-28 Thread Tim Wiederhake
This was found by clang-tidy's "clang-analyzer-security.insecureAPI.bzero" check. Signed-off-by: Tim Wiederhake --- src/util/virarptable.c | 2 +- tests/virpcimock.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/virarptable.c b/src/util/virarptable.c index

[libvirt PATCH 03/11] qemu_tpm: Fix indentation in qemuTPMEmulatorBuildCommand

2021-01-28 Thread Tim Wiederhake
This was found by clang-tidy's "readability-misleading-indentation" check. Signed-off-by: Tim Wiederhake --- src/qemu/qemu_tpm.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_tpm.c b/src/qemu/qemu_tpm.c index 532e0912bd..f94cad8230 100644 ---

[libvirt PATCH 07/11] virhostuptime: Fix rounding in uptime calculation

2021-01-28 Thread Tim Wiederhake
"f + 0.5" does not round correctly for values very close to ".5" for every integer multiple, e.g. "0.49975". Found by clang-tidy's "bugprone-incorrect-roundings" check. Signed-off-by: Tim Wiederhake --- src/util/virhostuptime.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff

[libvirt PATCH 06/11] udevGetIntSysfsAttr: Return -1 for missing attributes

2021-01-28 Thread Tim Wiederhake
If "udevGetDeviceSysfsAttr()" returns NULL, "udevGetIntSysfsAttr" would return "0", indicating success, without writing to "value". This was found by clang-tidy's "clang-analyzer-core.UndefinedBinaryOperatorResult" check in function "udevProcessCCW", flagging a read on the potentially

[libvirt PATCH 04/11] virsh-domain: Fix error handling of pthread_sigmask

2021-01-28 Thread Tim Wiederhake
pthread_sigmask() returns 0 on success and "a non-zero value on failure", but not neccessarily a negative one. Found by clang-tidy's "bugprone-posix-return" check. Signed-off-by: Tim Wiederhake --- tools/virsh-domain.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git

[libvirt PATCH 09/11] vircryptotest: Directly assign string to avoid memcpy

2021-01-28 Thread Tim Wiederhake
Found by clang-tidy's "bugprone-not-null-terminated-result" check. clang-tidy's finding is a false positive in this case, as the memset call guarantees null termination. The assignment can be simplified though, and this happens to silence the warning. Signed-off-by: Tim Wiederhake ---

Re: [RFC] Change default ipv6 network from fec0/10 (site local) to fe80/10 (link local)

2021-01-28 Thread Samuel Thibault
Hello, Philippe Mathieu-Daudé, le mer. 27 janv. 2021 22:46:13 +0100, a ecrit: > On 1/27/21 8:13 PM, Doug Evans wrote: > > I happened to notice QEMU's default for the ipv6 network is fec0::/10 > > which is deprecated (RFC3879). > > I think(!) an obvious replacement is fe80::/10, link local.

[libvirt PATCH 02/11] xen: Fix indentation in xenParseXLSpice

2021-01-28 Thread Tim Wiederhake
This was found by clang-tidy's "readability-misleading-indentation" check. Signed-off-by: Tim Wiederhake --- src/libxl/xen_xl.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/libxl/xen_xl.c b/src/libxl/xen_xl.c index 621ee63a99..6dcba43fe0 100644 ---

[libvirt PATCH 01/11] virfile: Remove redundant #ifndef

2021-01-28 Thread Tim Wiederhake
This section is guarded by "#ifndef WIN32" in line 2109--2808. Found by clang-tidy's "readability-redundant-preprocessor" check. Signed-off-by: Tim Wiederhake --- src/util/virfile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/virfile.c b/src/util/virfile.c

[libvirt PATCH 00/11] Random bits found by clang-tidy

2021-01-28 Thread Tim Wiederhake
clang-tidy is a static code analysis tool under the llvm umbrella. It is primarily meant to be used on C++ code bases, but some of the checks it provides also apply to C. The findings vary in severity and contain pseudo-false-positives, i.e. clang-tidy is flagging potential execution flows that