]> git.proxmox.com Git - pve-storage.git/commitdiff
implement complete_volume
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 1 Oct 2015 05:59:05 +0000 (07:59 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 1 Oct 2015 05:59:48 +0000 (07:59 +0200)
PVE/Storage.pm

index d26499d883858973d7854e93f3a4c115172978dd..d6465060775b0d7547d8e2227d0749cc901dbda3 100755 (executable)
@@ -1234,4 +1234,23 @@ sub complete_content_type {
     return [qw(rootdir images vztmpl iso backup)];
 }
 
+sub complete_volume {
+    my ($cmdname, $pname, $cvalue) = @_;
+
+    my $cfg = config();
+
+    my $storage_list = complete_storage_enabled();
+
+    my $res = [];
+    foreach my $storeid (@$storage_list) {
+       my $vollist = PVE::Storage::volume_list($cfg, $storeid);
+
+       foreach my $item (@$vollist) {
+           push @$res, $item->{volid};
+       }
+    }
+
+    return $res;
+}
+
 1;