From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60328) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtTNE-0004KM-S8 for qemu-devel@nongnu.org; Wed, 18 Dec 2013 21:30:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VtTN7-0007mH-AY for qemu-devel@nongnu.org; Wed, 18 Dec 2013 21:30:04 -0500 Received: from [222.73.24.84] (port=51822 helo=song.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtTN6-0007li-Ur for qemu-devel@nongnu.org; Wed, 18 Dec 2013 21:29:57 -0500 From: Hu Tao Date: Thu, 19 Dec 2013 10:27:40 +0800 Message-Id: In-Reply-To: References: Subject: [Qemu-devel] [RFC PATCH v3 5/6] qcow2: implement bdrv_preallocate List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Fam Zheng , Peter Lieven , hutao@cn.fujitsu.com Signed-off-by: Hu Tao --- block/qcow2.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/block/qcow2.c b/block/qcow2.c index 32cb39f..487a595 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -2188,6 +2188,12 @@ static int qcow2_amend_options(BlockDriverState *bs, return 0; } +static int qcow2_preallocate(BlockDriverState *bs, int64_t offset, + int64_t length) +{ + return bdrv_preallocate(bs->file, offset, length); +} + static QEMUOptionParameter qcow2_create_options[] = { { .name = BLOCK_OPT_SIZE, @@ -2242,6 +2248,7 @@ static BlockDriver bdrv_qcow2 = { .bdrv_reopen_prepare = qcow2_reopen_prepare, .bdrv_create = qcow2_create, .bdrv_has_zero_init = bdrv_has_zero_init_1, + .bdrv_preallocate = qcow2_preallocate, .bdrv_co_get_block_status = qcow2_co_get_block_status, .bdrv_set_key = qcow2_set_key, .bdrv_make_empty = qcow2_make_empty, -- 1.7.11.7