code cleanup
This commit is contained in:
2
Makefile
2
Makefile
@ -1,4 +1,4 @@
|
|||||||
RELEASE=2.1
|
RELEASE=2.2
|
||||||
|
|
||||||
VERSION=2.0
|
VERSION=2.0
|
||||||
PACKAGE=libpve-storage-perl
|
PACKAGE=libpve-storage-perl
|
||||||
|
|||||||
@ -427,11 +427,13 @@ sub alloc_image {
|
|||||||
|
|
||||||
die "disk image '$path' already exists\n" if -e $path;
|
die "disk image '$path' already exists\n" if -e $path;
|
||||||
|
|
||||||
my $options = "";
|
my $cmd = ['/usr/bin/qemu-img', 'create'];
|
||||||
$options = "-o preallocation=metadata" if $fmt eq 'qcow2';
|
|
||||||
|
|
||||||
run_command("/usr/bin/qemu-img create $options -f $fmt '$path' ${size}K",
|
push @$cmd, '-o', 'preallocation=metadata' if $fmt eq 'qcow2';
|
||||||
errmsg => "unable to create image");
|
|
||||||
|
push @$cmd, '-f', $fmt, $path, "${size}K";
|
||||||
|
|
||||||
|
run_command($cmd, errmsg => "unable to create image");
|
||||||
|
|
||||||
return "$vmid/$name";
|
return "$vmid/$name";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user