Re: [PATCH v2] qemu: save status xml after generating taint message

2021-08-11 Thread Jano Tomko
On a %A in %Y, Kristina Hanicova wrote: > We didn't always save status xml after generating new taint message > which resulted in it being deleted in case of a libvirtd restart. > Some taint messages were preserved thanks to saving status xml > separately at the end of the calling functions. With

[libvirt PATCH] virsh: refactor cmdDomblkinfo

2021-08-11 Thread Ján Tomko
Use automatic memory cleanup to get rid of the cleanup section, and of the memory leak that happens inside the loop, because cap, alloc and phy are only freed once per function. Signed-off-by: Ján Tomko --- tools/virsh-domain-monitor.c | 62 +++- 1 file changed,

Re: [PATCH v2 09/11] test_driver: Implement virConnectGetAllDomainStats

2021-08-11 Thread Luke Yue
On Wed, 2021-08-11 at 15:23 +0200, Martin Kletzander wrote: > On Thu, Jul 29, 2021 at 08:10:56PM +0800, Luke Yue wrote: > > Implement virConnectGetAllDomainStats in a modular way just like > > QEMU > > driver, though remove some params in GetStatsWorker that we don't > > need > > in test driver

Re: [PATCH 1/4] test_driver: Implement virDomainGetJobInfo

2021-08-11 Thread Luke Yue
On Wed, 2021-08-11 at 15:11 +0200, Martin Kletzander wrote: > On Wed, Aug 11, 2021 at 08:31:03PM +0800, Luke Yue wrote: > > On Tue, 2021-08-10 at 17:49 +0200, Martin Kletzander wrote: > > > On Thu, Jul 22, 2021 at 03:13:22PM +0800, Luke Yue wrote: > > > > As in testDomainGetControlInfo, a

Re: [libvirt PATCH 0/3] Invalidate the cpu flags cache on changes of kernel command line

2021-08-11 Thread Eduardo Habkost
On Wed, Aug 11, 2021 at 9:53 AM Daniel P. Berrangé wrote: > > On Wed, Aug 11, 2021 at 09:46:17AM -0400, Eduardo Habkost wrote: > > On Wed, Aug 11, 2021 at 9:42 AM Daniel P. Berrangé > > wrote: > > > On Wed, Aug 11, 2021 at 09:33:08AM -0400, Eduardo Habkost wrote: > > > > Wouldn't it be easier

Re: [libvirt PATCH 0/3] Invalidate the cpu flags cache on changes of kernel command line

2021-08-11 Thread Eduardo Habkost
On Wed, Aug 11, 2021 at 9:42 AM Daniel P. Berrangé wrote: > On Wed, Aug 11, 2021 at 09:33:08AM -0400, Eduardo Habkost wrote: > > Wouldn't it be easier to simply invalidate the cache every time > > libvirtd is restarted? If libvirtd keeps /dev/kvm open all the time, > > this would also cover

Re: [libvirt PATCH 0/3] Invalidate the cpu flags cache on changes of kernel command line

2021-08-11 Thread Daniel P . Berrangé
On Wed, Aug 11, 2021 at 09:46:17AM -0400, Eduardo Habkost wrote: > On Wed, Aug 11, 2021 at 9:42 AM Daniel P. Berrangé > wrote: > > On Wed, Aug 11, 2021 at 09:33:08AM -0400, Eduardo Habkost wrote: > > > Wouldn't it be easier to simply invalidate the cache every time > > > libvirtd is restarted?

Re: [libvirt PATCH 0/3] Invalidate the cpu flags cache on changes of kernel command line

2021-08-11 Thread Daniel P . Berrangé
On Wed, Aug 11, 2021 at 09:33:08AM -0400, Eduardo Habkost wrote: > On Wed, Aug 11, 2021 at 4:43 AM Jiri Denemark wrote: > > > > On Fri, Aug 06, 2021 at 18:12:21 +0100, Daniel P. Berrangé wrote: > > > On Fri, Aug 06, 2021 at 05:07:45PM +0200, Jiri Denemark wrote: > > > > On Thu, Aug 05, 2021 at

