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: Wenchao Xia
Subject: Re: [Qemu-devel] [PATCH V4 2/5] libqblock type defines
Date: Fri, 28 Sep 2012 18:52:55 +0800
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20120907 Thunderbird/15.0.1

于 2012-9-28 15:51, Paolo Bonzini 写道:
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

  Do you mean declaring it as static function? I think user may need
call it to get information so it need to be public.



--
Best Regards

Wenchao Xia




reply via email to

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