[PATCH] util: virExec may blocked by reading pipe if grandchild prematurely exit

2021-11-23 Thread Yi Wang
From: Xu Chao When VIR_EXEC_DAEMON is set, if virPidFileAcquirePath/virSetInherit failed, then pipesync[0] can not be closed when granchild process exit, because pipesync[1] still opened in child process. and then saferead in child process may blocked forever, and left grandchild process in defun

[PATCH] qemu: Rewrite of code pattern

2021-11-23 Thread Kristina Hanicova
This patch rewrites the pattern using early return where it is not needed. Signed-off-by: Kristina Hanicova --- src/qemu/qemu_alias.c | 41 - 1 file changed, 16 insertions(+), 25 deletions(-) diff --git a/src/qemu/qemu_alias.c b/src/qemu/qemu_alias.c inde

[PATCH] qemu: Rewrite code to the pattern

2021-11-23 Thread Kristina Hanicova
I have seen this pattern a lot in the project, so I decided to rewrite code I stumbled upon to the same pattern as well. Signed-off-by: Kristina Hanicova --- src/qemu/qemu_driver.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qe

[libvirt PATCH 3/3] qemu: mock swtpm initialization in tests

2021-11-23 Thread Daniel P . Berrangé
The domain capabilities won't report TPM support unless SWTPM can be initialized. To avoid relying on the swtpm install in the host, mock the entire initialization method, since all it needs todo is return a non-error value. Signed-off-by: Daniel P. Berrangé --- tests/domaincapsdata/qemu_2.11.0-

[libvirt PATCH 1/3] conf: add TPM devices to domain capabilities

2021-11-23 Thread Daniel P . Berrangé
This adds reporting of available TPM models and backends to the domain capabilities schema Signed-off-by: Daniel P. Berrangé --- docs/schemas/domaincaps.rng| 10 ++ src/conf/domain_capabilities.c | 14 ++ src/conf/domain_capabilities.h | 10 ++ 3 files changed, 34

[libvirt PATCH 0/3] Expose TPM availability in domain capabilities

2021-11-23 Thread Daniel P . Berrangé
If we can report whuether TPM is available, then mgmt apps can enable it by default for new VMs. This is important because OS like Win11 consider TPM to be mandatory. Daniel P. Berrangé (3): conf: add TPM devices to domain capabilities qemu: fill in domain capabilities for TPMs qemu: mock sw

[libvirt PATCH 2/3] qemu: fill in domain capabilities for TPMs

2021-11-23 Thread Daniel P . Berrangé
This reports what TPM features QEMU supports, provided that swtpm is installed in the host. Signed-off-by: Daniel P. Berrangé --- src/qemu/qemu_capabilities.c | 32 +++ src/qemu/qemu_capabilities.h | 3 ++ .../domaincapsdata/qemu_2.11.0-q35.x86_

Re: [RFC PATCH 1/3] libvirt: Introduce virDomainInjectLaunchSecret public API

2021-11-23 Thread Daniel P . Berrangé
On Tue, Nov 16, 2021 at 07:23:52PM -0700, Jim Fehlig wrote: > An API inject a launch secret into the domain's memory. > > Signed-off-by: Jim Fehlig > --- > include/libvirt/libvirt-domain.h | 6 > src/driver-hypervisor.h | 8 + > src/libvirt-domain.c | 50 +

[PATCH] qemu: Remove 'else' branches after 'return' or 'goto'

2021-11-23 Thread Kristina Hanicova
I think it makes no sense to have else branches after return or goto as it will never reach them in cases it should not. This patch makes the code more readable (at least to me). Signed-off-by: Kristina Hanicova --- src/libvirt.c | 3 ++- src/qemu/qemu_agent.c | 6 +++

Re: [libvirt PATCH] ci: display installed packages at start of build

2021-11-23 Thread Michal Prívozník
On 11/23/21 17:40, Daniel P. Berrangé wrote: > When a build fails it is helpful to know what packages were installed, > because by the time we look at the build job output, the original > container image might have changed. > > Signed-off-by: Daniel P. Berrangé > --- > .gitlab-ci.yml | 2 ++ > 1

