file_size_info: add missing format parameters
these calls would print spurious warnings otherwise. Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
@ -36,6 +36,8 @@ sub extract_disk_from_import_file {
|
|||||||
die "cannot extract $volid - invalid volname $volname\n";
|
die "cannot extract $volid - invalid volname $volname\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
die "cannot determine format of '$volid'\n" if !$inner_fmt;
|
||||||
|
|
||||||
my $ova_path = PVE::Storage::path($cfg, $archive_volid);
|
my $ova_path = PVE::Storage::path($cfg, $archive_volid);
|
||||||
|
|
||||||
my $tmpdir = PVE::Storage::get_image_dir($cfg, $target_storeid, $vmid);
|
my $tmpdir = PVE::Storage::get_image_dir($cfg, $target_storeid, $vmid);
|
||||||
@ -63,7 +65,7 @@ sub extract_disk_from_import_file {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# check potentially untrusted image file!
|
# check potentially untrusted image file!
|
||||||
PVE::Storage::file_size_info($source_path, undef, undef, 1);
|
PVE::Storage::file_size_info($source_path, undef, $inner_fmt, 1);
|
||||||
|
|
||||||
# create temporary 1M image that will get overwritten by the rename
|
# create temporary 1M image that will get overwritten by the rename
|
||||||
# to reserve the filename and take care of locking
|
# to reserve the filename and take care of locking
|
||||||
|
|||||||
@ -300,7 +300,7 @@ sub volume_size_info {
|
|||||||
my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
|
my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
|
||||||
return $plugin->volume_size_info($scfg, $storeid, $volname, $timeout);
|
return $plugin->volume_size_info($scfg, $storeid, $volname, $timeout);
|
||||||
} elsif ($volid =~ m|^(/.+)$| && -e $volid) {
|
} elsif ($volid =~ m|^(/.+)$| && -e $volid) {
|
||||||
return file_size_info($volid, $timeout);
|
return file_size_info($volid, $timeout, 'auto-detect');
|
||||||
} else {
|
} else {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -538,7 +538,7 @@ sub volume_size_info {
|
|||||||
return 0 if $volname =~ /\.vmx$/;
|
return 0 if $volname =~ /\.vmx$/;
|
||||||
|
|
||||||
my $filename = $class->path($scfg, $volname, $storeid, undef);
|
my $filename = $class->path($scfg, $volname, $storeid, undef);
|
||||||
return PVE::Storage::Plugin::file_size_info($filename, $timeout);
|
return PVE::Storage::Plugin::file_size_info($filename, $timeout, 'auto-detect');
|
||||||
}
|
}
|
||||||
|
|
||||||
sub volume_snapshot {
|
sub volume_snapshot {
|
||||||
|
|||||||
Reference in New Issue
Block a user