[libvirt] [PATCH 1/4] storage: factor out large integer reads

Eric Blake eblake at redhat.com
Fri Feb 8 22:25:26 UTC 2013


On 02/07/2013 07:53 AM, Daniel P. Berrange wrote:
> On Wed, Feb 06, 2013 at 10:10:17PM -0700, Eric Blake wrote:
>> This makes code easier to read, by avoiding lines longer than
>> 80 columns and removing the repetition from the callers.
>>

> 
> How about putting these helpful APIs in some other src/util/ file
> as macros. Either virutil.h, or perhaps  virinttypes.h or virendian.h ?

Indeed, that would be nicer, because then it works on both 'char*' and
'unsigned char *' (don't know why virstoragefile uses unsigned, when
most of our other files use plain char).

> Probably with a name like "virReadBufInt{32,64}{BE,LE}"
> 
> 
> ACK to this patch regardless though.

I'll go ahead and post a v2, with a testsuite addition; it may be a
regression that I'm fixing, but I'd rather get it right than rushed.

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130208/496a0070/attachment-0001.sig>


More information about the libvir-list mailing list