mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-10-05 02:53:59 +00:00
vzdump : check if volid exist with volume_size_info
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
parent
a6f0e83b93
commit
daca220d29
@ -94,9 +94,13 @@ sub prepare {
|
|||||||
|
|
||||||
next if !$path;
|
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,
|
my $diskinfo = { path => $path , volid => $volid, storeid => $storeid,
|
||||||
format => $format, virtdev => $ds, qmdevice => "drive-$ds" };
|
format => $format, virtdev => $ds, qmdevice => "drive-$ds" };
|
||||||
|
Loading…
Reference in New Issue
Block a user