Re: [PATCH] qemu: Remove unnecessary variables and labels

2021-11-23 Thread Michal Prívozník
On 11/23/21 17:34, Kristina Hanicova wrote: > This patch removes variables such as 'ret', 'rc' and others which > are easily replaced. Therefore, making the code look cleaner and > easier to understand. > > Signed-off-by: Kristina Hanicova > --- > src/driver.c | 4 +-- > src/q

[PATCH 1/4] virInterfaceObjListAssignDef: Transfer definition ownership

2021-11-23 Thread Michal Privoznik
Upon successful return from virInterfaceObjListAssignDef() the virInterfaceObj is the owner of secret definition. To make this ownership transfer even more visible, lets pass the definition as a double pointer and use g_steal_pointer(). Signed-off-by: Michal Privoznik --- src/conf/virinterfaceob

[PATCH 4/4] virDomainObjListAdd: Transfer definition ownership

2021-11-23 Thread Michal Privoznik
Upon successful return from virDomainObjListAdd() the virDomainObj is the owner of secret definition. To make this ownership transfer even more visible, lets pass the definition as a double pointer and use g_steal_pointer(). Signed-off-by: Michal Privoznik --- src/bhyve/bhyve_driver.c| 6 ++

[PATCH 3/4] virStoragePoolObjListAdd: Transfer definition ownership

2021-11-23 Thread Michal Privoznik
Upon successful return from virStoragePoolObjListAdd() the virStoragePoolObj is the owner of secret definition. To make this ownership transfer even more visible, lets pass the definition as a double pointer and use g_steal_pointer(). Signed-off-by: Michal Privoznik --- src/conf/virstorageobj.c

[PATCH 2/4] virSecretObjListAdd: Transfer definition ownership

2021-11-23 Thread Michal Privoznik
Upon successful return from virSecretObjListAdd() the virSecretObj is the owner of secret definition. To make this ownership transfer even more visible, lets pass the definition as a double pointer and use g_steal_pointer(). Signed-off-by: Michal Privoznik --- src/conf/virsecretobj.c| 26 +++

[PATCH 0/4] virXXXListAdd: Transfer definition ownership

2021-11-23 Thread Michal Privoznik
At a lot of places we have the following pattern: virXXXDef *def = parseDef(); if (!(obj = virXXXObjListAdd(def))) goto clenaup; def = NULL; cleanup: virXXXDefFree(def); The 'def = NULL' step is necessary because the ownership of the definition was transferred onto the object. Wel

[libvirt PATCH] ci: display installed packages at start of build

2021-11-23 Thread Daniel P . Berrangé
When a build fails it is helpful to know what packages were installed, because by the time we look at the build job output, the original container image might have changed. Signed-off-by: Daniel P. Berrangé --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b

[PATCH] qemu: Remove unnecessary variables and labels

2021-11-23 Thread Kristina Hanicova
This patch removes variables such as 'ret', 'rc' and others which are easily replaced. Therefore, making the code look cleaner and easier to understand. Signed-off-by: Kristina Hanicova --- src/driver.c | 4 +-- src/qemu/qemu_agent.c | 4 +-- src/qemu/qemu_alias.c

Re: [libvirt PATCH 4/4] tests: pcivpdtest: check return value of virCreateAnonymousFile

2021-11-23 Thread Martin Kletzander
On Tue, Nov 23, 2021 at 04:49:52PM +0100, Ján Tomko wrote: On a Tuesday in 2021, Martin Kletzander wrote: On Tue, Nov 23, 2021 at 03:40:46PM +0100, Kristina Hanicova wrote: On Tue, Nov 23, 2021 at 3:20 PM Ján Tomko wrote: Fixes: 59c1bc3a0e25e6d725db41990f11e0b53137115d Fixes: 43820e4b8037680

Re: [libvirt PATCH 4/4] tests: pcivpdtest: check return value of virCreateAnonymousFile