Re: [libvirt PATCH 0/3] Invalidate the cpu flags cache on changes of kernel command line

2021-08-11 Thread Eduardo Habkost
On Wed, Aug 11, 2021 at 4:43 AM Jiri Denemark wrote: > > On Fri, Aug 06, 2021 at 18:12:21 +0100, Daniel P. Berrangé wrote: > > On Fri, Aug 06, 2021 at 05:07:45PM +0200, Jiri Denemark wrote: > > > On Thu, Aug 05, 2021 at 14:50:51 +0100, Daniel P. Berrangé wrote: > > > > On Thu, Aug 05, 2021 at

Re: [PATCH v2 09/11] test_driver: Implement virConnectGetAllDomainStats

2021-08-11 Thread Martin Kletzander
On Thu, Jul 29, 2021 at 08:10:56PM +0800, Luke Yue wrote: Implement virConnectGetAllDomainStats in a modular way just like QEMU driver, though remove some params in GetStatsWorker that we don't need in test driver currently. Only add the worker to get state so far, more worker will be added in

Re: [PATCH 1/4] test_driver: Implement virDomainGetJobInfo

2021-08-11 Thread Martin Kletzander
On Wed, Aug 11, 2021 at 08:31:03PM +0800, Luke Yue wrote: On Tue, 2021-08-10 at 17:49 +0200, Martin Kletzander wrote: On Thu, Jul 22, 2021 at 03:13:22PM +0800, Luke Yue wrote: > As in testDomainGetControlInfo, a background job should be running > between 0-1 seconds, so make the

[PATCH 3/5] domain_conf: replace validation with variables passed to virXMLParse()

2021-08-11 Thread Kristina Hanicova
virXMLParse() now allows to validate xml against schema directly, eliminating the need to do it individually. Signed-off-by: Kristina Hanicova --- src/conf/domain_conf.c | 17 +++-- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/src/conf/domain_conf.c

[PATCH 2/5] util: add xml validation against schema in virXMLParseHelper()

2021-08-11 Thread Kristina Hanicova
We need this in order to validate XML against schema at one place, rather than have the same code for validation in different functions. I will add '--validate' option to more virsh commands soon and this makes it easier as virXMLParse() is called in every one I plan to change. Signed-off-by:

[PATCH 0/5] src: move validation to virXMLParseHelper()

2021-08-11 Thread Kristina Hanicova
This series avoids duplication of the same code used for validation of XML document against rng schema and makes it easier to add validation of other objects in the future as well. Kristina Hanicova (5): src: add 'schema' and 'validate' variable to virXMLParseHelper() util: add xml validation

[PATCH 5/5] conf: replace validation with variables passed to virXMLParse()

2021-08-11 Thread Kristina Hanicova
virXMLParse() now allows to validate xml against schema directly, eliminating the need to do it individually in each function. Signed-off-by: Kristina Hanicova --- src/conf/backup_conf.c | 13 ++--- src/conf/checkpoint_conf.c | 12 ++-- src/conf/snapshot_conf.c | 15

[PATCH 4/5] domain_conf: Remove redundant variable

2021-08-11 Thread Kristina Hanicova
xmlDocPtr is no longer needed, because validation against schema was moved to another function. Signed-off-by: Kristina Hanicova --- src/conf/domain_conf.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index

[PATCH 1/5] src: add 'schema' and 'validate' variable to virXMLParseHelper()

2021-08-11 Thread Kristina Hanicova
Signed-off-by: Kristina Hanicova --- src/conf/backup_conf.c | 2 +- src/conf/checkpoint_conf.c | 2 +- src/conf/domain_conf.c | 2 +- src/conf/interface_conf.c| 2 +- src/conf/network_conf.c | 2 +- src/conf/node_device_conf.c | 2 +-

Re: [PATCH 1/4] test_driver: Implement virDomainGetJobInfo

