Re: [libvirt] [PATCH 07/10] qemu: hotplug: Simplify removal of managed PR infrastructure on unplug

2018-07-21 Thread John Ferlan
On 07/17/2018 08:14 AM, Peter Krempa wrote: > Extract the (possible) removal of the PR backend and daemon into a > separate helper which enters monitor on it's own. This simplifies the > code and allows reuse of this function in the future e.g. for blockjobs > where removing a image with PR may

Re: [libvirt] [PATCH v2 2/6] rpc: Initialize a worker pool for max_workers=0 as well

2018-07-21 Thread John Ferlan
On 07/20/2018 03:47 AM, Marc Hartmayer wrote: > On Thu, Jul 19, 2018 at 04:52 PM +0200, John Ferlan > wrote: >> On 07/03/2018 07:37 AM, Marc Hartmayer wrote: >>> Semantically, there is no difference between an uninitialized worker >>> pool and an initialized worker pool with zero workers. Let's

[libvirt] [PATCH v1 00/40] use GNU C's cleanup attribute in src/util (batch II)

2018-07-21 Thread Sukrit Bhatnagar
This second series of patches also modifies a few files in src/util to use VIR_AUTOFREE and VIR_AUTOPTR for automatic freeing of memory and get rid of some VIR_FREE macro invocations and *Free function calls. The argument type of virCgroupFree is changed from virCgroupPtr * to virCgroupPtr. Sukri

[libvirt] [PATCH v1 02/40] util: error: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC

2018-07-21 Thread Sukrit Bhatnagar
Using the new VIR_DEFINE_AUTOPTR_FUNC macro defined in src/util/viralloc.h, define a new wrapper around an existing cleanup function which will be called when a variable declared with VIR_AUTOPTR macro goes out of scope. Also, drop the redundant viralloc.h include, since that has moved from the sou

[libvirt] [PATCH v1 01/40] util: cgroup: modify virCgroupFree to take virCgroupPtr

2018-07-21 Thread Sukrit Bhatnagar
Modify virCgroupFree function signature to take a value of type virCgroupPtr instead of virCgroupPtr * as the parameter. Change the argument type in all calls to virCgroupFree function from virCgroupPtr * to virCgroupPtr. Signed-off-by: Sukrit Bhatnagar --- src/libvirt-lxc.c| 4 ++-- s

[libvirt] [PATCH v1 07/40] util: hash: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC

2018-07-21 Thread Sukrit Bhatnagar
Using the new VIR_DEFINE_AUTOPTR_FUNC macro defined in src/util/viralloc.h, define a new wrapper around an existing cleanup function which will be called when a variable declared with VIR_AUTOPTR macro goes out of scope. Also, drop the redundant viralloc.h include, since that has moved from the sou

[libvirt] [PATCH v1 09/40] util: cgroup: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-07-21 Thread Sukrit Bhatnagar
By making use of GNU C's cleanup attribute handled by the VIR_AUTOFREE macro for declaring scalar variables, majority of the VIR_FREE calls can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: Sukrit Bhatnagar --- src/util/vircgroup.c | 528 +

[libvirt] [PATCH v1 03/40] util: buffer: typedef and Free helper for struct _virBufferEscapePair

2018-07-21 Thread Sukrit Bhatnagar
Create typedefs virBufferEscapePair and virBufferEscapePairPtr for struct _virBufferEscapePair for cleaner code and for use with cleanup macros. Also create a dedicated Free helper virBufferEscapePairFree. Signed-off-by: Sukrit Bhatnagar --- src/util/virbuffer.c | 16 ++-- 1 file ch

[libvirt] [PATCH v1 08/40] util: cgroup: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC

2018-07-21 Thread Sukrit Bhatnagar
Using the new VIR_DEFINE_AUTOPTR_FUNC macro defined in src/util/viralloc.h, define a new wrapper around an existing cleanup function which will be called when a variable declared with VIR_AUTOPTR macro goes out of scope. Also, drop the redundant viralloc.h include, since that has moved from the sou

[libvirt] [PATCH v1 05/40] util: buffer: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-07-21 Thread Sukrit Bhatnagar
By making use of GNU C's cleanup attribute handled by the VIR_AUTOFREE macro for declaring scalar variables, majority of the VIR_FREE calls can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: Sukrit Bhatnagar --- src/util/virbuffer.c | 15 +++---

[libvirt] [PATCH v1 04/40] util: buffer: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC

2018-07-21 Thread Sukrit Bhatnagar
Using the new VIR_DEFINE_AUTOPTR_FUNC macro defined in src/util/viralloc.h, define a new wrapper around an existing cleanup function which will be called when a variable declared with VIR_AUTOPTR macro goes out of scope. Also, drop the redundant viralloc.h include, since that has moved from the sou