2021-11-23 Thread Ján Tomko
On a Tuesday in 2021, Martin Kletzander wrote: On Tue, Nov 23, 2021 at 03:40:46PM +0100, Kristina Hanicova wrote: On Tue, Nov 23, 2021 at 3:20 PM Ján Tomko wrote: Fixes: 59c1bc3a0e25e6d725db41990f11e0b53137115d Fixes: 43820e4b8037680ec451761216750c6b139db67a Fixes: 600f580d623ae4077ddeb6c7cb2

Re: [libvirt PATCH 0/3] ci: improve mingw coverage

2021-11-23 Thread Michal Prívozník
On 11/23/21 14:51, Daniel P. Berrangé wrote: > This ensures at least one mingw job is gating for pipelines > > Daniel P. Berrangé (3): > ci: replace Fedora 33 with Fedora 35 > ci: refresh variables/dockerfiles with latest content > ci: run a mingw64 job on stable Fedora > > ci/cirrus/freeb

Re: [libvirt PATCH 4/4] tests: pcivpdtest: check return value of virCreateAnonymousFile

2021-11-23 Thread Martin Kletzander
On Tue, Nov 23, 2021 at 03:40:46PM +0100, Kristina Hanicova wrote: On Tue, Nov 23, 2021 at 3:20 PM Ján Tomko wrote: Fixes: 59c1bc3a0e25e6d725db41990f11e0b53137115d Fixes: 43820e4b8037680ec451761216750c6b139db67a Fixes: 600f580d623ae4077ddeb6c7cb24f8a315a7c73b Signed-off-by: Ján Tomko --- tes

Re: [PATCH v3 2/2] Use virProcessGetStat

2021-11-23 Thread Ján Tomko
On a Tuesday in 2021, Martin Kletzander wrote: This eliminates one incorrect parsing implementation which relied on the command field not having a closing bracket. This possibility is already tested against in the virProcessGetStat() tests. Signed-off-by: Martin Kletzander --- src/qemu/qemu_dr

Re: [PATCH v3 1/2] util: Add virProcessGetStat

2021-11-23 Thread Ján Tomko
On a Tuesday in 2021, Martin Kletzander wrote: This reads and separates all fields from /proc//stat or /proc//task//stat as there are easy mistakes to be done in the implementation. Some tests are added to show it works correctly. No number parsing is done as it would be unused for most of the

Re: [libvirt PATCH 0/4] Coverity fixes

2021-11-23 Thread Kristina Hanicova
On Tue, Nov 23, 2021 at 3:21 PM Ján Tomko wrote: > Ján Tomko (4): > tools: virt-host-validate: fix memory leak > vbox: fix vboxCapsInit > ch: fix logic in virCHMonitorBuildPtyJson > tests: pcivpdtest: check return value of virCreateAnonymousFile > > src/ch/ch_monitor.c | 4 +--

Re: [libvirt PATCH 4/4] tests: pcivpdtest: check return value of virCreateAnonymousFile

2021-11-23 Thread Kristina Hanicova
On Tue, Nov 23, 2021 at 3:20 PM Ján Tomko wrote: > Fixes: 59c1bc3a0e25e6d725db41990f11e0b53137115d > Fixes: 43820e4b8037680ec451761216750c6b139db67a > Fixes: 600f580d623ae4077ddeb6c7cb24f8a315a7c73b > Signed-off-by: Ján Tomko > --- > tests/virpcivpdtest.c | 20 > 1 file cha

Re: [libvirt PATCH 0/2] snapshot revert fix followup

2021-11-23 Thread Ján Tomko
On a Tuesday in 2021, Pavel Hrdina wrote: Pavel Hrdina (2): qemu_monitor: remove unused load snapshot code virsh: man: update snapshot-revert description docs/manpages/virsh.rst | 4 src/qemu/qemu_monitor.c | 11 --- src/qemu/qemu_monitor.h | 1 - src/qemu/qemu_monit

[PATCH v7 0/2] Dirty Ring support (Libvirt)