2021-08-11 Thread Luke Yue
On Tue, 2021-08-10 at 17:49 +0200, Martin Kletzander wrote: > On Thu, Jul 22, 2021 at 03:13:22PM +0800, Luke Yue wrote: > > As in testDomainGetControlInfo, a background job should be running > > between 0-1 seconds, so make the testDomainGetJobInfo > > consistent > > with it. > > > >

[libvirt PATCH 3/3] util: xml: clean up unnecessary ret variables

2021-08-11 Thread Ján Tomko
Signed-off-by: Ján Tomko --- src/util/virxml.c | 13 +++-- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/util/virxml.c b/src/util/virxml.c index 6b5ed08426..a236e4e7a0 100644 --- a/src/util/virxml.c +++ b/src/util/virxml.c @@ -73,7 +73,6 @@ virXPathString(const char

[libvirt PATCH 1/3] util: define cleanup func for xmlXPathObject

2021-08-11 Thread Ján Tomko
Signed-off-by: Ján Tomko --- src/util/virxml.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/util/virxml.h b/src/util/virxml.h index 0bb0d1c118..c8eb51a65a 100644 --- a/src/util/virxml.h +++ b/src/util/virxml.h @@ -363,6 +363,7 @@

[libvirt PATCH 2/3] util: xml: use g_auto for xmlXPathObject

2021-08-11 Thread Ján Tomko
Signed-off-by: Ján Tomko --- src/util/virxml.c | 36 ++-- 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/src/util/virxml.c b/src/util/virxml.c index 4360b15486..6b5ed08426 100644 --- a/src/util/virxml.c +++ b/src/util/virxml.c @@ -72,7 +72,7 @@

[libvirt PATCH 0/3] xml: use g_auto for xmlXPathObject (glib chronicles)

2021-08-11 Thread Ján Tomko
Ján Tomko (3): util: define cleanup func for xmlXPathObject util: xml: use g_auto for xmlXPathObject util: xml: clean up unnecessary ret variables src/util/virxml.c | 49 +-- src/util/virxml.h | 1 + 2 files changed, 14 insertions(+), 36

Re: [libvirt PATCH 6/7] nodedev: Handle inactive mdevs with the same UUID

2021-08-11 Thread Boris Fiuczynski
On 8/3/21 9:55 PM, Jonathon Jongsma wrote: On Tue, Aug 3, 2021 at 6:24 AM Boris Fiuczynski wrote: On 8/2/21 5:30 PM, Jonathon Jongsma wrote: On Fri, Jul 30, 2021 at 8:01 AM Boris Fiuczynski wrote: On 7/30/21 9:48 AM, Michal Prívozník wrote: On 7/29/21 9:27 PM, Jonathon Jongsma wrote: On

Re: [libvirt PATCH] run: set abs_builddir variables

2021-08-11 Thread Andrea Bolognani
On Wed, Aug 11, 2021 at 09:44:11AM +0200, Ján Tomko wrote: > test-lib.sh needs these to be set. > > Export them so that the virsh-* tests can be run using: > builddir$ ./run srcdir/tests/virsh-snapshot > > Signed-off-by: Ján Tomko > --- > meson.build | 1 + > run.in | 3 +++ > 2 files

[PATCH v1] virdnsmasq: fix runtime search for executable

2021-08-11 Thread Olaf Hering
dnsmasq is an optional binary which does not neccessary exist during build. Signed-off-by: Olaf Hering --- src/util/virdnsmasq.c | 28 +++- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/src/util/virdnsmasq.c b/src/util/virdnsmasq.c index

Re: [libvirt PATCH 0/3] Invalidate the cpu flags cache on changes of kernel command line

2021-08-11 Thread Jiri Denemark
On Fri, Aug 06, 2021 at 18:12:21 +0100, Daniel P. Berrangé wrote: > On Fri, Aug 06, 2021 at 05:07:45PM +0200, Jiri Denemark wrote: > > On Thu, Aug 05, 2021 at 14:50:51 +0100, Daniel P. Berrangé wrote: > > > On Thu, Aug 05, 2021 at 03:36:37PM +0200, Tim Wiederhake wrote: > > > > The kernel command

Re: [libvirt PATCH 00/10] virsh: moments: use g_auto more (glib chronicles)

2021-08-11 Thread Peter Krempa
On Tue, Aug 10, 2021 at 19:44:59 +0200, Ján Tomko wrote: > Ján Tomko (10): > vsh: table: define cleanup function > virsh: add cleanup function for virshDomainCheckpoint > virsh: add cleanup function for virshDomainSnapshot > virsh: checkpoint: move variables inside the loop > virsh:

Re: [libvirt PATCH 5/5] vsh: use g_clear_pointer

2021-08-11 Thread Peter Krempa
On Tue, Aug 10, 2021 at 19:14:43 +0200, Ján Tomko wrote: > Replace remaining uses of VIR_FREE with g_clear_pointer. > > Signed-off-by: Ján Tomko > --- > tools/vsh.c | 9 +++-- > 1 file changed, 3 insertions(+), 6 deletions(-) Reviewed-by: Peter Krempa

Re: [libvirt PATCH 4/5] vsh: remove pointless cleanup labels

2021-08-11 Thread Peter Krempa
On Tue, Aug 10, 2021 at 19:14:42 +0200, Ján Tomko wrote: > Remove cleanup sections that are no longer needed, as well > as unnecessary 'ret' variables. > > Signed-off-by: Ján Tomko > --- > tools/vsh.c | 18 +- > 1 file changed, 5 insertions(+), 13 deletions(-) Reviewed-by:

Re: [libvirt PATCH 3/5++] fixup: vshInitDebug

2021-08-11 Thread Peter Krempa
On Wed, Aug 11, 2021 at 09:40:13 +0200, Ján Tomko wrote: > Signed-off-by: Ján Tomko > --- > tools/vsh.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) Reviewed-by: Peter Krempa

