Re: [libvirt] [PATCH 8/9] virobject: Check if @parent is the first member in class

2018-04-17 Thread Erik Skultety
On Mon, Apr 16, 2018 at 06:27:45PM +0200, Michal Privoznik wrote: > On 04/16/2018 02:30 PM, Erik Skultety wrote: > > On Fri, Apr 13, 2018 at 04:47:15PM +0200, Michal Privoznik wrote: > >> Our virObject code relies heavily on the fact that the first > >> member of the class struct is type of

Re: [libvirt] [PATCH 8/9] virobject: Check if @parent is the first member in class

2018-04-16 Thread Michal Privoznik
On 04/16/2018 02:30 PM, Erik Skultety wrote: > On Fri, Apr 13, 2018 at 04:47:15PM +0200, Michal Privoznik wrote: >> Our virObject code relies heavily on the fact that the first >> member of the class struct is type of virObject (or some >> derivation of if). Let's check for that. > > If a class

Re: [libvirt] [PATCH 8/9] virobject: Check if @parent is the first member in class

2018-04-16 Thread Daniel P . Berrangé
On Mon, Apr 16, 2018 at 02:30:40PM +0200, Erik Skultety wrote: > On Fri, Apr 13, 2018 at 04:47:15PM +0200, Michal Privoznik wrote: > > Our virObject code relies heavily on the fact that the first > > member of the class struct is type of virObject (or some > > derivation of if). Let's check for

Re: [libvirt] [PATCH 8/9] virobject: Check if @parent is the first member in class

2018-04-16 Thread Erik Skultety
On Fri, Apr 13, 2018 at 04:47:15PM +0200, Michal Privoznik wrote: > Our virObject code relies heavily on the fact that the first > member of the class struct is type of virObject (or some > derivation of if). Let's check for that. If a class is missing 'parent' memeber, it's a bug in the

[libvirt] [PATCH 8/9] virobject: Check if @parent is the first member in class

2018-04-13 Thread Michal Privoznik
Our virObject code relies heavily on the fact that the first member of the class struct is type of virObject (or some derivation of if). Let's check for that. Signed-off-by: Michal Privoznik --- src/util/virobject.c | 31 +-- src/util/virobject.h