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
---
viralloc.h is pulled in by virauthconfig.h
Signed-off-by: Sukrit Bhatnagar
Reviewed-by: Erik Skultety
---
src/util/virauthconfig.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/util/virauthconfig.c b/src/util/virauthconfig.c
index 91c9c0c..3487cc2 100644
--- a/src/util/virauthconfig.c
function virCommandFree will be run automatically on it when it
goes out of scope.
Signed-off-by: Sukrit Bhatnagar
Reviewed-by: Erik Skultety
---
src/util/vircommand.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/util/vircommand.h b/src/util/vircommand.h
index 883e212..90bcc6c 100644
function virAuthConfigFree will be run
automatically on it when it goes out of scope.
Signed-off-by: Sukrit Bhatnagar
Reviewed-by: Erik Skultety
---
src/util/virauthconfig.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/util/virauthconfig.h b/src/util/virauthconfig.h
index ac0ceeb
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
---
viralloc.h is pulled in by vircommand.h
Signed-off-by: Sukrit Bhatnagar
Reviewed-by: Erik Skultety
---
src/util/vircommand.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/util/vircommand.c b/src/util/vircommand.c
index 6dab105..8681e7b 100644
--- a/src/util/vircommand.c
+++ b/src/util
list of strings (char **).
When a list of strings (virString *) is declared using VIR_AUTOPTR,
the function virStringListFree will be run automatically on it when
it goes out of scope.
Signed-off-by: Sukrit Bhatnagar
Reviewed-by: Erik Skultety
---
src/util/virstring.h | 5 +
1 file changed
New macros are introduced which help in adding GNU C's cleanup
attribute to variable declarations. Variables declared with these
macros will have their allocated memory freed automatically when
they go out of scope.
Signed-off-by: Sukrit Bhatnagar
Reviewed-by: Erik Skultety
---
src
il 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 (31):
util: alloc: add macros for implementing automatic cleanup
functionality
cfg.mk: variable initialization when declared with cl
-by: Sukrit Bhatnagar
Reviewed-by: Erik Skultety
---
cfg.mk | 11 +++
1 file changed, 11 insertions(+)
diff --git a/cfg.mk b/cfg.mk
index 6bebd0a..609ae86 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -1057,6 +1057,17 @@ sc_prohibit_backslash_alignment:
halt='Do not attempt to right-
On Thu, 12 Jul 2018 at 22:09, Erik Skultety wrote:
>
> On Sat, Jun 30, 2018 at 02:30:05PM +0530, Sukrit Bhatnagar wrote:
> > New macros are introduced which help in adding GNU C's cleanup
> > attribute to variable declarations. Variables declared with these
> > mac
wrote:
>
> On Wed, Jul 11, 2018 at 10:35:25AM +0200, Pavel Hrdina wrote:
> > On Wed, Jul 11, 2018 at 12:42:43AM +0530, Sukrit Bhatnagar wrote:
> > > On Tue, 10 Jul 2018 at 16:24, Erik Skultety wrote:
> > > >
> > > > On Sat, Jun 30, 2018 at 02:30:08PM +053
On Tue, 10 Jul 2018 at 16:30, Erik Skultety wrote:
>
> On Sat, Jun 30, 2018 at 02:30:09PM +0530, Sukrit Bhatnagar wrote:
> > Add rule to ensure that there is no semicolon at the end of
> > the line where a VIR_DEFINE_* cleanup macro is invoked.
> >
> > S
On Tue, 10 Jul 2018 at 16:24, Erik Skultety wrote:
>
> On Sat, Jun 30, 2018 at 02:30:08PM +0530, Sukrit Bhatnagar wrote:
> > Add rule to ensure that each variable declaration made using
> > a cleanup macro is in its own separate line.
> >
> > Sometimes a variable mig
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/virarptable.c
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/virfilecache.c
function virJSONValueFree will be run
automatically on it when it goes out of scope.
Signed-off-by: Sukrit Bhatnagar
---
src/util/virjson.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/util/virjson.h b/src/util/virjson.h
index e4a82bd..75f7f17 100644
--- a/src/util/virjson.h
+++ b
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
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/virfcp.c
, the function virFileWrapperFdFree will be run
automatically on it when it goes out of scope.
Signed-off-by: Sukrit Bhatnagar
---
src/util/virfile.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/util/virfile.h b/src/util/virfile.h
index 6f1e802..b30a1d3 100644
--- a/src/util/virfile.h
The include directive for viralloc.h is added in virauthconfig.h
in a previous patch.
Signed-off-by: Sukrit Bhatnagar
---
src/util/virauth.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/util/virauth.c b/src/util/virauth.c
index adb093e..c6a2ce7 100644
--- a/src/util/virauth.c
+++ b
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/iohelper.c | 4 +-
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/virjson.c
The include directive for viralloc.h is added in virauthconfig.h
in a previous patch.
Signed-off-by: Sukrit Bhatnagar
---
src/util/virauthconfig.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/util/virauthconfig.c b/src/util/virauthconfig.c
index 91c9c0c..3487cc2 100644
--- a/src/util
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/virauth.c
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/viridentity.c
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
function virBitmapFree will be run
automatically on it when it goes out of scope.
Signed-off-by: Sukrit Bhatnagar
---
src/util/virbitmap.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/util/virbitmap.h b/src/util/virbitmap.h
index 2464814..312e7e2 100644
--- a/src/util/virbitmap.h
+++ b
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/vireventpoll.
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
The include directive for viralloc.h is added in virbitmap.h
in a previous patch.
Signed-off-by: Sukrit Bhatnagar
---
src/util/virbitmap.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/util/virbitmap.c b/src/util/virbitmap.c
index 0cc5292..ef18dad 100644
--- a/src/util/virbitmap.c
The include directive for viralloc.h is added in virjson.h
in a previous patch.
Signed-off-by: Sukrit Bhatnagar
---
src/util/virjson.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/util/virjson.c b/src/util/virjson.c
index 0559d40..92f3994 100644
--- a/src/util/virjson.c
+++ b/src/util
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/viraudit.c | 3 +--
1
The include directive for viralloc.h is added in virfile.h
in a previous patch.
Signed-off-by: Sukrit Bhatnagar
---
src/util/virfile.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/util/virfile.c b/src/util/virfile.c
index 378d03e..2690e2d 100644
--- a/src/util/virfile.c
+++ b/src/util
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/virauthconfig.c
function virStringListFree will be run automatically on it when
it goes out of scope.
Signed-off-by: Sukrit Bhatnagar
---
src/util/virstring.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/util/virstring.h b/src/util/virstring.h
index ac930fd..726e02b 100644
--- a/src/util/virstring.h
multiple declarations in a line. This rule takes care of
that too.
Signed-off-by: Sukrit Bhatnagar
---
cfg.mk | 8
1 file changed, 8 insertions(+)
diff --git a/cfg.mk b/cfg.mk
index d9e90d5..7949fc8 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -1077,6 +1077,14
The include directive for viralloc.h is added in vircommand.h
in a previous patch.
Signed-off-by: Sukrit Bhatnagar
---
src/util/vircommand.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/util/vircommand.c b/src/util/vircommand.c
index 6dab105..8681e7b 100644
--- a/src/util/vircommand.c
Add rule to ensure that there is no semicolon at the end of
the line where a VIR_DEFINE_* cleanup macro is invoked.
Signed-off-by: Sukrit Bhatnagar
---
cfg.mk | 9 +
1 file changed, 9 insertions(+)
diff --git a/cfg.mk b/cfg.mk
index 7949fc8..d292005 100644
--- a/cfg.mk
+++ b/cfg.mk
function virCommandFree will be run automatically on it when it
goes out of scope.
Signed-off-by: Sukrit Bhatnagar
---
src/util/vircommand.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/util/vircommand.h b/src/util/vircommand.h
index 883e212..90bcc6c 100644
--- a/src/util/vircommand.h
function virAuthConfigFree will be run
automatically on it when it goes out of scope.
Signed-off-by: Sukrit Bhatnagar
---
src/util/virauthconfig.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/util/virauthconfig.h b/src/util/virauthconfig.h
index ac0ceeb..d8a3849 100644
--- a/src
Alias virString to (char *) so that the new cleanup macros
can be used for a list of strings (char **).
Signed-off-by: Sukrit Bhatnagar
---
src/util/virstring.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/util/virstring.h b/src/util/virstring.h
index 607ae66..ac930fd 100644
--- a
Add rule to ensure that there is exactly one blank space between
the type name and the asterisk when passed as the argument to the
VIR_AUTOFREE macro.
Signed-off-by: Sukrit Bhatnagar
---
cfg.mk | 9 +
1 file changed, 9 insertions(+)
diff --git a/cfg.mk b/cfg.mk
index 196d1b2..d9e90d5
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/vircommand.c
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
il 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: alloc: add macros for implementing automatic cleanup
functionality
cfg.mk: variable initialization when declared with cl
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
-by: Sukrit Bhatnagar
---
cfg.mk | 11 +++
1 file changed, 11 insertions(+)
diff --git a/cfg.mk b/cfg.mk
index 6bebd0a..196d1b2 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -1057,6 +1057,17 @@ sc_prohibit_backslash_alignment:
halt='Do not attempt to right-align backsl
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/virfile.c
New macros are introduced which help in adding GNU C's cleanup
attribute to variable declarations. Variables declared with these
macros will have their allocated memory freed automatically when
they go out of scope.
Signed-off-by: Sukrit Bhatnagar
---
src/util/viralloc.h
On Mon, 18 Jun 2018 at 17:20, Andrea Bolognani wrote:
>
> On Mon, 2018-06-18 at 11:52 +0100, Daniel P. Berrangé wrote:
> > On Mon, Jun 18, 2018 at 12:24:39PM +0200, Pavel Hrdina wrote:
> > > # define VIR_DEFINE_AUTOCLEAR_FUNC(type, func) \
> > > static inline void VIR_AUTOCLEAR_FUNC_NAME(type)
; > On Mon, Jun 11, 2018 at 12:12:16PM +0200, Pavel Hrdina wrote:
> > > > > On Sat, Jun 09, 2018 at 11:12:29PM +0200, Martin Kletzander wrote:
> > > > > > On Sat, Jun 09, 2018 at 10:06:55PM +0530, Sukrit Bhatnagar wrote:
> > > > > > > Hi,
> &
Hi,
I am starting this discussion thread as a continuation of my GSoC
weekly meeting with Erik and Pavel on 8th June.
I was going through src/util/virstring.c for adding cleanup macros and
saw that virStringListFree takes on char ** as an argument, and
equivalently, we declare a list of strings a
The include directive for viralloc.h is added in virbitmap.h
in the previous patch.
---
src/util/virbitmap.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/util/virbitmap.c b/src/util/virbitmap.c
index 0cc5292..ef18dad 100644
--- a/src/util/virbitmap.c
+++ b/src/util/virbitmap.c
@@ -31,7 +
By making use of the GCC's __attribute__((cleanup)) handled by VIR_AUTOPTR
macro, majority of the calls to *Free functions can be dropped, which in
turn leads to getting rid of most of our cleanup sections.
---
src/util/virbitmap.c | 7 ++-
1 file changed, 2 insertions(+), 5 deletions(-)
diff
The include directive for viralloc.h is added in virjson.h
in the previous patch.
---
src/util/virjson.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/util/virjson.c b/src/util/virjson.c
index 0559d40..92f3994 100644
--- a/src/util/virjson.c
+++ b/src/util/virjson.c
@@ -24,7 +24,6 @@
#in
Using the 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.
---
src/util/virbitmap.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/s
By making use of the GCC's __attribute__((cleanup)) handled by VIR_AUTOFREE
macro, majority of the VIR_FREE calls can be dropped, which in turn leads to
getting rid of most of our cleanup sections.
---
src/util/viridentity.c | 54 --
1 file changed,
By making use of the GCC's __attribute__((cleanup)) handled by VIR_AUTOFREE
macro, majority of the VIR_FREE calls can be dropped, which in turn leads to
getting rid of most of our cleanup sections.
---
src/util/virjson.c | 29 +
1 file changed, 9 insertions(+), 20 delet
By making use of the GCC's __attribute__((cleanup)) handled by VIR_AUTOPTR
macro, majority of the calls to *Free functions can be dropped, which in
turn leads to getting rid of most of our cleanup sections.
---
src/util/virjson.c | 15 ---
1 file changed, 4 insertions(+), 11 deletions(
By making use of the GCC's __attribute__((cleanup)) handled by VIR_AUTOPTR
macro, majority of the calls to *Free functions can be dropped, which in
turn leads to getting rid of most of our cleanup sections.
---
src/util/virauth.c | 15 +--
1 file changed, 5 insertions(+), 10 deletions(
The include directive for viralloc.h is added in virauthconfig.h
in the previous patch.
---
src/util/virauthconfig.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/util/virauthconfig.c b/src/util/virauthconfig.c
index 91c9c0c..3487cc2 100644
--- a/src/util/virauthconfig.c
+++ b/src/util/vi
By making use of the GCC's __attribute__((cleanup)) handled by VIR_AUTOFREE
macro, majority of the VIR_FREE calls can be dropped, which in turn leads to
getting rid of most of our cleanup sections.
---
src/util/virauth.c | 45 +
1 file changed, 13 insert
Using the 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.
---
src/util/virjson.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src
Using the 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.
---
src/util/virauthconfig.h | 3 +++
1 file changed, 3 insertions(+)
diff --git
By making use of the GCC's __attribute__((cleanup)) handled by VIR_AUTOFREE
macro, majority of the VIR_FREE calls can be dropped, which in turn leads to
getting rid of most of our cleanup sections.
---
src/util/virfcp.c | 20 ++--
1 file changed, 6 insertions(+), 14 deletions(-)
d
The include directive for viralloc.h is added in virauthconfig.h
in a previous patch.
---
src/util/virauth.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/util/virauth.c b/src/util/virauth.c
index adb093e..c6a2ce7 100644
--- a/src/util/virauth.c
+++ b/src/util/virauth.c
@@ -26,7 +26,6 @@
By making use of the GCC's __attribute__((cleanup)) handled by VIR_AUTOFREE
macro, majority of the VIR_FREE calls can be dropped, which in turn leads to
getting rid of most of our cleanup sections.
---
src/util/virauthconfig.c | 34 --
1 file changed, 12 insertions(
By making use of the GCC's __attribute__((cleanup)) handled by VIR_AUTOFREE
macro, majority of the VIR_FREE calls can be dropped, which in turn leads to
getting rid of most of our cleanup sections.
---
src/util/viraudit.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/ut
By making use of the GCC's __attribute__((cleanup)) handled by VIR_AUTOFREE
macro, majority of the VIR_FREE calls can be dropped, which in turn leads to
getting rid of most of our cleanup sections.
---
src/util/virfilecache.c | 35 +++
1 file changed, 11 insertions(
By making use of the GCC's __attribute__((cleanup)) handled by VIR_AUTOFREE
macro, majority of the VIR_FREE calls can be dropped, which in turn leads to
getting rid of most of our cleanup sections.
---
src/util/vireventpoll.c | 7 ++-
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git
By making use of the GCC's __attribute__((cleanup)) handled by VIR_AUTOFREE
macro, majority of the VIR_FREE calls can be dropped, which in turn leads to
getting rid of most of our cleanup sections.
---
src/util/iohelper.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/u
New macros are added to src/util/viralloc.h which help in
adding GCC's cleanup attribute to variable declarations.
---
src/util/viralloc.h | 68 +
1 file changed, 68 insertions(+)
diff --git a/src/util/viralloc.h b/src/util/viralloc.h
index 69d0
*Free function calls.
Sukrit Bhatnagar (21):
add macros for implementing automatic cleanup functionality
util: arptable: use VIR_AUTOFREE instead of VIR_FREE for scalar types
util: iohelper: use VIR_AUTOFREE instead of VIR_FREE for scalar types
util: audit: use VIR_AUTOFREE instead of VIR_FRE
By making use of the GCC's __attribute__((cleanup)) handled by VIR_AUTOFREE
macro, majority of the VIR_FREE calls can be dropped, which in turn leads to
getting rid of most of our cleanup sections.
---
src/util/virarptable.c | 14 +++---
1 file changed, 3 insertions(+), 11 deletions(-)
di
On Wed, 6 Jun 2018 at 21:25, Erik Skultety wrote:
>
> On Wed, Jun 06, 2018 at 06:42:29PM +0530, Sukrit Bhatnagar wrote:
> > On Tue, 5 Jun 2018 at 21:00, Erik Skultety wrote:
> > >
> > > On Sun, Jun 03, 2018 at 01:41:59PM +0530, Sukrit Bhatnagar wrote:
> >
On Tue, 5 Jun 2018 at 21:00, Erik Skultety wrote:
>
> On Sun, Jun 03, 2018 at 01:41:59PM +0530, Sukrit Bhatnagar wrote:
> > New macros are added to src/util/viralloc.h which help in
> > adding cleanup attribute to variable declarations.
> >
> > Signed-off-by: Sukri
Modify code to use VIR_AUTOFREE macro wherever required.
Signed-off-by: Sukrit Bhatnagar
---
src/util/virfdstream.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/util/virfdstream.c b/src/util/virfdstream.c
index e4973a2..e7befbc 100644
--- a/src/util/virfdstream.c
Modify code to use VIR_AUTOFREE macro wherever required.
Signed-off-by: Sukrit Bhatnagar
---
src/util/virconf.c | 42 --
1 file changed, 12 insertions(+), 30 deletions(-)
diff --git a/src/util/virconf.c b/src/util/virconf.c
index e0a3fd1..7dd8820 100644
Modify code to use VIR_AUTOFREE macro wherever required.
Signed-off-by: Sukrit Bhatnagar
---
src/util/virfile.c | 303 +
1 file changed, 99 insertions(+), 204 deletions(-)
diff --git a/src/util/virfile.c b/src/util/virfile.c
index 523241f
Modify code to use VIR_AUTOFREE macro wherever required.
Signed-off-by: Sukrit Bhatnagar
---
src/util/vireventpoll.c | 7 ++-
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/src/util/vireventpoll.c b/src/util/vireventpoll.c
index 81ecab4..13d278d 100644
--- a/src/util
Modify code to use VIR_AUTOFREE macro wherever required.
Signed-off-by: Sukrit Bhatnagar
---
src/util/virdbus.c | 28 +++-
1 file changed, 7 insertions(+), 21 deletions(-)
diff --git a/src/util/virdbus.c b/src/util/virdbus.c
index ba8b684..66dbe41 100644
--- a/src/util
Modify code to use VIR_AUTOFREE macro wherever required.
Signed-off-by: Sukrit Bhatnagar
---
src/util/virdnsmasq.c | 116 +-
1 file changed, 39 insertions(+), 77 deletions(-)
diff --git a/src/util/virdnsmasq.c b/src/util/virdnsmasq.c
index
Modify code to use VIR_AUTOFREE macro wherever required.
Signed-off-by: Sukrit Bhatnagar
---
src/util/virhook.c | 16 +---
1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/src/util/virhook.c b/src/util/virhook.c
index facd74a..51f0eb5 100644
--- a/src/util/virhook.c
Modify code to use VIR_AUTOFREE macro wherever required.
Signed-off-by: Sukrit Bhatnagar
---
src/util/virbuffer.c | 33 -
1 file changed, 16 insertions(+), 17 deletions(-)
diff --git a/src/util/virbuffer.c b/src/util/virbuffer.c
index 3d6defb..5152f73 100644
Modify code to use VIR_AUTOFREE macro wherever required.
Signed-off-by: Sukrit Bhatnagar
---
src/util/virfilecache.c | 35 +++
1 file changed, 11 insertions(+), 24 deletions(-)
diff --git a/src/util/virfilecache.c b/src/util/virfilecache.c
index dab7216..49049b7
Modify code to use VIR_AUTOFREE macro wherever required.
Signed-off-by: Sukrit Bhatnagar
---
src/util/iohelper.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/util/iohelper.c b/src/util/iohelper.c
index bb8a8dd..f7794dc 100644
--- a/src/util/iohelper.c
+++ b/src
Modify code to use VIR_AUTOFREE macro wherever required.
Signed-off-by: Sukrit Bhatnagar
---
src/util/virfcp.c | 20 ++--
1 file changed, 6 insertions(+), 14 deletions(-)
diff --git a/src/util/virfcp.c b/src/util/virfcp.c
index 7660ba7..b703744 100644
--- a/src/util/virfcp.c
Modify code to use VIR_AUTOFREE macro wherever required.
Signed-off-by: Sukrit Bhatnagar
---
src/util/virfirewall.c | 13 -
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/src/util/virfirewall.c b/src/util/virfirewall.c
index 10c370a..568612c 100644
--- a/src/util
Modify code to use VIR_AUTOFREE macro wherever required.
Signed-off-by: Sukrit Bhatnagar
---
src/util/virauthconfig.c | 34 --
1 file changed, 12 insertions(+), 22 deletions(-)
diff --git a/src/util/virauthconfig.c b/src/util/virauthconfig.c
index 91c9c0c
Modify code to use VIR_AUTOFREE macro wherever required.
Signed-off-by: Sukrit Bhatnagar
---
src/util/vircgroup.c | 526 ++-
1 file changed, 179 insertions(+), 347 deletions(-)
diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
index
Modify code to use VIR_AUTOFREE macro wherever required.
Signed-off-by: Sukrit Bhatnagar
---
src/util/virauth.c | 60 +++---
1 file changed, 21 insertions(+), 39 deletions(-)
diff --git a/src/util/virauth.c b/src/util/virauth.c
index adb093e
Modify code to use VIR_AUTOFREE macro wherever required.
Signed-off-by: Sukrit Bhatnagar
---
src/util/viraudit.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/util/viraudit.c b/src/util/viraudit.c
index 0085dc3..a49d458 100644
--- a/src/util/viraudit.c
+++ b/src/util
New macros are added to src/util/viralloc.h which help in
adding cleanup attribute to variable declarations.
Signed-off-by: Sukrit Bhatnagar
---
src/util/viralloc.h | 69 +
1 file changed, 69 insertions(+)
diff --git a/src/util/viralloc.h b
Modify code to use VIR_AUTOFREE macro wherever required.
Signed-off-by: Sukrit Bhatnagar
---
src/util/virarptable.c | 9 ++---
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/src/util/virarptable.c b/src/util/virarptable.c
index c0e90dc..f53a479 100644
--- a/src/util
This series of patches modifies some files in src/util
to use VIR_AUTOFREE for automatic freeing of memory and
get rid of some VIR_FREE macro invocations.
Sukrit Bhatnagar (18):
add macros for implementing automatic cleanup functionality
use VIR_AUTOFREE in src/util/virarptable.c
use
Define a new cleanup function for virAuthConfigPtr in
src/util/virauthconfig.h.
Modifiy code to use cleanup macros where required.
Signed-off-by: Sukrit Bhatnagar
---
src/util/virauth.c | 66 ++--
src/util/virauthconfig.h | 3 +++
2 files
Modifiy code to use cleanup macros where required.
Signed-off-by: Sukrit Bhatnagar
---
src/util/virarptable.c | 9 ++---
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/src/util/virarptable.c b/src/util/virarptable.c
index c0e90dc..f53a479 100644
--- a/src/util/virarptable.c
Modifiy code to use cleanup macros where required.
Signed-off-by: Sukrit Bhatnagar
---
src/util/virauthconfig.c | 34 --
1 file changed, 12 insertions(+), 22 deletions(-)
diff --git a/src/util/virauthconfig.c b/src/util/virauthconfig.c
index 91c9c0c..66f7f7e
New macros are added to src/util/viralloc.h which help in
adding cleanup attribute to variable declarations.
Signed-off-by: Sukrit Bhatnagar
---
src/util/viralloc.h | 69 +
1 file changed, 69 insertions(+)
diff --git a/src/util/viralloc.h b
201 - 300 of 322 matches
Mail list logo