Re: [libvirt] [PATCH v3 04/11] util: netlink: use VIR_AUTOPTR for aggregate types

2018-08-13 Thread Sukrit Bhatnagar
On Mon, 13 Aug 2018 at 18:10, Erik Skultety wrote: > > On Thu, Aug 09, 2018 at 09:42:12AM +0530, Sukrit Bhatnagar wrote: > > By making use of GNU C's cleanup attribute handled by the > > VIR_AUTOPTR macro for declaring aggregate pointer variables, > > majority of the call

Re: [libvirt] [PATCH v3 11/11] util: qemu: use VIR_AUTOPTR for aggregate types

2018-08-09 Thread Sukrit Bhatnagar
My bad. You can ignore this patch. On Thu, 9 Aug 2018 at 18:18, Erik Skultety wrote: > > On Thu, Aug 09, 2018 at 09:42:19AM +0530, Sukrit Bhatnagar wrote: > > By making use of GNU C's cleanup attribute handled by the > > VIR_AUTOPTR macro for declaring aggregate pointer varia

[libvirt] [PATCH v3 09/11] util: netdevip: use VIR_AUTOPTR for aggregate types

2018-08-09 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

[libvirt] [PATCH v3 06/11] util: netdevbridge: use VIR_AUTOPTR for aggregate types

2018-08-09 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

[libvirt] [PATCH v3 10/11] util: netdevopenvswitch: use VIR_AUTOPTR for aggregate types

2018-08-09 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

[libvirt] [PATCH v3 08/11] util: netdev: use VIR_AUTOPTR for aggregate types

2018-08-09 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

[libvirt] [PATCH v3 07/11] util: netdev: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-08-09 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/virnetdev.c | 343

[libvirt] [PATCH v3 11/11] util: qemu: use VIR_AUTOPTR for aggregate types

2018-08-09 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

[libvirt] [PATCH v3 01/11] util: iscsi: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-08-09 Thread Sukrit Bhatnagar
Add another usage for VIR_AUTOFREE macro which was left in the commit ec3e878, thereby dropping a VIR_FREE call and and a cleanup section. Signed-off-by: Sukrit Bhatnagar --- src/util/viriscsi.c | 22 ++ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src

[libvirt] [PATCH v3 03/11] util: netlink: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-08-09 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/virnetlink.c | 43

[libvirt] [PATCH v3 04/11] util: netlink: use VIR_AUTOPTR for aggregate types

2018-08-09 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

[libvirt] [PATCH v3 05/11] util: netdevbridge: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-08-09 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/virnetdevbridge.c | 46

[libvirt] [PATCH v3 00/11] use GNU C's cleanup attribute in src/util (batch III)

2018-08-09 Thread Sukrit Bhatnagar
patches which were not (completely) pushed upstream. [1] https://www.redhat.com/archives/libvir-list/2018-July/msg01947.html Sukrit Bhatnagar (11): util: iscsi: use VIR_AUTOFREE instead of VIR_FREE for scalar types util: netlink: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC util

[libvirt] [PATCH v3 02/11] util: netlink: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC

2018-08-09 Thread Sukrit Bhatnagar
the source module into the header. This commit also typedefs virNlMsg to struct nl_msg type for use with the cleanup macros. When a variable of type virNlMsg * is declared using VIR_AUTOPTR, the function nlmsg_free will be run automatically on it when it goes out of scope. Signed-off-by: Sukrit

[libvirt] [PATCH v2 28/35] util: numa: use VIR_AUTOPTR for aggregate types

2018-08-08 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

[libvirt] [PATCH v2 21/35] util: netdevmacvlan: use VIR_AUTOPTR for aggregate types

2018-08-08 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 Reviewed-by: Erik

[libvirt] [PATCH v2 18/35] util: netdevip: use VIR_AUTOPTR for aggregate types

2018-08-08 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

[libvirt] [PATCH v2 35/35] util: qemu: use VIR_AUTOPTR for aggregate types

2018-08-08 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

[libvirt] [PATCH v2 27/35] util: numa: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-08-08 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/virnuma.c | 75

[libvirt] [PATCH v2 22/35] util: netdevopenvswitch: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-08-08 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/virnetdevopenvswitch.c

[libvirt] [PATCH v2 33/35] util: process: use VIR_AUTOPTR for aggregate types

2018-08-08 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 Reviewed-by: Erik

