于 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