From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34981) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vuuq2-0002EN-R5 for qemu-devel@nongnu.org; Sun, 22 Dec 2013 21:01:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vuupw-0003Ma-Sd for qemu-devel@nongnu.org; Sun, 22 Dec 2013 21:01:46 -0500 Received: from [222.73.24.84] (port=5029 helo=song.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vuupw-0003MF-Gh for qemu-devel@nongnu.org; Sun, 22 Dec 2013 21:01:40 -0500 Date: Mon, 23 Dec 2013 09:59:34 +0800 From: Hu Tao Message-ID: <20131223015934.GC31398@G08FNSTD100614.fnst.cn.fujitsu.com> References: <20131220103021.GH27021@stefanha-thinkpad.redhat.com> MIME-Version: 1.0 In-Reply-To: <20131220103021.GH27021@stefanha-thinkpad.redhat.com> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Subject: Re: [Qemu-devel] [RFC PATCH v3 0/6] qemu-img: add preallocation=full List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , Peter Lieven , Fam Zheng , qemu-devel@nongnu.org On Fri, Dec 20, 2013 at 11:30:21AM +0100, Stefan Hajnoczi wrote: > On Thu, Dec 19, 2013 at 10:27:35AM +0800, Hu Tao wrote: > > This series implements full image preallocation to create a non-sparse image > > file at creation time, both for raw and qcow2 format. The purpose is to avoid > > performance deterioration of the guest cause by sparse image. > > I'm not sure the new bdrv_preallocate() interface is necessary. Can > qcow2_create() simply pass a preallocate=full option to > bdrv_create_file()? Looks simpler. I'll try this. > > It's simpler if we avoid bdrv_preallocate(), just keep it a > .bdrv_create() option. That way we also avoid the question of how > exactly preallocate functions on an image file that already has blocks > allocated. > > So what I imagine is: > 1. Add preallocation=full support to raw-posix.c > 2. Add preallocation=full support to qcow2.c, calculate image file size > including metadata for bdrv_create_file(). > > CCing Eric Blake so libvirt can consider how full preallocation > interacts with their safezero() preallocation. If QEMU handles > preallocation can we skip safezero()? Is there a concern about full > preallocation in QEMU taking a long time without progress report? > > Stefan