[libvirt] [PATCH v2 30/35] util: perf: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-08-08 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 Reviewed-by: Erik Skultety --- src

[libvirt] [PATCH v2 23/35] util: netdevopenvswitch: use VIR_AUTOPTR for aggregate types

2018-08-08 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

[libvirt] [PATCH v2 25/35] util: netdevveth: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-08-08 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 Reviewed-by: Erik Skultety --- src

[libvirt] [PATCH v2 26/35] util: netdevveth: use VIR_AUTOPTR for aggregate types

2018-08-08 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 Reviewed-by: Erik

[libvirt] [PATCH v2 31/35] util: pidfile: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-08-08 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 Reviewed-by: Erik Skultety --- src

[libvirt] [PATCH v2 24/35] util: netdevtap: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-08-08 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 Reviewed-by: Erik Skultety --- src

[libvirt] [PATCH v2 32/35] util: process: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-08-08 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/virprocess.c | 39

[libvirt] [PATCH v2 34/35] util: qemu: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-08-08 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 Reviewed-by: Erik Skultety --- src

[libvirt] [PATCH v2 20/35] util: netdevmacvlan: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-08-08 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 Reviewed-by: Erik Skultety --- src

[libvirt] [PATCH v2 29/35] util: perf: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC

2018-08-08 Thread Sukrit Bhatnagar
the source module into the header. When a variable of type virPerfPtr is declared using VIR_AUTOPTR, the function virPerfFree will be run automatically on it when it goes out of scope. This commit also adds an intermediate typedef for virPerf type for use with the cleanup macros. Signed-off-by: Sukrit

[libvirt] [PATCH v2 17/35] util: netdevip: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-08-08 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/virnetdevip.c | 97

[libvirt] [PATCH v2 14/35] util: socketaddr: use VIR_AUTOPTR for aggregate types

2018-08-08 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 Reviewed-by: Erik

[libvirt] [PATCH v2 19/35] util: netdevmacvlan: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC

2018-08-08 Thread Sukrit Bhatnagar
with the cleanup macros. Signed-off-by: Sukrit Bhatnagar --- src/util/virnetdevmacvlan.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/util/virnetdevmacvlan.c b/src/util/virnetdevmacvlan.c index fb41bf9..91c6244 100644 --- a/src/util/virnetdevmacvlan.c +++ b/src/util

[libvirt] [PATCH v2 15/35] util: netdevip: define virNetDevIPAddrFree for use with cleanup macros

2018-08-08 Thread Sukrit Bhatnagar
Define a free function for virNetDevIPAddrPtr type for consistency and extensibility. Signed-off-by: Sukrit Bhatnagar --- src/util/virnetdevip.c | 6 ++ src/util/virnetdevip.h | 1 + 2 files changed, 7 insertions(+) diff --git a/src/util/virnetdevip.c b/src/util/virnetdevip.c index bf98ed8

[libvirt] [PATCH v2 13/35] util: socketaddr: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-08-08 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 Reviewed-by: Erik Skultety --- src

[libvirt] [PATCH v2 11/35] util: netdev: use VIR_AUTOPTR for aggregate types

2018-08-08 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

[libvirt] [PATCH v2 03/35] util: netlink: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC

2018-08-08 Thread Sukrit Bhatnagar
when they go out of scope. Signed-off-by: Sukrit Bhatnagar --- src/util/virnetlink.c | 3 ++- src/util/virnetlink.h | 5 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/util/virnetlink.c b/src/util/virnetlink.c index fa1ba3e..1c1eac7 100644 --- a/src/util/virnetlink.c +++ b

[libvirt] [PATCH v2 09/35] util: netdev: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC

2018-08-08 Thread Sukrit Bhatnagar
the source module into the header. When variables of type virNetDevRxFilterPtr and virNetDevMcastEntryPtr are declared using VIR_AUTOPTR, the functions virNetDevRxFilterFree and virNetDevMcastEntryFree, respectively, will be run automatically on them when they go out of scope. Signed-off-by: Sukrit

[libvirt] [PATCH v2 16/35] util: netdevip: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC

2018-08-08 Thread Sukrit Bhatnagar
the source module into the header. When variables of type virNetDevIPAddrPtr and virNetDevIPRoutePtr are declared using VIR_AUTOPTR, the functions virNetDevIPAddrFree and virNetDevIPRouteFree, respectively, will be run automatically on them when they go out of scope. Signed-off-by: Sukrit Bhatnagar

