From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59344) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtxBR-0000xc-Oq for qemu-devel@nongnu.org; Fri, 20 Dec 2013 05:19:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VtxBL-0001pK-Dy for qemu-devel@nongnu.org; Fri, 20 Dec 2013 05:19:53 -0500 Received: from mail-we0-x235.google.com ([2a00:1450:400c:c03::235]:32857) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtxBL-0001oz-7g for qemu-devel@nongnu.org; Fri, 20 Dec 2013 05:19:47 -0500 Received: by mail-we0-f181.google.com with SMTP id x55so2277613wes.12 for ; Fri, 20 Dec 2013 02:19:46 -0800 (PST) Date: Fri, 20 Dec 2013 11:19:43 +0100 From: Stefan Hajnoczi Message-ID: <20131220101943.GF27021@stefanha-thinkpad.redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [RFC PATCH v3 5/6] qcow2: implement bdrv_preallocate List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Hu Tao Cc: Kevin Wolf , Peter Lieven , Fam Zheng , qemu-devel@nongnu.org On Thu, Dec 19, 2013 at 10:27:40AM +0800, Hu Tao wrote: > Signed-off-by: Hu Tao > --- > block/qcow2.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/block/qcow2.c b/block/qcow2.c > index 32cb39f..487a595 100644 > --- a/block/qcow2.c > +++ b/block/qcow2.c > @@ -2188,6 +2188,12 @@ static int qcow2_amend_options(BlockDriverState *bs, > return 0; > } > > +static int qcow2_preallocate(BlockDriverState *bs, int64_t offset, > + int64_t length) > +{ > + return bdrv_preallocate(bs->file, offset, length); > +} What about qcow2-level preallocation (metadata)? I'm not sure what the meaning of offset and length are here - are they supposed to be virtual disk LBAs. They are being passed through to bs->file so they actually become physical file offsets.