From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50091) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8nHW-0005Wt-KY for qemu-devel@nongnu.org; Tue, 04 Sep 2012 03:10:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T8nHU-00051F-Vr for qemu-devel@nongnu.org; Tue, 04 Sep 2012 03:10:42 -0400 Received: from e28smtp07.in.ibm.com ([122.248.162.7]:40074) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8nHU-00050t-9d for qemu-devel@nongnu.org; Tue, 04 Sep 2012 03:10:40 -0400 Received: from /spool/local by e28smtp07.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 4 Sep 2012 12:40:36 +0530 Received: from d28av03.in.ibm.com (d28av03.in.ibm.com [9.184.220.65]) by d28relay01.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q847AVhW23658684 for ; Tue, 4 Sep 2012 12:40:31 +0530 Received: from d28av03.in.ibm.com (loopback [127.0.0.1]) by d28av03.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q847ATv7027852 for ; Tue, 4 Sep 2012 17:10:30 +1000 Message-ID: <5045A95F.3050908@linux.vnet.ibm.com> Date: Tue, 04 Sep 2012 15:10:23 +0800 From: Wenchao Xia MIME-Version: 1.0 References: <1346663926-20188-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1346663926-20188-3-git-send-email-xiawenc@linux.vnet.ibm.com> <5044BC9B.3090901@redhat.com> In-Reply-To: <5044BC9B.3090901@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 2/6] libqblock public type defines List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: kwolf@redhat.com, pbonzini@redhat.com, aliguori@us.ibm.com, qemu-devel@nongnu.org, stefanha@gmail.com 于 2012-9-3 22:20, Eric Blake 写道: > On 09/03/2012 03:18 AM, Wenchao Xia wrote: >> This patch contains public type and defines used in APIs. >> >> Signed-off-by: Wenchao Xia >> --- >> libqblock/libqblock-types.h | 228 +++++++++++++++++++++++++++++++++++++++++++ >> 1 files changed, 228 insertions(+), 0 deletions(-) >> create mode 100644 libqblock/libqblock-types.h >> >> diff --git a/libqblock/libqblock-types.h b/libqblock/libqblock-types.h >> new file mode 100644 >> index 0000000..3389bda >> --- /dev/null >> +++ b/libqblock/libqblock-types.h >> @@ -0,0 +1,228 @@ >> +#ifndef LIBQBLOCK_TYPES_H > > Missing a copyright header. Shame. > >> +#define LIBQBLOCK_TYPES_H >> + >> +#include >> +#include >> +#include >> +#include > > I see use of stdint (uint8_t) and stdbool (bool), but isn't > better than and for size_t? > right, thanks. >> + >> +/** >> + * QBlockInfoImageStatic: information about the block image. >> + * >> + * @loc: location info. >> + * @fmt_type: format type. >> + * @virt_size: virtual size in bytes. >> + * @backing_loc: backing file location, its type is QB_PROT_NONE if not exist. >> + * @allocated_size: allocated size in bytes, negative if not available. > > Reading this... > >> + * @encrypt: encrypt flag. >> + */ >> +struct QBlockInfoImageStatic { >> + struct QBlockOptionLoc loc; >> + enum QBlockFormat fmt_type; >> + size_t virt_size; >> + /* advance info */ >> + struct QBlockOptionLoc backing_loc; >> + size_t allocated_size; > > ...negative is not possible for size_t. Did you mean ssize_t? > you are right. -- Best Regards Wenchao Xia