From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50717) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YBOyr-0002fL-EG for qemu-devel@nongnu.org; Wed, 14 Jan 2015 09:31:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YBOyn-0006V3-It for qemu-devel@nongnu.org; Wed, 14 Jan 2015 09:31:33 -0500 Received: from mx2.parallels.com ([199.115.105.18]:44074) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YBOyn-0006Uy-Dc for qemu-devel@nongnu.org; Wed, 14 Jan 2015 09:31:29 -0500 Message-ID: <54B67DB8.9000007@openvz.org> Date: Wed, 14 Jan 2015 17:31:20 +0300 From: "Denis V. Lunev" MIME-Version: 1.0 References: <1419931701-19362-1-git-send-email-den@openvz.org> <1419934032-24216-1-git-send-email-den@openvz.org> <1419934032-24216-9-git-send-email-den@openvz.org> <20150114142619.GD27418@rkaganb.sw.ru> In-Reply-To: <20150114142619.GD27418@rkaganb.sw.ru> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 18/19] block/parallels: add prealloc-mode and prealloc-size open paramemets List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Roman Kagan , Kevin Wolf , qemu-devel@nongnu.org, Stefan Hajnoczi On 14/01/15 17:26, Roman Kagan wrote: > On Tue, Dec 30, 2014 at 01:07:11PM +0300, Denis V. Lunev wrote: >> This is preparational commit for tweaks in Parallels image expansion. >> The idea is that enlarge via truncate by one data block is slow. It >> would be much better to use fallocate via bdrv_write_zeroes and >> expand by some significant amount at once. >> >> This patch just adds proper parameters into BDRVParallelsState and >> performs options parsing in parallels_open. >> >> Signed-off-by: Denis V. Lunev >> CC: Kevin Wolf >> CC: Stefan Hajnoczi >> --- >> block/parallels.c | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ >> 1 file changed, 72 insertions(+) >> >> diff --git a/block/parallels.c b/block/parallels.c >> index 18b9267..12a9cea 100644 >> --- a/block/parallels.c >> +++ b/block/parallels.c >> @@ -30,6 +30,7 @@ >> #include "qemu-common.h" >> #include "block/block_int.h" >> #include "qemu/module.h" >> +#include "qapi/util.h" >> >> /**************************************************************/ >> >> @@ -54,6 +55,20 @@ typedef struct ParallelsHeader { >> char padding[12]; >> } QEMU_PACKED ParallelsHeader; >> >> + >> +typedef enum ParallelsPreallocMode { >> + PRL_PREALLOC_MODE_FALLOCATE = 0, >> + PRL_PREALLOC_MODE_TRUNCATE = 1, >> + PRL_PREALLOC_MODE_MAX = 2, >> +} ParallelsPreallocMode; >> + >> +static const char *prealloc_mode_lookup[] = { >> + "falloc", >> + "truncate", >> + NULL, > There is already generic "preallocaton" option, BLOCK_OPT_PREALLOC, > which is handled by qcow2 and raw-posix. It means slightly different > thing: the *whole* image is preallocated using the method specified. > > I think it would make sense to consolidate that option with this new > batched allocation in the generic block code. I guess qcow2 and > raw-posix would benefit from it, too. > > At any rate I think it's a matter for a separate patchset. > > Roman. it is too early :) I think that I should provide the rationale for the preallocation in general. I am working on this with CEPH :)