qcow2 : preallocate metadatas at file creation

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
Alexandre Derumier
2012-09-19 12:20:21 +02:00
committed by Dietmar Maurer
parent 1059cc994d
commit 1e679ac591

View File

@ -427,7 +427,10 @@ sub alloc_image {
die "disk image '$path' already exists\n" if -e $path;
run_command("/usr/bin/qemu-img create -f $fmt '$path' ${size}K",
my $options = "";
$options = "-o preallocation=metadata" if $fmt eq 'qcow2';
run_command("/usr/bin/qemu-img create $options -f $fmt '$path' ${size}K",
errmsg => "unable to create image");
return "$vmid/$name";