From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33837) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UT79x-0005oU-HU for qemu-devel@nongnu.org; Fri, 19 Apr 2013 04:59:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UT79w-0000eq-KS for qemu-devel@nongnu.org; Fri, 19 Apr 2013 04:59:09 -0400 Received: from mail-wi0-x235.google.com ([2a00:1450:400c:c05::235]:41813) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UT79w-0000eh-EP for qemu-devel@nongnu.org; Fri, 19 Apr 2013 04:59:08 -0400 Received: by mail-wi0-f181.google.com with SMTP id c10so460383wiw.8 for ; Fri, 19 Apr 2013 01:59:07 -0700 (PDT) Date: Fri, 19 Apr 2013 10:59:04 +0200 From: Stefan Hajnoczi Message-ID: <20130419085904.GA28732@stefanha-thinkpad.redhat.com> References: <1366343325-5252-1-git-send-email-famz@redhat.com> <1366343325-5252-3-git-send-email-famz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1366343325-5252-3-git-send-email-famz@redhat.com> Subject: Re: [Qemu-devel] =?utf-8?q?=5BPATCH_2/5=5D_vmdk=3A_add_support_for_?= =?utf-8?b?4oCcemVyb2Vk4oCQZ3JhaW7igJ0gR1RF?= List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, Feiran Zheng On Fri, Apr 19, 2013 at 11:48:42AM +0800, Fam Zheng wrote: > diff --git a/block/vmdk.c b/block/vmdk.c > index 450a721..5e60940 100644 > --- a/block/vmdk.c > +++ b/block/vmdk.c > @@ -33,10 +33,13 @@ > #define VMDK4_MAGIC (('K' << 24) | ('D' << 16) | ('M' << 8) | 'V') > #define VMDK4_COMPRESSION_DEFLATE 1 > #define VMDK4_FLAG_RGD (1 << 1) > +/* Zeroed-grain enable bit */ > +#define VMDK4_FLAG_ZG (1 << 2) Please use a clear name like VMDK4_FLAG_ZERO_GRAIN. > @@ -81,6 +84,8 @@ typedef struct VmdkExtent { > bool flat; > bool compressed; > bool has_marker; > + bool has_zero_grain; > + int version; uint32_t according to the spec. Please use fixed-size integer types instead of int, long, etc which can change depending on the host architecture. > @@ -1181,7 +1193,7 @@ static int vmdk_write(BlockDriverState *bs, int64_t sector_num, > sector_num << 9, !extent->compressed, > &cluster_offset); > if (extent->compressed) { > - if (ret == 0) { > + if (ret == VMDK_OK) { Should this be squashed into the previous patch?