From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35030) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlVi7-0000tB-S1 for qemu-devel@nongnu.org; Tue, 26 Nov 2013 22:22:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VlVi3-00051C-40 for qemu-devel@nongnu.org; Tue, 26 Nov 2013 22:22:43 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54230) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlVi2-000518-Rs for qemu-devel@nongnu.org; Tue, 26 Nov 2013 22:22:39 -0500 Message-ID: <5295656E.6010208@redhat.com> Date: Wed, 27 Nov 2013 11:22:22 +0800 From: Fam Zheng MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC PATCH v2 0/6] qemu-img: add preallocation=full List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Hu Tao , Kevin Wolf , "Daniel P. Berrange" , Peter Lieven Cc: qemu-devel@nongnu.org On 2013=E5=B9=B411=E6=9C=8827=E6=97=A5 10:15, 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. > > This series implements full preallocation by using fallocate()/posix_fa= llocate(), > which have the advantage that it is fast when creating large image file. > Zero-filling is not implemented, as writing zeros to image could be slo= w for large > file. (fallocate() ensures zero-filling, but posix_fallocate()) If user= s want it, > we can maybe add a option to let users have a choice. Suggestions? > We have zero init in raw-posix: static BlockDriver bdrv_file =3D { ... .bdrv_has_zero_init =3D bdrv_has_zero_init_1, } so I think we have to zero-fill it if posix_fallocate doesn't ensure. Fam > Base on Kevin's patch at: > http://lists.gnu.org/archive/html/qemu-devel/2011-01/msg03017.html > > Hu Tao (6): > block: introduce prealloc_mode > block: add BlockDriver.bdrv_preallocate. > block/raw-posix: implement bdrv_preallocate > raw-posix: Add full image preallocation option > qcow2: implement bdrv_preallocate > qcow2: Add full image preallocation option > > block.c | 13 +++++++++++ > block/qcow2.c | 32 +++++++++++++++++++++------ > block/raw-posix.c | 56 ++++++++++++++++++++++++++++++++++++++= +++++++++ > include/block/block.h | 7 ++++++ > include/block/block_int.h | 3 +++ > 5 files changed, 104 insertions(+), 7 deletions(-) >