Re: [PATCH 09/10] conf: Provide missing virDomain*DefNew() functions

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

 



On Fri, 2017-06-30 at 10:18 +0200, Ján Tomko wrote:
> > Same as virDomainDeviceInfo itself, any struct that
> > embeds it needs to be initialized properly before use;
> > however, none of the structs in question even had a
> > proper allocation function defined.
> > 
> > Implement an allocation function for all structs
> > embedding a virDomainDeviceInfo and use them instead
> > of plain VIR_ALLOC() everywhere.
> 
> NACK
> 
> This is a pointless obfuscation

Would you mind spending a few words to explain why you feel
that's the case?

Having a function where you perform both allocation and
initialization of your data structure is a pretty common
pattern both outside and inside libvirt, and while it adds
one layer of indirection it also improves flexibility and
encapsulation, which makes it IMHO well worth it.

-- 
Andrea Bolognani / Red Hat / Virtualization

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