2021-11-23 Thread huangy81
From: "Hyman Huang(黄勇)" v7 - rebase on master - modify the following points according to the advice given by Peter 1. skip the -accel switch and reuse the existing commit d20ebdda2 'qemu: Switch to -accel' 2. remove the post-parse function and do the parse work in virDomainFeature

Re: [PATCH 12/12] util: xml: Remove virXMLPropStringLimit and virXPathStringLimit

2021-11-23 Thread Ján Tomko
On a Monday in 2021, Peter Krempa wrote: The functions have very difficult semantics where callers are not able to tell whether the property is missing or failed the length check. Only the latter produces errors. Since usage of the functions was phased out, remove them completely to avoid furthe

[PATCH v7 1/2] qemu: support dirty ring feature

2021-11-23 Thread huangy81
From: Hyman Huang(黄勇) Dirty ring feature was introduced in qemu-6.1.0, this patch add the corresponding feature named 'dirty-ring', which enable dirty ring feature when starting vm. To implement the dirty-ring feature, dirty_ring_size in struct "_virDomainDef" is introduced to hold the dirty rin

[PATCH v7 2/2] tests: add test for kvm-dirty-ring feature

2021-11-23 Thread huangy81
From: Hyman Huang(黄勇) Update the KVM feature tests for dirty ring. Signed-off-by: Hyman Huang(黄勇) --- tests/qemuxml2argvdata/kvm-features-off.xml | 1 + tests/qemuxml2argvdata/kvm-features.args | 2 +- tests/qemuxml2argvdata/kvm-features.xml | 1 + tests/qemuxml2xmloutdata/kvm-fea

Re: [PATCH 11/12] virSecurityLabelDefParseXML: Don't use virXMLPropStringLimit

2021-11-23 Thread Ján Tomko
On a Monday in 2021, Peter Krempa wrote: The function produces an error which is ignored in this code path. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signatur

Re: [PATCH 10/12] virSecurityDeviceLabelDefParseXML: Don't use 'virXPathStringLimit'

2021-11-23 Thread Ján Tomko
On a Monday in 2021, Peter Krempa wrote: virXPathStringLimit doesn't give callers a way to differentiate between the queried XPath being empty and the length limit being exceeded. This means that the callers is completely ignoring the error. Move the length check into the caller. Signed-off-by

Re: [PATCH 09/12] virSecurityDeviceLabelDefParseXML: Use automatic memory clearing for temp strings

2021-11-23 Thread Ján Tomko
On a Monday in 2021, Peter Krempa wrote: On Mon, Nov 22, 2021 at 18:12:29 +0100, Peter Krempa wrote: Apart from code simplification the refactor of 'model' fixes an unlikely memory leak of the string if a duplicate model is found. While the coversion of 'label' variable may seem unnecessary it

Re: [PATCH 08/12] virSecurityLabelDefParseXML: Don't use 'virXPathStringLimit'

2021-11-23 Thread Ján Tomko
On a Monday in 2021, Peter Krempa wrote: virXPathStringLimit doesn't give callers a way to differentiate between the queried XPath being empty and the length limit being exceeded. This means that callers are either overwriting the error message or ignoring it altogether. Move the length checks

Re: [PATCH 06/12] virSecurityLabelDefParseXML: Remove pointless 'error' label

2021-11-23 Thread Ján Tomko
On a Monday in 2021, Peter Krempa wrote: Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 19 --- 1 file changed, 8 insertions(+), 11 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signature

Re: [PATCH 07/12] virNodeDeviceCapVPDParseCustomFields: Don't use 'virXPathStringLimit'

2021-11-23 Thread Ján Tomko
On a Monday in 2021, Peter Krempa wrote: virXPathStringLimit doesn't give callers a way to differentiate between the queried XPath being empty and the length limit being exceeded. This means that callers are overwriting the error message. Move the length checks into the caller. Signed-off-by:

Re: [PATCH 05/12] virSecurityLabelDefParseXML: Use automatic freeing for 'seclabel'

