From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35302) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VvNQg-0001ua-FD for qemu-devel@nongnu.org; Tue, 24 Dec 2013 03:33:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VvNQa-0006JS-Fg for qemu-devel@nongnu.org; Tue, 24 Dec 2013 03:33:30 -0500 Received: from [222.73.24.84] (port=37799 helo=song.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VvNQa-0006Iz-4L for qemu-devel@nongnu.org; Tue, 24 Dec 2013 03:33:24 -0500 Date: Tue, 24 Dec 2013 16:31:11 +0800 From: Hu Tao Message-ID: <20131224083111.GJ21607@G08FNSTD100614.fnst.cn.fujitsu.com> References: <521cd9f1c99d5912c7438b1714fe4d0de758344e.1387419339.git.hutao@cn.fujitsu.com> <20131220101030.GD27021@stefanha-thinkpad.redhat.com> MIME-Version: 1.0 In-Reply-To: <20131220101030.GD27021@stefanha-thinkpad.redhat.com> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline 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: Stefan Hajnoczi Cc: Kevin Wolf , Fam Zheng , Peter Lieven , qemu-devel@nongnu.org On Fri, Dec 20, 2013 at 11:10:30AM +0100, Stefan Hajnoczi wrote: > 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? I thought in the case we have no need to preallocate forbacking file. But yes, we can also preallocate for bs when there is backing file. Thanks!