[libvirt] [PATCH v1 06/40] util: buffer: use VIR_AUTOPTR for aggregate types

2018-07-21 Thread Sukrit Bhatnagar
By making use of GNU C's cleanup attribute handled by the VIR_AUTOPTR macro for declaring aggregate pointer variables, majority of the calls to *Free functions can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: Sukrit Bhatnagar --- src/util/virbuff

[libvirt] [PATCH v1 12/40] util: mdev: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-07-21 Thread Sukrit Bhatnagar
By making use of GNU C's cleanup attribute handled by the VIR_AUTOFREE macro for declaring scalar variables, majority of the VIR_FREE calls can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: Sukrit Bhatnagar --- src/util/virmdev.c | 53

[libvirt] [PATCH v1 21/40] util: pci: use VIR_AUTOPTR for aggregate types

2018-07-21 Thread Sukrit Bhatnagar
By making use of GNU C's cleanup attribute handled by the VIR_AUTOPTR macro for declaring aggregate pointer variables, majority of the calls to *Free functions can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: Sukrit Bhatnagar --- src/util/virpci.

[libvirt] [PATCH v1 10/40] util: cgroup: use VIR_AUTOPTR for aggregate types

2018-07-21 Thread Sukrit Bhatnagar
By making use of GNU C's cleanup attribute handled by the VIR_AUTOPTR macro for declaring aggregate pointer variables, majority of the calls to *Free functions can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: Sukrit Bhatnagar --- src/util/vircgro

[libvirt] [PATCH v1 27/40] util: scsi: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-07-21 Thread Sukrit Bhatnagar
By making use of GNU C's cleanup attribute handled by the VIR_AUTOFREE macro for declaring scalar variables, majority of the VIR_FREE calls can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: Sukrit Bhatnagar --- src/util/virscsi.c | 21 +++-

[libvirt] [PATCH v1 17/40] util: hook: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-07-21 Thread Sukrit Bhatnagar
By making use of GNU C's cleanup attribute handled by the VIR_AUTOFREE macro for declaring scalar variables, majority of the VIR_FREE calls can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: Sukrit Bhatnagar --- src/util/virhook.c | 16 +---

[libvirt] [PATCH v1 16/40] util: firewall: use VIR_AUTOPTR for aggregate types

2018-07-21 Thread Sukrit Bhatnagar
By making use of GNU C's cleanup attribute handled by the VIR_AUTOPTR macro for declaring aggregate pointer variables, majority of the calls to *Free functions can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: Sukrit Bhatnagar --- src/util/virfire

[libvirt] [PATCH v1 25/40] util: usb: use VIR_AUTOPTR for aggregate types

2018-07-21 Thread Sukrit Bhatnagar
By making use of GNU C's cleanup attribute handled by the VIR_AUTOPTR macro for declaring aggregate pointer variables, majority of the calls to *Free functions can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: Sukrit Bhatnagar --- src/util/virusb.

[libvirt] [PATCH v1 11/40] util: mdev: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC

2018-07-21 Thread Sukrit Bhatnagar
Using the new VIR_DEFINE_AUTOPTR_FUNC macro defined in src/util/viralloc.h, define a new wrapper around an existing cleanup function which will be called when a variable declared with VIR_AUTOPTR macro goes out of scope. Also, drop the redundant viralloc.h include, since that has moved from the sou

[libvirt] [PATCH v1 34/40] util: iptables: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-07-21 Thread Sukrit Bhatnagar
By making use of GNU C's cleanup attribute handled by the VIR_AUTOFREE macro for declaring scalar variables, majority of the VIR_FREE calls can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: Sukrit Bhatnagar --- src/util/viriptables.c | 52

[libvirt] [PATCH v1 20/40] util: pci: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-07-21 Thread Sukrit Bhatnagar
By making use of GNU C's cleanup attribute handled by the VIR_AUTOFREE macro for declaring scalar variables, majority of the VIR_FREE calls can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: Sukrit Bhatnagar --- src/util/virpci.c | 271

[libvirt] [PATCH v1 14/40] util: firewall: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC

2018-07-21 Thread Sukrit Bhatnagar
Using the new VIR_DEFINE_AUTOPTR_FUNC macro defined in src/util/viralloc.h, define a new wrapper around an existing cleanup function which will be called when a variable declared with VIR_AUTOPTR macro goes out of scope. Also, drop the redundant viralloc.h include, since that has moved from the sou

[libvirt] [PATCH v1 22/40] util: netdevvlan: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC

2018-07-21 Thread Sukrit Bhatnagar
Using the new VIR_DEFINE_AUTOPTR_FUNC macro defined in src/util/viralloc.h, define a new wrapper around an existing cleanup function which will be called when a variable declared with VIR_AUTOPTR macro goes out of scope. Also, drop the redundant viralloc.h include, since that has moved from the sou

