From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:36721) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UT7L5-0002Iu-9r for qemu-devel@nongnu.org; Fri, 19 Apr 2013 05:10:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UT7L2-0004u0-Kb for qemu-devel@nongnu.org; Fri, 19 Apr 2013 05:10:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39616) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UT7L2-0004tl-Cc for qemu-devel@nongnu.org; Fri, 19 Apr 2013 05:10:36 -0400 Date: Fri, 19 Apr 2013 17:10:30 +0800 From: Fam Zheng Message-ID: <20130419091030.GA6825@localhost.localdomain> References: <1366343325-5252-1-git-send-email-famz@redhat.com> <1366343325-5252-3-git-send-email-famz@redhat.com> <20130419085904.GA28732@stefanha-thinkpad.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130419085904.GA28732@stefanha-thinkpad.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: Stefan Hajnoczi Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, Feiran Zheng On Fri, 04/19 10:59, Stefan Hajnoczi wrote: > 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. This is an internal structure holding information for extent, used the same way as BDRVVmdkState, there is no direct correspondence to file header fields, so I think it should be OK, as `int qcow_version' is also found in block/qcow2.h. > > > @@ -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? Yes. -- Fam