2021-11-23 Thread Ján Tomko
On a Monday in 2021, Peter Krempa wrote: Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signature

Re: [PATCH 04/12] virSecurityLabelDefParseXML: Don't reuse temporary string 'p'

2021-11-23 Thread Ján Tomko
On a Monday in 2021, Peter Krempa wrote: Use separate variables for 'model' and 'relabel' properties. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 20 src/util/virseclabel.h | 1 + 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/src/util/virseclab

Re: [PATCH 03/12] virSecurityLabelDefParseXML: Directly assign strings into appropriate variables

2021-11-23 Thread Ján Tomko
On a Monday in 2021, Peter Krempa wrote: 'seclabel->label', 'seclabel->imagelabel' and 'seclabel->baselabel' are populated by stealing the pointer from the 'p' temporary string. Remove the extra step. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 20 1 file change

[libvirt PATCH 2/2] virsh: man: update snapshot-revert description

2021-11-23 Thread Pavel Hrdina
We've changed the behavior of this API that from now on it will always restart the VM process and we are no longer able to revert to snapshots created by libvirt older then 0.9.5. Signed-off-by: Pavel Hrdina --- docs/manpages/virsh.rst | 4 1 file changed, 4 insertions(+) diff --git a/docs

[libvirt PATCH 0/2] snapshot revert fix followup

2021-11-23 Thread Pavel Hrdina
Pavel Hrdina (2): qemu_monitor: remove unused load snapshot code virsh: man: update snapshot-revert description docs/manpages/virsh.rst | 4 src/qemu/qemu_monitor.c | 11 --- src/qemu/qemu_monitor.h | 1 - src/qemu/qemu_monitor_text.c | 36 ---

[libvirt PATCH 1/2] qemu_monitor: remove unused load snapshot code

2021-11-23 Thread Pavel Hrdina
Recent cleanup of snapshot revert code made these function unused. Signed-off-by: Pavel Hrdina --- src/qemu/qemu_monitor.c | 11 --- src/qemu/qemu_monitor.h | 1 - src/qemu/qemu_monitor_text.c | 36 src/qemu/qemu_monitor_text.h | 1 - 4 fi

[libvirt PATCH 4/4] tests: pcivpdtest: check return value of virCreateAnonymousFile

2021-11-23 Thread Ján Tomko
Fixes: 59c1bc3a0e25e6d725db41990f11e0b53137115d Fixes: 43820e4b8037680ec451761216750c6b139db67a Fixes: 600f580d623ae4077ddeb6c7cb24f8a315a7c73b Signed-off-by: Ján Tomko --- tests/virpcivpdtest.c | 20 1 file changed, 20 insertions(+) diff --git a/tests/virpcivpdtest.c b/test

[libvirt PATCH 3/4] ch: fix logic in virCHMonitorBuildPtyJson

2021-11-23 Thread Ján Tomko
There is a leftover 'ptys' variable, which we only assign to and one assignment to 'content', where we add an empty 'pty' object. Remove 'ptys'. Fixes: 93accefd9eca1bc3d7e923a979ab2d1b8a312ff7 Signed-off-by: Ján Tomko --- src/ch/ch_monitor.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions

[libvirt PATCH 2/4] vbox: fix vboxCapsInit

2021-11-23 Thread Ján Tomko
There is a stray mis-indented 'return NULL' left after a recent refactor. Fixes: c18d9e23fafabcfbb80481e0705931036b8e7331 Signed-off-by: Ján Tomko --- src/vbox/vbox_common.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c index 62c8e22cb5..72f1b

[libvirt PATCH 1/4] tools: virt-host-validate: fix memory leak

2021-11-23 Thread Ján Tomko
virHostValidateGetCPUFlags returns an allocated virBitmap and it needs to be freed. Fixes: a0ec7165e3bbc416478740f6d2e8fef2ece18602 Signed-off-by: Ján Tomko --- tools/virt-host-validate-ch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/virt-host-validate-ch.c b/tools

[libvirt PATCH 0/4] Coverity fixes

