On Mon, Dec 02, 2013 at 01:50:58PM +0100, Cedric Bosdonnat wrote: > On Fri, 2013-11-29 at 17:18 +0000, Daniel P. Berrange wrote: > > On Fri, Nov 29, 2013 at 04:18:58PM +0100, Cédric Bosdonnat wrote: > > > The virDomainEvent class wasn't defining anything special, thus it has > > > been dropped. > > > > > > > diff --git a/src/conf/domain_event.c b/src/conf/domain_event.c > > > index 7694fcc..d4ecc23 100644 > > > --- a/src/conf/domain_event.c > > > +++ b/src/conf/domain_event.c > > > > > @@ -107,16 +105,11 @@ static void virDomainEventDeviceRemovedDispose(void *obj); > > > struct _virObjectEvent { > > > virObject parent; > > > int eventID; > > > -}; > > > - > > > -struct _virDomainEvent { > > > - virObjectEvent parent; > > > - > > > virObjectMeta meta; > > > }; > > > > Ok, so you're merging virObjectMeta into the parent class. I understand why > > you want to keep a single set of metadata for all object types. This does > > mostly work. We should be aware of the fact that different objects have > > a different set of valid attributes > > > > - virDomainPtr - id, name, uuid > > - virNetworkPtr - name, uuid > > - virStoragePoolPtr - name, uuid > > - virInterfacePtr - name > > - virSecretPtr - uuid > > - virNodeDevicePtr - name > > - virNWfilterPtr - name, uuid > > In most of the cases, the uuid is used for the filtering... but that can > be improved later for virInterfacePtr and virInterfacePtr. > > > Even if we don't store any custom data in the virDomainEvent class its > > existance does tell you information about the metadata attributes that > > are valid for this class. Even if we don't use it right now, this feels > > like a useful class representation to have available. > > The problem is that virClassNew is failing to create a class that has no > new attribute due to objectSize <= parent->objectSize. I'm tempted to > replace the '<=' in that test by '<'. Any objection? Actually that check has caught quite a few bugs in the past so would rather not relax that. Just add a unused 'bool dummy' field to it. Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :| -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list