[pve-devel] [PATCH] replace file_size_info by volume_size_info.

Alexandre Derumier aderumier at odiso.com
Fri Jul 27 07:59:20 CEST 2012


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 at odiso.com>
---
 PVE/QemuServer.pm |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 7c59f10..7667f66 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -1884,7 +1884,6 @@ sub disksize {
     } else {
 	eval {
 	    $storeid = $timeoutid = PVE::Storage::parse_volume_id($volid);
-	    $path = PVE::Storage::path($storecfg, $volid);
 	};
 	if (my $err = $@) {
 	    warn $err;
@@ -1903,7 +1902,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
-- 
1.7.2.5




More information about the pve-devel mailing list