]> git.proxmox.com Git - mirror_qemu.git/commit
qcow2: Metadata preallocation
authorKevin Wolf <kwolf@redhat.com>
Mon, 17 Aug 2009 13:50:10 +0000 (15:50 +0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Fri, 28 Aug 2009 01:30:20 +0000 (20:30 -0500)
commita35e1c177debb01240243bd656caca302410d38c
treed19ebe06710980ee4847e294947a4e079bb75b21
parente8935eefe56070a37ece62e2d7f8e45c6c9356da
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 <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
block/qcow2.c
block_int.h