Re: [PATCH 1/7] Allow for multi-level inheritance of virObject classes

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

 



On 01/11/2013 05:13 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
> 
> Currently all classes must directly inherit from virObject.
> This allows for arbitrarily deep hierarchy. There's not much
> too this aside from chaining up the 'dispose' handlers from

s/too/to/

> each class & providing APIs to check types.
> ---

> -virClassPtr virClassNew(const char *name,
> +virClassPtr virClassNew(virClassPtr parent,
> +                        const char *name,
>                          size_t objectSize,
>                          virObjectDisposeCallback dispose)
>  {
>      virClassPtr klass;
>  
> +    if (parent == NULL &&
> +        STRNEQ(name, "virObject")) {
> +        virReportInvalidNonNullArg(parent);
> +        return NULL;

Would it have been any easier to let callers pass NULL when they want to
have virObject as the default parent, instead of making all callers have
to use virClassForObject()?  Then again, you've already touched
everyone, so don't change the bikeshed color again.

ACK.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
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]