[libvirt] locking down struct size/layout in remote-protocol.x
Eric Blake
eblake at redhat.com
Fri May 7 14:32:31 UTC 2010
On 05/07/2010 02:05 AM, Jim Meyering wrote:
>> There's a way out.
>>
>> - maintain a textual representation of these structs and their members
>> (including type names, but not sizes) and make pdwtags a requirement
>> for running "make syntax-check", which would perform the verification.
>> I.e., keep a copy of the output of pdwtags, but without the comments.
>
> FYI, here's code to generate the latter:
>
> pdwtags src/libvirt_driver_remote_la-remote_protocol.o \
> |perl -0777 -n \
> -e 'foreach my $p (split m!\n\n/\* \d+ \*/\n!)' \
> -e ' { if ($p =~ /^struct remote_/) {' \
> -e ' $p =~ s!\t*/\*.*?\*/!!sg;' \
> -e ' $p =~ s!\s+\n!\n!sg;' \
> -e ' print "$p\n" } }' \
> > remote-protocol-structs
>
> IMHO, it would be sufficient to enable a check comparing
> this output to a version-controlled reference file, and
> making it part of "make check".
I like it!
>
> Of course, this would add a dependency on pdwtags/dwarves,
> but it would be fine/easy to skip the check on non-Linux systems.
The same as we do for cppi - make it an optional 'make syntax-check', so
that those who have dwarves installed run it, and those who don't get a
warning that they should consider installing dwarves.
>
> Any objection to requiring the dwarves package for development on Linux?
No objection to an optional dependency from me.
--
Eric Blake eblake at redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20100507/3a10e0e9/attachment-0001.sig>
More information about the libvir-list
mailing list