[libvirt] [PATCH 1/7] util: buffer: Remove struct member munging

Peter Krempa pkrempa at redhat.com
Mon Apr 1 06:54:05 UTC 2019


On Fri, Mar 29, 2019 at 18:44:04 -0400, Laine Stump wrote:
> On 3/29/19 9:33 AM, Peter Krempa wrote:
> > This was meant to stop abusing the members directly, but we don't do
> > this for other internal structs. Additionally this did not stop the
> > test from touching the members. Remove the header obscurization.
> 
> 
> I agree with you that this obfuscation does nothing in the face of a hostile
> (or ignorant) coder, but if we instead just make the real struct public then
> it won't be just ignorant devs who incorrectly use the internals of
> virBuffer. How about taking care of it with a virbufferpriv.h as we now do
> for several other structs whose internals we want to keep "private"?
> vircommandpriv.h is one good example.

Vast majority of our code uses stack'd version. Just grep for use of the
VIR_BUFFER_INITIALIZER macro. If it were possible I'd take it private.

I think review making sure that people don't do shenaningans with the
struct should be sufficient.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20190401/2e131159/attachment-0001.sig>


More information about the libvir-list mailing list