2021-11-23 Thread Ján Tomko
Ján Tomko (4): tools: virt-host-validate: fix memory leak vbox: fix vboxCapsInit ch: fix logic in virCHMonitorBuildPtyJson tests: pcivpdtest: check return value of virCreateAnonymousFile src/ch/ch_monitor.c | 4 +--- src/vbox/vbox_common.c| 1 - tests/virpcivpdtest.c

[libvirt PATCH 3/3] ci: run a mingw64 job on stable Fedora

2021-11-23 Thread Daniel P . Berrangé
Both of the current mingw jobs are marked as 'allow_failure' because they are running against Fedora rawhide which is an unstable distro. We need at least one mingw job to be gating to more reliably detect problems. This introduces dockerfiles for both mingw variants on Fedora 35 and sets the min

[libvirt PATCH 0/3] ci: improve mingw coverage

2021-11-23 Thread Daniel P . Berrangé
This ensures at least one mingw job is gating for pipelines Daniel P. Berrangé (3): ci: replace Fedora 33 with Fedora 35 ci: refresh variables/dockerfiles with latest content ci: run a mingw64 job on stable Fedora ci/cirrus/freebsd-12.vars | 7 +- ci/cirrus/freebsd-13.

[libvirt PATCH 2/3] ci: refresh variables/dockerfiles with latest content

2021-11-23 Thread Daniel P . Berrangé
- The Cirrus CI variables are now sorted - The dockerfiles update commands changed for some distros - Meson in CentOS is now new enough to use Signed-off-by: Daniel P. Berrangé --- ci/cirrus/freebsd-12.vars | 7 +-- ci/cirrus/freebsd-13.vars

[libvirt PATCH 1/3] ci: replace Fedora 33 with Fedora 35

