From a35e1c177debb01240243bd656caca302410d38c Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Mon, 17 Aug 2009 15:50:10 +0200 Subject: qcow2: Metadata preallocation This introduces a qemu-img create option for qcow2 which allows the metadata to be preallocated, i.e. clusters are reserved in the refcount table and L1/L2 tables, but no data is written to them. Metadata is quite small, so this happens in almost no time. Especially with qcow2 on virtio this helps to gain a bit of performance during the initial writes. However, as soon as create a snapshot, we're back to the normal slow speed, obviously. So this isn't the real fix, but kind of a cheat while we're still having trouble with qcow2 on virtio. Note that the option is disabled by default and needs to be specified explicitly using qemu-img create -f qcow2 -o preallocation=metadata. Signed-off-by: Kevin Wolf Signed-off-by: Anthony Liguori --- block_int.h | 1 + 1 file changed, 1 insertion(+) (limited to 'block_int.h') diff --git a/block_int.h b/block_int.h index 8898d91f4..0902fd473 100644 --- a/block_int.h +++ b/block_int.h @@ -37,6 +37,7 @@ #define BLOCK_OPT_BACKING_FILE "backing_file" #define BLOCK_OPT_BACKING_FMT "backing_fmt" #define BLOCK_OPT_CLUSTER_SIZE "cluster_size" +#define BLOCK_OPT_PREALLOC "preallocation" typedef struct AIOPool { void (*cancel)(BlockDriverAIOCB *acb); -- cgit v1.2.3-65-gdbad