[libvirt] [PATCH v1 13/40] util: mdev: use VIR_AUTOPTR for aggregate types

2018-07-21 Thread Sukrit Bhatnagar
By making use of GNU C's cleanup attribute handled by the VIR_AUTOPTR macro for declaring aggregate pointer variables, majority of the calls to *Free functions can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: Sukrit Bhatnagar --- src/util/virmdev

[libvirt] [PATCH v1 29/40] util: scsivhost: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC

2018-07-21 Thread Sukrit Bhatnagar
Using the new VIR_DEFINE_AUTOPTR_FUNC macro defined in src/util/viralloc.h, define a new wrapper around an existing cleanup function which will be called when a variable declared with VIR_AUTOPTR macro goes out of scope. Also, drop the redundant viralloc.h include, since that has moved from the sou

[libvirt] [PATCH v1 15/40] util: firewall: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-07-21 Thread Sukrit Bhatnagar
By making use of GNU C's cleanup attribute handled by the VIR_AUTOFREE macro for declaring scalar variables, majority of the VIR_FREE calls can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: Sukrit Bhatnagar --- src/util/virfirewall.c | 16 +---

[libvirt] [PATCH v1 23/40] util: usb: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC

2018-07-21 Thread Sukrit Bhatnagar
Using the new VIR_DEFINE_AUTOPTR_FUNC macro defined in src/util/viralloc.h, define a new wrapper around an existing cleanup function which will be called when a variable declared with VIR_AUTOPTR macro goes out of scope. Also, drop the redundant viralloc.h include, since that has moved from the sou

Re: [libvirt] [PATCH v2 2/5] Forget last daemon/ dir artefacts

2018-07-21 Thread John Ferlan
On 07/12/2018 03:37 AM, Michal Privoznik wrote: > The most important part is LIBVIRTD_PATH env var fix. It is used > in virFileFindResourceFull() from tests. The libvirtd no longer > lives under daemon/. > > Then, libvirtd-fail test was still failing (as expected) but not > because of missing c

[libvirt] [PATCH v1 18/40] util: hook: use VIR_AUTOPTR for aggregate types

2018-07-21 Thread Sukrit Bhatnagar
By making use of GNU C's cleanup attribute handled by the VIR_AUTOPTR macro for declaring aggregate pointer variables, majority of the calls to *Free functions can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: Sukrit Bhatnagar --- src/util/virhook

[libvirt] [PATCH v1 28/40] util: scsi: use VIR_AUTOPTR for aggregate types

2018-07-21 Thread Sukrit Bhatnagar
By making use of GNU C's cleanup attribute handled by the VIR_AUTOPTR macro for declaring aggregate pointer variables, majority of the calls to *Free functions can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: Sukrit Bhatnagar --- src/util/virscsi

[libvirt] [PATCH v1 26/40] util: scsi: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC

2018-07-21 Thread Sukrit Bhatnagar
Using the new VIR_DEFINE_AUTOPTR_FUNC macro defined in src/util/viralloc.h, define a new wrapper around an existing cleanup function which will be called when a variable declared with VIR_AUTOPTR macro goes out of scope. Also, drop the redundant viralloc.h include, since that has moved from the sou

[libvirt] [PATCH v1 39/40] util: lease: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-07-21 Thread Sukrit Bhatnagar
By making use of GNU C's cleanup attribute handled by the VIR_AUTOFREE macro for declaring scalar variables, majority of the VIR_FREE calls can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: Sukrit Bhatnagar --- src/util/virlease.c | 6 ++ 1 fi

[libvirt] [PATCH v1 19/40] util: pci: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC

2018-07-21 Thread Sukrit Bhatnagar
Using the new VIR_DEFINE_AUTOPTR_FUNC macro defined in src/util/viralloc.h, define a new wrapper around an existing cleanup function which will be called when a variable declared with VIR_AUTOPTR macro goes out of scope. Also, drop the redundant viralloc.h include, since that has moved from the sou

[libvirt] [PATCH v1 24/40] util: usb: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-07-21 Thread Sukrit Bhatnagar
By making use of GNU C's cleanup attribute handled by the VIR_AUTOFREE macro for declaring scalar variables, majority of the VIR_FREE calls can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: Sukrit Bhatnagar --- src/util/virusb.c | 18 +++--

[libvirt] [PATCH v1 31/40] util: hostdev: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-07-21 Thread Sukrit Bhatnagar
By making use of GNU C's cleanup attribute handled by the VIR_AUTOFREE macro for declaring scalar variables, majority of the VIR_FREE calls can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: Sukrit Bhatnagar --- src/util/virhostdev.c | 91 +

