]> git.proxmox.com Git - qemu-server.git/commitdiff
vzdump : check if volid exist with volume_size_info
authorAlexandre Derumier <aderumier@odiso.com>
Sun, 17 Feb 2013 10:01:39 +0000 (11:01 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Mon, 18 Feb 2013 05:49:07 +0000 (06:49 +0100)
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
PVE/VZDump/QemuServer.pm

index ad85cc29b001f7188e9f8394b7774c645e13041b..69130d7230b744a322fe43694f31e4b65fad8be4 100644 (file)
@@ -94,9 +94,13 @@ sub prepare {
 
        next if !$path;
 
-       die "no such volume '$volid'\n" if ! -e $path;
+       my $format = undef;
+       my $size = undef;
 
-       my ($size, $format) = PVE::Storage::Plugin::file_size_info($path);
+       eval{
+           ($size, $format) = PVE::Storage::volume_size_info($self->{storecfg}, $volid, 5);
+       };
+       die "no such volume '$volid'\n" if $@;
 
        my $diskinfo = { path => $path , volid => $volid, storeid => $storeid, 
                         format => $format, virtdev => $ds, qmdevice => "drive-$ds" };