]> git.proxmox.com Git - pve-storage.git/commitdiff
sheepdog : volume_size_info
authorAlexandre Derumier <aderumier@odiso.com>
Sun, 5 Aug 2012 08:16:46 +0000 (10:16 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Mon, 6 Aug 2012 04:10:06 +0000 (06:10 +0200)
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
PVE/Storage/SheepdogPlugin.pm

index 13b26a72ddc2f48cf70ac8d59d3d28d098e263de..373bb9171f3d3740d8b4c878bb905a0fa97bd2f0 100644 (file)
@@ -215,7 +215,20 @@ sub deactivate_volume {
 sub volume_size_info {
     my ($class, $scfg, $storeid, $volname, $timeout) = @_;
 
-    return undef;
+    my $size = undef;
+
+    my $cmd = &$collie_cmd($scfg, 'vdi', 'list', '-r', $volname);
+
+    run_command($cmd, outfunc => sub {
+        my $line = shift;
+        $line = trim($line);
+        if ($line =~ /= (vm-(\d+)-\S+)\s+(\d+)\s+(\d+)\s(\d+)\s(\d+)\s/) {
+            $size = $4;
+
+        }
+    });
+
+    return $size;
 }
 
 1;