[libvirt] [PATCH v2 12/35] util: socketaddr: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC

2018-08-08 Thread Sukrit Bhatnagar
the source module into the header. When a variable of type virSocketAddrPtr is declared using VIR_AUTOPTR, the function virSocketAddrFree will be run automatically on it when it goes out of scope. Signed-off-by: Sukrit Bhatnagar Reviewed-by: Erik Skultety --- src/util/virsocketaddr.c | 7 ++- src

[libvirt] [PATCH v2 08/35] util: macaddr: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC

2018-08-08 Thread Sukrit Bhatnagar
the source module into the header. When a variable of type virMacAddrPtr is declared using VIR_AUTOPTR, the function virMacAddrFree will be run automatically on it when it goes out of scope. Signed-off-by: Sukrit Bhatnagar --- src/util/virmacaddr.c | 6 ++ src/util/virmacaddr.h | 4 2 files

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

2018-08-08 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 Reviewed-by: Erik Skultety --- src

[libvirt] [PATCH v2 10/35] util: netdev: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-08-08 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/virnetdev.c | 328

[libvirt] [PATCH v2 00/35] use GNU C's cleanup attribute in src/util (batch III)

2018-08-08 Thread Sukrit Bhatnagar
This third 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. Sukrit Bhatnagar (35): util: iscsi: use VIR_AUTOFREE instead of VIR_FREE for scalar

[libvirt] [PATCH v2 06/35] util: netdevbridge: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-08-08 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/virnetdevbridge.c | 46

[libvirt] [PATCH v2 07/35] util: netdevbridge: use VIR_AUTOPTR for aggregate types

2018-08-08 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

[libvirt] [PATCH v2 05/35] util: netlink: use VIR_AUTOPTR for aggregate types

2018-08-08 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

[libvirt] [PATCH v2 02/35] util: iscsi: use VIR_AUTOPTR for aggregate types

2018-08-08 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

[libvirt] [PATCH v2 04/35] util: netlink: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-08-08 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/virnetlink.c | 31

Re: [libvirt] [PATCH v1 17/32] util: netdevopenvswitch: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-08-05 Thread Sukrit Bhatnagar
On Fri, 3 Aug 2018 at 19:02, Erik Skultety wrote: > > On Sat, Jul 28, 2018 at 11:31:32PM +0530, Sukrit Bhatnagar wrote: > > By making use of GNU C's cleanup attribute handled by the > > VIR_AUTOFREE macro for declaring scalar variables, majority > > of the VIR_FREE cal

Re: [libvirt] [PATCH v1 13/32] util: netdevip: use VIR_AUTOPTR for aggregate types

2018-08-05 Thread Sukrit Bhatnagar
On Fri, 3 Aug 2018 at 18:58, Erik Skultety wrote: > > On Fri, Aug 03, 2018 at 06:46:28PM +0530, Sukrit Bhatnagar wrote: > > On Fri, 3 Aug 2018 at 18:41, Erik Skultety wrote: > > > > > > On Fri, Aug 03, 2018 at 06:38:30PM +0530, Sukrit Bhatnagar wrote: > > &

Re: [libvirt] [PATCH v1 13/32] util: netdevip: use VIR_AUTOPTR for aggregate types

2018-08-05 Thread Sukrit Bhatnagar
On Fri, 3 Aug 2018 at 18:32, Erik Skultety wrote: > > On Sat, Jul 28, 2018 at 11:31:28PM +0530, Sukrit Bhatnagar wrote: > > By making use of GNU C's cleanup attribute handled by the > > VIR_AUTOPTR macro for declaring aggregate pointer variables, > > majority of the call

Re: [libvirt] [PATCH v1 13/32] util: netdevip: use VIR_AUTOPTR for aggregate types

2018-08-05 Thread Sukrit Bhatnagar
On Fri, 3 Aug 2018 at 18:41, Erik Skultety wrote: > > On Fri, Aug 03, 2018 at 06:38:30PM +0530, Sukrit Bhatnagar wrote: > > On Fri, 3 Aug 2018 at 18:32, Erik Skultety wrote: > > > > > > On Sat, Jul 28, 2018 at 11:31:28PM +0530, Sukrit Bhatnagar wrote: > >

