From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57357) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vtx2Y-0003y4-Vj for qemu-devel@nongnu.org; Fri, 20 Dec 2013 05:10:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vtx2Q-0007d7-Iy for qemu-devel@nongnu.org; Fri, 20 Dec 2013 05:10:42 -0500 Received: from mail-wi0-x235.google.com ([2a00:1450:400c:c05::235]:40944) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vtx2Q-0007cs-33 for qemu-devel@nongnu.org; Fri, 20 Dec 2013 05:10:34 -0500 Received: by mail-wi0-f181.google.com with SMTP id hq4so3418528wib.8 for ; Fri, 20 Dec 2013 02:10:33 -0800 (PST) Date: Fri, 20 Dec 2013 11:10:30 +0100 From: Stefan Hajnoczi Message-ID: <20131220101030.GD27021@stefanha-thinkpad.redhat.com> References: <521cd9f1c99d5912c7438b1714fe4d0de758344e.1387419339.git.hutao@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <521cd9f1c99d5912c7438b1714fe4d0de758344e.1387419339.git.hutao@cn.fujitsu.com> Subject: Re: [Qemu-devel] [RFC PATCH v3 2/6] block: add BlockDriver.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:37AM +0800, Hu Tao wrote: > diff --git a/block.c b/block.c > index 64e7d22..b901587 100644 > --- a/block.c > +++ b/block.c > @@ -3216,6 +3216,19 @@ bool bdrv_can_write_zeroes_with_unmap(BlockDriverState *bs) > return false; > } > > +int bdrv_preallocate(BlockDriverState *bs, int64_t offset, int64_t length) > +{ > + if (bs->backing_hd) { > + return -ENOTSUP; > + } Depending on the image file format it may be possible to preallocate metadata while using a backing file. Why prevent this?