qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH V4 2/5] libqblock type defines


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH V4 2/5] libqblock type defines
Date: Fri, 28 Sep 2012 09:51:56 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120911 Thunderbird/15.0.1

Il 28/09/2012 05:00, Wenchao Xia ha scritto:
>>
>>
>> uint64_t qblock_get_virt_size(QBlockFmtInfo *fmt);
>> QBlockProtInfo *qblock_get_backing_loc(QBlockFmtInfo *fmt);
>> bool qblock_get_encrypt(QBlockFmtInfo *fmt);
>>
>> etc. that include the switch statement.
>>
>   I think it is reasonable use generic accessors instead of embbed
> structure, maybe an additional helper function should be added as:
> 
> QBlockStaticInfoAddr *qblock_get_static_info_addr(QBlockStaticInfo
>  *info)
> 
>   In this way only one switch statement is needed in source code,
> and only one new API is added.

No problem for the implementation, but please make this function static.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]