Re: [libvirt] [PATCH v1 03/32] util: netdevbridge: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-08-05 Thread Sukrit Bhatnagar
On Thu, 2 Aug 2018 at 19:33, Erik Skultety wrote: > > On Sat, Jul 28, 2018 at 11:31:18PM +0530, Sukrit Bhatnagar wrote: > > By making use of GNU C's cleanup attribute handled by the > > VIR_AUTOFREE macro for declaring scalar variables, majority > > of the VIR_FREE cal

Re: [libvirt] [PATCH v1 16/32] util: netdevmacvlan: use VIR_AUTOPTR for aggregate types

2018-08-03 Thread Sukrit Bhatnagar
On Fri, 3 Aug 2018 at 18:49, Erik Skultety wrote: > > On Sat, Jul 28, 2018 at 11:31:31PM +0530, Sukrit Bhatnagar wrote: > > By making use of GNU C's cleanup attribute handled by the > > VIR_AUTOPTR macro for declaring aggregate pointer variables, > > majority of the call

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

2018-07-28 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

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

2018-07-28 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/virperf.c | 17

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

2018-07-28 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/virnetdevip.c | 95

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

2018-07-28 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/virnetdevveth.c | 12

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

2018-07-28 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/virnuma.c | 79

[libvirt] [PATCH v1 28/32] util: pidfile: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-07-28 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/virpidfile.c | 185

[libvirt] [PATCH v1 23/32] util: netlink: use VIR_AUTOPTR for aggregate types

2018-07-28 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

[libvirt] [PATCH v1 21/32] util: netdevveth: use VIR_AUTOPTR for aggregate types

2018-07-28 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

[libvirt] [PATCH v1 26/32] util: perf: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC

2018-07-28 Thread Sukrit Bhatnagar
the source module into the header. When a variable of type virPerfPtr is declared using VIR_AUTOPTR, the function virPerfFree will be run automatically on it when it goes out of scope. This commit also adds an intermediate typedef for virPerf type for use with the cleanup macros. Signed-off-by: Sukrit

[libvirt] [PATCH v1 22/32] util: netlink: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC

2018-07-28 Thread Sukrit Bhatnagar
-by: Sukrit Bhatnagar --- src/util/virnetlink.c | 20 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/util/virnetlink.c b/src/util/virnetlink.c index fa1ba3e..8d28387 100644 --- a/src/util/virnetlink.c +++ b/src/util/virnetlink.c @@ -72,6 +72,10 @@ typedef struct

[libvirt] [PATCH v1 11/32] util: netdevip: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC

2018-07-28 Thread Sukrit Bhatnagar
the source module into the header. When variables of type virNetDevIPAddrPtr and virNetDevIPRoutePtr are declared using VIR_AUTOPTR, the functions virNetDevIPAddrFree and virNetDevIPRouteFree, respectively, will be run automatically on them when they go out of scope. Signed-off-by: Sukrit Bhatnagar

[libvirt] [PATCH v1 30/32] util: process: use VIR_AUTOPTR for aggregate types

2018-07-28 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

[libvirt] [PATCH v1 29/32] util: process: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-07-28 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/virprocess.c | 49

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

2018-07-28 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/virnetdevopenvswitch.c

[libvirt] [PATCH v1 19/32] util: netdevtap: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-07-28 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/virnetdevtap.c | 11

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

2018-07-28 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/virqemu.c | 26

[libvirt] [PATCH v1 25/32] util: numa: use VIR_AUTOPTR for aggregate types

2018-07-28 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

[libvirt] [PATCH v1 06/32] util: netdev: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-07-28 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/virnetdev.c | 276

[libvirt] [PATCH v1 07/32] util: netdev: use VIR_AUTOPTR for aggregate types

2018-07-28 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

[libvirt] [PATCH v1 14/32] util: netdevmacvlan: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC

2018-07-28 Thread Sukrit Bhatnagar
with the cleanup macros. Signed-off-by: Sukrit Bhatnagar --- src/util/virnetdevmacvlan.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/util/virnetdevmacvlan.c b/src/util/virnetdevmacvlan.c index fb41bf9..91c6244 100644 --- a/src/util/virnetdevmacvlan.c +++ b/src/util

[libvirt] [PATCH v1 03/32] util: netdevbridge: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-07-28 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/virnetdevbridge.c | 45

