replace file_size_info by volume_size_info.

Currently we only find a volume size by using qemu-img info (in file_size_info).

This doesn't works with "virtual" storage like sheepdog,rbd,iscsidirect,nexenta.

This also doesn't work with classic iscsi direct plugin.

So, we need to define a method for each plugin.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
Alexandre Derumier 2012-07-27 07:59:20 +02:00 committed by Dietmar Maurer
parent 373ea5798a
commit 2a7993d9ef

View File

@ -1868,7 +1868,6 @@ sub disksize {
} else {
eval {
$storeid = $timeoutid = PVE::Storage::parse_volume_id($volid);
$path = PVE::Storage::path($storecfg, $volid);
};
if (my $err = $@) {
warn $err;
@ -1887,7 +1886,7 @@ sub disksize {
my ($size, $format, $used);
($size, $format, $used) = PVE::Storage::file_size_info($path, 1);
($size, $format, $used) = PVE::Storage::volume_size_info($storecfg, $volid, 1);
if (!defined($format)) {
# got timeout