Received: from eggs.gnu.org ([2001:4830:134:3::10]:40992) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VO2dR-0003gq-J6 for qemu-devel@nongnu.org; Mon, 23 Sep 2013 05:40:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VO2dL-0005S1-K4 for qemu-devel@nongnu.org; Mon, 23 Sep 2013 05:40:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:10289) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VO2dL-0005Rw-Bj for qemu-devel@nongnu.org; Mon, 23 Sep 2013 05:40:47 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r8N9ekdU016546 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 23 Sep 2013 05:40:46 -0400 Date: Mon, 23 Sep 2013 17:40:42 +0800 From: Fam Zheng Message-ID: <20130923094042.GA2834@T430s.nay.redhat.com> References: <1379927909-32609-1-git-send-email-famz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1379927909-32609-1-git-send-email-famz@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2] vmdk: fix cluster size check for flat extents Reply-To: famz@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, stefanha@redhat.com On Mon, 09/23 17:18, Fam Zheng wrote: > We use the extent size as cluster size for flat extents (where no L1/L2 > table is allocated so it's safe) reuse sector calculating code with > sparse extents. > > Don't pass in the cluster size for adding flat extent, just set it to > sectors later, then the cluster size checking will not fail. > > The cluster_sectors is changed to int64_t to allow big flat extent. > > Without this, flat extent opening is broken: > > # qemu-img create -f vmdk -o subformat=monolithicFlat /tmp/a.vmdk 100G > Formatting '/tmp/a.vmdk', fmt=vmdk size=107374182400 compat6=off subformat='monolithicFlat' zeroed_grain=off > # qemu-img info /tmp/a.vmdk > image: /tmp/a.vmdk > file format: raw > virtual size: 0 (0 bytes) > disk size: 4.0K > > Signed-off-by: Fam Zheng > --- When adding a test case, iotests case 059 seems broken now, it will perhaps take some time to check and I'll post a fix together with test case for this later. Fam