Re: [libvirt] [GSoC] Code design for scalar and external types

2018-06-26 Thread Pavel Hrdina
On Mon, Jun 25, 2018 at 10:22:14AM +0200, Erik Skultety wrote: > On Mon, Jun 18, 2018 at 11:52:04AM +0100, Daniel P. Berrangé wrote: > > On Mon, Jun 18, 2018 at 12:24:39PM +0200, Pavel Hrdina wrote: > > > Hi, > > > > > > It took me longer to sit down and write this mail but here it goes. > > > > >

Re: [libvirt] [GSoC] Code design for scalar and external types

2018-06-25 Thread Erik Skultety
On Fri, Jun 22, 2018 at 04:43:35AM +0530, Sukrit Bhatnagar wrote: > 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

Re: [libvirt] [GSoC] Code design for scalar and external types

2018-06-25 Thread Erik Skultety
On Mon, Jun 18, 2018 at 11:52:04AM +0100, Daniel P. Berrangé wrote: > On Mon, Jun 18, 2018 at 12:24:39PM +0200, Pavel Hrdina wrote: > > Hi, > > > > It took me longer to sit down and write this mail but here it goes. > > > > There was a lot of ideas about the macro design and it's easy to > > get

Re: [libvirt] [GSoC] Code design for scalar and external types

2018-06-21 Thread Sukrit Bhatnagar
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

Re: [libvirt] [GSoC] Code design for scalar and external types

2018-06-18 Thread Andrea Bolognani
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)(type *_ptr) \ > > { \ > > (func)(_ptr); \ > > }

Re: [libvirt] [GSoC] Code design for scalar and external types

2018-06-18 Thread Daniel P . Berrangé
On Mon, Jun 18, 2018 at 12:24:39PM +0200, Pavel Hrdina wrote: > Hi, > > It took me longer to sit down and write this mail but here it goes. > > There was a lot of ideas about the macro design and it's easy to > get lost in all the designs. > > So we agreed on this form: > > > # define

Re: [libvirt] [GSoC] Code design for scalar and external types

2018-06-18 Thread Pavel Hrdina
Hi, It took me longer to sit down and write this mail but here it goes. There was a lot of ideas about the macro design and it's easy to get lost in all the designs. So we agreed on this form: # define VIR_AUTOPTR_FUNC_NAME(type) virAutoPtr##type # define VIR_AUTOCLEAR_FUNC_NAME(type)

Re: [libvirt] [GSoC] Code design for scalar and external types

2018-06-13 Thread Andrea Bolognani
On Wed, 2018-06-13 at 12:59 +0200, Pavel Hrdina wrote: > On Wed, Jun 13, 2018 at 12:54:54PM +0200, Andrea Bolognani wrote: > > On Mon, 2018-06-11 at 12:12 +0200, Pavel Hrdina wrote: > > > That way we can use any existing free function regardless whether it > > > checks if the variable is NULL or

Re: [libvirt] [GSoC] Code design for scalar and external types

2018-06-13 Thread Daniel P . Berrangé
On Wed, Jun 13, 2018 at 12:54:54PM +0200, Andrea Bolognani wrote: > On Mon, 2018-06-11 at 12:12 +0200, Pavel Hrdina wrote: > > Another issue that we need to take into account is that the external > > free functions might not be 'NULL' safe which we need to somehow ensure > > if they will be used

Re: [libvirt] [GSoC] Code design for scalar and external types

2018-06-13 Thread Pavel Hrdina
On Wed, Jun 13, 2018 at 12:54:54PM +0200, Andrea Bolognani wrote: > On Mon, 2018-06-11 at 12:12 +0200, Pavel Hrdina wrote: > > Another issue that we need to take into account is that the external > > free functions might not be 'NULL' safe which we need to somehow ensure > > if they will be used

Re: [libvirt] [GSoC] Code design for scalar and external types

2018-06-13 Thread Andrea Bolognani
On Mon, 2018-06-11 at 12:12 +0200, Pavel Hrdina wrote: > Another issue that we need to take into account is that the external > free functions might not be 'NULL' safe which we need to somehow ensure > if they will be used with attribute cleanup. > > The original design is probably wrong and was

Re: [libvirt] [GSoC] Code design for scalar and external types

2018-06-13 Thread Erik Skultety
On Mon, Jun 11, 2018 at 11:59:06PM +0530, Sukrit Bhatnagar wrote: > On Mon, 11 Jun 2018 at 16:35, Pavel Hrdina wrote: > > > > On Mon, Jun 11, 2018 at 12:59:11PM +0200, Martin Kletzander wrote: > > > On Mon, Jun 11, 2018 at 12:53:47PM +0200, Erik Skultety wrote: > > > > On Mon, Jun 11, 2018 at

Re: [libvirt] [GSoC] Code design for scalar and external types

2018-06-11 Thread Sukrit Bhatnagar
On Mon, 11 Jun 2018 at 16:35, Pavel Hrdina wrote: > > On Mon, Jun 11, 2018 at 12:59:11PM +0200, Martin Kletzander wrote: > > On Mon, Jun 11, 2018 at 12:53:47PM +0200, Erik Skultety wrote: > > > On Mon, Jun 11, 2018 at 12:43:59PM +0200, Martin Kletzander wrote: > > > > On Mon, Jun 11, 2018 at

Re: [libvirt] [GSoC] Code design for scalar and external types

2018-06-11 Thread Pavel Hrdina
On Mon, Jun 11, 2018 at 12:59:11PM +0200, Martin Kletzander wrote: > On Mon, Jun 11, 2018 at 12:53:47PM +0200, Erik Skultety wrote: > > On Mon, Jun 11, 2018 at 12:43:59PM +0200, Martin Kletzander wrote: > > > On Mon, Jun 11, 2018 at 12:12:16PM +0200, Pavel Hrdina wrote: > > > > On Sat, Jun 09,

Re: [libvirt] [GSoC] Code design for scalar and external types

2018-06-11 Thread Martin Kletzander
On Mon, Jun 11, 2018 at 12:53:47PM +0200, Erik Skultety wrote: On Mon, Jun 11, 2018 at 12:43:59PM +0200, Martin Kletzander wrote: 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

Re: [libvirt] [GSoC] Code design for scalar and external types

2018-06-11 Thread Erik Skultety
On Mon, Jun 11, 2018 at 12:43:59PM +0200, Martin Kletzander wrote: > 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, > > > > > >

Re: [libvirt] [GSoC] Code design for scalar and external types

2018-06-11 Thread Martin Kletzander
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, > > I am starting this discussion thread as a continuation of my GSoC > weekly meeting with

Re: [libvirt] [GSoC] Code design for scalar and external types

2018-06-11 Thread Pavel Hrdina
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, > > > > 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

Re: [libvirt] [GSoC] Code design for scalar and external types

2018-06-11 Thread Erik Skultety
On Sat, Jun 09, 2018 at 10:06:55PM +0530, Sukrit Bhatnagar wrote: > 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

Re: [libvirt] [GSoC] Code design for scalar and external types

2018-06-09 Thread Martin Kletzander
On Sat, Jun 09, 2018 at 10:06:55PM +0530, Sukrit Bhatnagar wrote: 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

[libvirt] [GSoC] Code design for scalar and external types

2018-06-09 Thread Sukrit Bhatnagar
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