2021-11-23 Thread Daniel P . Berrangé
Signed-off-by: Daniel P. Berrangé --- ...ora-33.Dockerfile => fedora-35.Dockerfile} | 2 +- ci/gitlab.yml | 20 +-- ci/manifest.yml | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) rename ci/containers/{f

Re: [PATCH 1/1] bash-completion: fix variable leaks of "IFS" and "word"

2021-11-23 Thread Michal Prívozník
On 11/23/21 13:50, Koichi Murase wrote: > Thank you for reviewing the patch. > > 2021年11月23日(火) 21:37 Michal Prívozník : >> [...] >> >> The word variable is also used only inside a while loop (not visible in >> the context). So it can be declared local there instead of here. I'll >> fix that befor

Re: [PATCH 02/12] virSecurityLabelDef: Declare 'type' as 'virDomainSeclabelType'

2021-11-23 Thread Ján Tomko
On a Monday in 2021, Peter Krempa wrote: Use the appropriate enum type instead of an int and fix the XML parser and one missing fully populated switch. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 14 +- src/security/security_selinux.c | 3 ++- src/util/virseclab

Re: [PATCH 01/12] util: seclabel: Define autoptr cleanup func for virSecurityLabelDef and virSecurityDeviceLabelDef

2021-11-23 Thread Ján Tomko
On a Monday in 2021, Peter Krempa wrote: Signed-off-by: Peter Krempa --- src/util/virseclabel.h | 3 +++ 1 file changed, 3 insertions(+) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signature

Re: [PATCH 1/1] bash-completion: fix variable leaks of "IFS" and "word"

2021-11-23 Thread Koichi Murase
Thank you for reviewing the patch. 2021年11月23日(火) 21:37 Michal Prívozník : > [...] > > The word variable is also used only inside a while loop (not visible in > the context). So it can be declared local there instead of here. I'll > fix that before pushing. OK. > However, we do require developer

Re: [PATCH 1/1] bash-completion: fix variable leaks of "IFS" and "word"

2021-11-23 Thread Michal Prívozník
On 11/14/21 07:06, Koichi Murase wrote: > --- > tools/bash-completion/vsh.in | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/tools/bash-completion/vsh.in b/tools/bash-completion/vsh.in > index 70ade50a02..4399ff0a64 100644 > --- a/tools/bash-completion/vsh.in > +++ b

Re: [PATCH 7/7] util: Make client-side polkit work even with polkit disabled

2021-11-23 Thread Martin Kletzander
On Tue, Nov 23, 2021 at 11:56:40AM +, Daniel P. Berrangé wrote: On Tue, Nov 23, 2021 at 12:55:00PM +0100, Martin Kletzander wrote: On Mon, Nov 22, 2021 at 10:07:39AM +, Daniel P. Berrangé wrote: > On Mon, Nov 22, 2021 at 11:03:53AM +0100, Martin Kletzander wrote: > > On Mon, Nov 22, 2021

Re: [PATCH] meson: fix cpuset_getaffinity() detection

2021-11-23 Thread Michal Prívozník
On 11/23/21 12:57, Roman Bogorodskiy wrote: > The cpuset_getaffinity() function is checked in sys/cpuset.h to see if > BSD CPU affinity APIs are available. This check requires including > sys/param.h to work properly, otherwise the test program fails with > unrelated errors like: > > /usr/include/

Re: [PATCH] meson: fix cpuset_getaffinity() detection

2021-11-23 Thread Martin Kletzander
On Tue, Nov 23, 2021 at 03:57:56PM +0400, Roman Bogorodskiy wrote: The cpuset_getaffinity() function is checked in sys/cpuset.h to see if BSD CPU affinity APIs are available. This check requires including sys/param.h to work properly, otherwise the test program fails with unrelated errors like:

[PATCH] meson: fix cpuset_getaffinity() detection

2021-11-23 Thread Roman Bogorodskiy
The cpuset_getaffinity() function is checked in sys/cpuset.h to see if BSD CPU affinity APIs are available. This check requires including sys/param.h to work properly, otherwise the test program fails with unrelated errors like: /usr/include/sys/cpuset.h:155:1: error: unknown type name '__BEGIN_DE

Re: [PATCH 7/7] util: Make client-side polkit work even with polkit disabled

2021-11-23 Thread Daniel P . Berrangé
On Tue, Nov 23, 2021 at 12:55:00PM +0100, Martin Kletzander wrote: > On Mon, Nov 22, 2021 at 10:07:39AM +, Daniel P. Berrangé wrote: > > On Mon, Nov 22, 2021 at 11:03:53AM +0100, Martin Kletzander wrote: > > > On Mon, Nov 22, 2021 at 09:23:01AM +, Daniel P. Berrangé wrote: > > > > On Sun, N

Re: [PATCH 3/7] util: Add virPolkitAgentAvailable

2021-11-23 Thread Martin Kletzander
On Mon, Nov 22, 2021 at 04:38:42PM +0100, Ján Tomko wrote: On a Sunday in 2021, Martin Kletzander wrote: With this function we can decide whether to try running the polkit text agent only if it is available, removing a potential needless error saying that the agent binary does not exist, which i

Re: [PATCH 7/7] util: Make client-side polkit work even with polkit disabled

2021-11-23 Thread Martin Kletzander
On Mon, Nov 22, 2021 at 10:07:39AM +, Daniel P. Berrangé wrote: On Mon, Nov 22, 2021 at 11:03:53AM +0100, Martin Kletzander wrote: On Mon, Nov 22, 2021 at 09:23:01AM +, Daniel P. Berrangé wrote: > On Sun, Nov 21, 2021 at 12:10:08AM +0100, Martin Kletzander wrote: > > The reason for this

Re: [PATCH] meson: improve CPU affinity routines check

2021-11-23 Thread Roman Bogorodskiy
Martin Kletzander wrote: > On Mon, Nov 22, 2021 at 03:22:11PM +0400, Roman Bogorodskiy wrote: > > Martin Kletzander wrote: > > > >> On Sun, Nov 21, 2021 at 07:58:55PM +0400, Roman Bogorodskiy wrote: > >> >Recently, FreeBSD has got sched_get/setaffinity(3) implementations and > >> >the sched.h h

Re: [PATCH] meson: improve CPU affinity routines check

2021-11-23 Thread Martin Kletzander
On Mon, Nov 22, 2021 at 03:22:11PM +0400, Roman Bogorodskiy wrote: Martin Kletzander wrote: On Sun, Nov 21, 2021 at 07:58:55PM +0400, Roman Bogorodskiy wrote: >Recently, FreeBSD has got sched_get/setaffinity(3) implementations and >the sched.h header as well [1]. To make these routines visible

[PATCH v3 1/2] util: Add virProcessGetStat

2021-11-23 Thread Martin Kletzander
This reads and separates all fields from /proc//stat or /proc//task//stat as there are easy mistakes to be done in the implementation. Some tests are added to show it works correctly. No number parsing is done as it would be unused for most of the fields most, if not all, of the time. No struct

[PATCH v3 0/2] Fix /proc/*/stat parsing

2021-11-23 Thread Martin Kletzander
While working on some polkit stuff I found out that we are inconsistent with the way we parse /proc/*/stat files, so I added a new helper instead along with some tests. Unfortunately using it for the thing I wanted is not really viable in the end, so it "violates" the Rule of three, but at least i

[PATCH v3 2/2] Use virProcessGetStat

2021-11-23 Thread Martin Kletzander
This eliminates one incorrect parsing implementation which relied on the command field not having a closing bracket. This possibility is already tested against in the virProcessGetStat() tests. Signed-off-by: Martin Kletzander --- src/qemu/qemu_driver.c | 34 ++ src/

Re: [PATCH v2 2/2] Use virProcessGetStat

2021-11-23 Thread Martin Kletzander
On Mon, Nov 22, 2021 at 09:59:07AM +, Daniel P. Berrangé wrote: On Mon, Nov 22, 2021 at 10:34:38AM +0100, Martin Kletzander wrote: On Mon, Nov 22, 2021 at 09:18:41AM +, Daniel P. Berrangé wrote: > On Sun, Nov 21, 2021 at 12:04:26AM +0100, Martin Kletzander wrote: > > This eliminates one

Re: [PATCH 08/12] virSecurityLabelDefParseXML: Don't use 'virXPathStringLimit'

2021-11-23 Thread Peter Krempa
On Mon, Nov 22, 2021 at 21:01:58 +0100, Tim Wiederhake wrote: > On Mon, 2021-11-22 at 18:12 +0100, Peter Krempa wrote: > > virXPathStringLimit doesn't give callers a way to differentiate > > between > > the queried XPath being empty and the length limit being exceeded. > > > > This means that call

Re: [libvirt PATCH 06.5/12] test: snapshot revert: properly emulate starting CPUs

2021-11-23 Thread Peter Krempa
On Tue, Nov 23, 2021 at 09:20:20 +0100, Pavel Hrdina wrote: > When active snapshot is reverted we stop CPUs in order to load the > snapshot but we never start the CPUs again. > > Signed-off-by: Pavel Hrdina > --- > src/test/test_driver.c | 3 +++ > tests/virsh-snapshot | 14 +++--- >

Re: [PATCH 09/12] virSecurityDeviceLabelDefParseXML: Use automatic memory clearing for temp strings

2021-11-23 Thread Peter Krempa
On Mon, Nov 22, 2021 at 21:02:01 +0100, Tim Wiederhake wrote: > On Mon, 2021-11-22 at 18:12 +0100, Peter Krempa wrote: > > Apart from code simplification the refactor of 'model' fixes an > > unlikely > > memory leak of the string if a duplicate model is found. > > > > While the coversion of 'label

[libvirt PATCH 06.5/12] test: snapshot revert: properly emulate starting CPUs

2021-11-23 Thread Pavel Hrdina
When active snapshot is reverted we stop CPUs in order to load the snapshot but we never start the CPUs again. Signed-off-by: Pavel Hrdina --- src/test/test_driver.c | 3 +++ tests/virsh-snapshot | 14 +++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/test/tes