Re: [PATCH] object: Add sanity check on correct parent class

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Mar 15, 2019 at 10:12:45AM -0500, Eric Blake wrote:
> Checking that the derived class is larger than the requested parent
> class saves us from some obvious mistakes, but as written, it does not
> catch all the cases; in particular, it is easy to forget to update a
> VIR_CLASS_NEW when changing the 'parent' member from virObject to
> virObjectLockabale, but where the size checks don't catch that.  Add a
> parameter for one more layer of sanity checking.
> 
> Note that I did NOT change the fact that we require derived classes to
> be larger (as the difference in size makes it easy to tell classes
> apart), which means that even if a derived class has no functionality
> to add (but rather exists for compiler-enforced type-safety), it must
> still include a dummy member.  But I did fix the wording of the error
> message to match the code.
> 
> Signed-off-by: Eric Blake <eblake@xxxxxxxxxx>


Reviewed-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux