From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38090) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8nhL-0004ny-Tb for qemu-devel@nongnu.org; Tue, 04 Sep 2012 03:37:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T8nhG-0004MC-Na for qemu-devel@nongnu.org; Tue, 04 Sep 2012 03:37:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:25371) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8nhG-0004M4-FH for qemu-devel@nongnu.org; Tue, 04 Sep 2012 03:37:18 -0400 Message-ID: <5045AFA7.4000102@redhat.com> Date: Tue, 04 Sep 2012 09:37:11 +0200 From: Paolo Bonzini 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> <5045A95F.3050908@linux.vnet.ibm.com> In-Reply-To: <5045A95F.3050908@linux.vnet.ibm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/6] libqblock public type defines List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wenchao Xia Cc: kwolf@redhat.com, stefanha@gmail.com, aliguori@us.ibm.com, Eric Blake , qemu-devel@nongnu.org Il 04/09/2012 09:10, Wenchao Xia ha scritto: > >>> + >>> +/** >>> + * 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. size_t is a *pointer* size. It is 32-bits on Use int64_t or uint64_t always when dealing with file sizes and offsets. In particular, do not use off_t, it is a recipe for pain and ABI incompatibilities. Paolo