[libvirt PATCH] run: set abs_builddir variables

2021-08-11 Thread Ján Tomko
test-lib.sh needs these to be set. Export them so that the virsh-* tests can be run using: builddir$ ./run srcdir/tests/virsh-snapshot Signed-off-by: Ján Tomko --- meson.build | 1 + run.in | 3 +++ 2 files changed, 4 insertions(+) diff --git a/meson.build b/meson.build index

Re: [libvirt PATCH 2/5] vsh: cmdEcho: use separate variable for argument

2021-08-11 Thread Peter Krempa
On Tue, Aug 10, 2021 at 19:14:40 +0200, Ján Tomko wrote: > Do not use 'arg' which is later used for an allocated string. > > Signed-off-by: Ján Tomko > --- > tools/vsh.c | 7 +++ > 1 file changed, 3 insertions(+), 4 deletions(-) Reviewed-by: Peter Krempa There's quite some room for

Re: [libvirt PATCH 1/5] vsh: do not cast away const

2021-08-11 Thread Peter Krempa
On Tue, Aug 10, 2021 at 19:14:39 +0200, Ján Tomko wrote: > Instead of using the same variable to store either a const pointer > or an allocated string, always make a copy. > > Signed-off-by: Ján Tomko > --- > tools/vsh.c | 11 ++- > 1 file changed, 6 insertions(+), 5 deletions(-)

[libvirt PATCH 3/5++] fixup: vshInitDebug

2021-08-11 Thread Ján Tomko
Signed-off-by: Ján Tomko --- tools/vsh.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/vsh.c b/tools/vsh.c index 1f384d4ea6..f9600bafba 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -2915,10 +2915,9 @@ static int vshInitDebug(vshControl *ctl) { const char

Re: [libvirt PATCH 09/13] selinux: introduce meson option for selinux policy install

2021-08-11 Thread Pavel Hrdina
On Tue, Aug 10, 2021 at 05:35:58PM +0100, Daniel P. Berrangé wrote: > On Tue, Aug 10, 2021 at 11:10:56AM +0200, Pavel Hrdina wrote: > > On Fri, Aug 06, 2021 at 06:48:06PM +0100, Daniel P. Berrangé wrote: > > > The /etc/os-release file may not even exist on OS and checking specific > > > OS names /