[pve-devel] [PATCH 1/7] add volume_size_info sub

Alexandre Derumier aderumier at odiso.com
Fri Jul 27 08:00:12 CEST 2012


Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/Storage.pm |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/PVE/Storage.pm b/PVE/Storage.pm
index 92dcc54..60cc53d 100755
--- a/PVE/Storage.pm
+++ b/PVE/Storage.pm
@@ -114,6 +114,16 @@ sub file_size_info {
     return PVE::Storage::Plugin::file_size_info($filename, $timeout);
 }
 
+sub volume_size_info {
+    my ($cfg, $volid, $timeout) = @_;
+
+    my ($storeid, $volname) = parse_volume_id($volid);
+
+    my $scfg = storage_config($cfg, $storeid);
+    my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
+    return $plugin->volume_size_info($scfg, $storeid, $volname, $timeout);
+}
+
 sub get_image_dir {
     my ($cfg, $storeid, $vmid) = @_;
 
@@ -455,6 +465,7 @@ sub template_list {
     return $res;
 }
 
+
 sub vdisk_list {
     my ($cfg, $storeid, $vmid, $vollist) = @_;
 
-- 
1.7.2.5




More information about the pve-devel mailing list