[libvirt] [PATCH v1 40/40] util: lease: use VIR_AUTOPTR for aggregate types

2018-07-21 Thread Sukrit Bhatnagar
By making use of GNU C's cleanup attribute handled by the VIR_AUTOPTR macro for declaring aggregate pointer variables, majority of the calls to *Free functions can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: Sukrit Bhatnagar --- src/util/virleas

[libvirt] [PATCH v1 35/40] util: iscsi: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-07-21 Thread Sukrit Bhatnagar
By making use of GNU C's cleanup attribute handled by the VIR_AUTOFREE macro for declaring scalar variables, majority of the VIR_FREE calls can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: Sukrit Bhatnagar --- src/util/viriscsi.c | 21 +--

[libvirt] [PATCH v1 36/40] util: iscsi: use VIR_AUTOPTR for aggregate types

2018-07-21 Thread Sukrit Bhatnagar
By making use of GNU C's cleanup attribute handled by the VIR_AUTOPTR macro for declaring aggregate pointer variables, majority of the calls to *Free functions can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: Sukrit Bhatnagar --- src/util/viriscs

[libvirt] [PATCH v1 37/40] util: kmod: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-07-21 Thread Sukrit Bhatnagar
By making use of GNU C's cleanup attribute handled by the VIR_AUTOFREE macro for declaring scalar variables, majority of the VIR_FREE calls can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: Sukrit Bhatnagar --- src/util/virkmod.c | 16 ++--

[libvirt] [PATCH v1 33/40] util: hostmem: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-07-21 Thread Sukrit Bhatnagar
By making use of GNU C's cleanup attribute handled by the VIR_AUTOFREE macro for declaring scalar variables, majority of the VIR_FREE calls can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: Sukrit Bhatnagar --- src/util/virhostmem.c | 57 +

[libvirt] [PATCH v1 32/40] util: hostdev: use VIR_AUTOPTR for aggregate types

2018-07-21 Thread Sukrit Bhatnagar
By making use of GNU C's cleanup attribute handled by the VIR_AUTOPTR macro for declaring aggregate pointer variables, majority of the calls to *Free functions can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: Sukrit Bhatnagar --- src/util/virhost

[libvirt] [PATCH v1 30/40] util: scsivhost: use VIR_AUTOPTR for aggregate types

2018-07-21 Thread Sukrit Bhatnagar
By making use of GNU C's cleanup attribute handled by the VIR_AUTOPTR macro for declaring aggregate pointer variables, majority of the calls to *Free functions can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: Sukrit Bhatnagar --- src/util/virscsi

[libvirt] [PATCH v1 38/40] util: kmod: use VIR_AUTOPTR for aggregate types

2018-07-21 Thread Sukrit Bhatnagar
By making use of GNU C's cleanup attribute handled by the VIR_AUTOPTR macro for declaring aggregate pointer variables, majority of the calls to *Free functions can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: Sukrit Bhatnagar --- src/util/virkmod

Re: [libvirt] [PATCH v2 1/5] qemuxml2argvtest: Set more fake drivers

2018-07-21 Thread John Ferlan
On 07/12/2018 05:00 AM, Michal Privoznik wrote: > On 07/12/2018 10:56 AM, Peter Krempa wrote: >> On Thu, Jul 12, 2018 at 10:51:33 +0200, Michal Privoznik wrote: >>> On 07/12/2018 10:01 AM, Peter Krempa wrote: On Thu, Jul 12, 2018 at 09:37:47 +0200, Michal Privoznik wrote: > So far we ar

Re: [libvirt] [PATCH v2 3/5] virtestmock: Track connect() too

2018-07-21 Thread John Ferlan
On 07/12/2018 03:37 AM, Michal Privoznik wrote: > The aim of this mock is to track if a test doesn't touch anything > in live system. Well, connect() which definitely falls into that > category isn't tracked yet. > > Signed-off-by: Michal Privoznik > --- > tests/virtestmock.c | 22 +++

Re: [libvirt] [PATCH v2 4/5] check-file-access: Allow specifying action

2018-07-21 Thread John Ferlan
On 07/12/2018 03:37 AM, Michal Privoznik wrote: > The check-file-access.pl script is used to match access list > generated by virtestmock against whitelisted rules stored in > file_access_whitelist.txt. So far the rules are in form: > > $path: $progname: $testname > > This is not sufficient

[libvirt] [PATCH] libvirt_iohelper: record the libvirt_iohelper's error message at virFileWrapperFdFree

2018-07-21 Thread xinhua.Cao
Currently iohelper's error log is recorded in virFileWrapperFdClose. In qemuDomainSaveMemory, it usually fails at qemuMigrationSrcToFile, and then goto cleanup, so the iohelper error log is not recorded, and so is the another placement. We now record the error log of iohelper by move it to the virF