[pve-devel] [PATCH] disk update: only override side if volume_size_info return value

Alexandre Derumier aderumier at odiso.com
Fri Aug 3 06:57:57 CEST 2012


some plugins doesn't yet implement volume_size_info, so we don't want to override disk size value for them

Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/API2/Qemu.pm |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
index 47c588f..8476960 100644
--- a/PVE/API2/Qemu.pm
+++ b/PVE/API2/Qemu.pm
@@ -109,7 +109,7 @@ my $create_disks = sub {
 	    die "image '$path' does not exists\n" if (!(-f $path || -b $path || $foundvolid));
 
 	    my ($size) = PVE::Storage::volume_size_info($storecfg, $volid, 1);
-	    $disk->{size} = $size;
+	    $disk->{size} = $size if $size;
 	    $res->{$ds} = PVE::QemuServer::print_drive($vmid, $disk);
 	}
     });
-- 
1.7.2.5




More information about the pve-devel mailing list