[libvirt] [PATCH v1 18/32] util: netdevopenvswitch: use VIR_AUTOPTR for aggregate types

2018-07-28 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

[libvirt] [PATCH v1 13/32] util: netdevip: use VIR_AUTOPTR for aggregate types

2018-07-28 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

[libvirt] [PATCH v1 08/32] util: socketaddr: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC

2018-07-28 Thread Sukrit Bhatnagar
the source module into the header. When a variable of type virSocketAddrPtr is declared using VIR_AUTOPTR, the function virSocketAddrFree will be run automatically on it when it goes out of scope. Signed-off-by: Sukrit Bhatnagar --- src/util/virsocketaddr.c | 7 ++- src/util/virsocketaddr.h | 9

[libvirt] [PATCH v1 16/32] util: netdevmacvlan: use VIR_AUTOPTR for aggregate types

2018-07-28 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

[libvirt] [PATCH v1 10/32] util: socketaddr: use VIR_AUTOPTR for aggregate types

2018-07-28 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

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

2018-07-28 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 | 31

[libvirt] [PATCH v1 02/32] util: iscsi: use VIR_AUTOPTR for aggregate types

2018-07-28 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

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

2018-07-28 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/virsocketaddr.c | 70

[libvirt] [PATCH v1 04/32] util: macaddr: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC

2018-07-28 Thread Sukrit Bhatnagar
the source module into the header. When a variable of type virMacAddrPtr is declared using VIR_AUTOPTR, the function virMacAddrFree will be run automatically on it when it goes out of scope. Signed-off-by: Sukrit Bhatnagar --- src/util/virmacaddr.c | 6 ++ src/util/virmacaddr.h | 4 2 files

[libvirt] [PATCH v1 05/32] util: netdev: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC

2018-07-28 Thread Sukrit Bhatnagar
the source module into the header. When variables of type virNetDevRxFilterPtr and virNetDevMcastEntryPtr are declared using VIR_AUTOPTR, the functions virNetDevRxFilterFree and virNetDevMcastEntryFree, respectively, will be run automatically on them when they go out of scope. Signed-off-by: Sukrit

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

2018-07-28 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/virnetdevmacvlan.c | 6

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

2018-07-28 Thread Sukrit Bhatnagar
This third 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. Sukrit Bhatnagar (32): util: iscsi: use VIR_AUTOFREE instead of VIR_FREE for scalar

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

2018-07-26 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 Reviewed-by: Erik Skultety --- src

[libvirt] [PATCH v2 32/41] util: hostdev: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-07-26 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 Reviewed-by: Erik Skultety --- src

[libvirt] [PATCH v2 41/41] util: lease: use VIR_AUTOPTR for aggregate types

2018-07-26 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 Reviewed-by: Erik

[libvirt] [PATCH v2 22/41] util: usb: modify virUSBDeviceListAdd to take double pointer

2018-07-26 Thread Sukrit Bhatnagar
Modify virUSBDeviceListAdd to take a double pointer to virUSBDevicePtr as the second argument. This will enable usage of cleanup macros upon the virUSBDevicePtr item which is to be added to the list as it will be cleared by virInsertElementsN upon success. Signed-off-by: Sukrit Bhatnagar

[libvirt] [PATCH v2 36/41] util: iscsi: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-07-26 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 Reviewed-by: Erik Skultety --- src

[libvirt] [PATCH v2 39/41] util: kmod: use VIR_AUTOPTR for aggregate types

2018-07-26 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 Reviewed-by: Erik

[libvirt] [PATCH v2 38/41] util: kmod: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-07-26 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 Reviewed-by: Erik Skultety --- src

[libvirt] [PATCH v2 16/41] util: firewall: use VIR_AUTOPTR for aggregate types

2018-07-26 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 Reviewed-by: Erik

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

2018-07-26 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 Reviewed-by: Erik Skultety --- src

[libvirt] [PATCH v2 19/41] util: pci: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC

2018-07-26 Thread Sukrit Bhatnagar
of scope. Signed-off-by: Sukrit Bhatnagar Reviewed-by: Erik Skultety --- src/util/virpci.c | 7 ++- src/util/virpci.h | 7 +++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/util/virpci.c b/src/util/virpci.c index 8d02366..46f9905 100644 --- a/src/util/virpci.c +++ b

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

2018-07-26 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 Reviewed-by: Erik Skultety --- src

  1   2   3   4   >