From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53132) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlUhf-0003jw-1K for qemu-devel@nongnu.org; Tue, 26 Nov 2013 21:18:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VlUhZ-00042g-BC for qemu-devel@nongnu.org; Tue, 26 Nov 2013 21:18:10 -0500 Received: from [222.73.24.84] (port=6287 helo=song.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlUhY-0003yp-Uh for qemu-devel@nongnu.org; Tue, 26 Nov 2013 21:18:05 -0500 From: Hu Tao Date: Wed, 27 Nov 2013 10:15:38 +0800 Message-Id: Subject: [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: Kevin Wolf , "Daniel P. Berrange" , Peter Lieven Cc: qemu-devel@nongnu.org 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_fallocate(), 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 slow for large file. (fallocate() ensures zero-filling, but posix_fallocate()) If users want it, we can maybe add a option to let users have a choice. Suggestions? 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(-) -- 1.8.3.1