use PVE::Storage::Plugin;
use PVE::Storage::DirPlugin;
use PVE::Storage::LVMPlugin;
+use PVE::Storage::LvmThinPlugin;
use PVE::Storage::NFSPlugin;
use PVE::Storage::ISCSIPlugin;
use PVE::Storage::RBDPlugin;
# load and initialize all plugins
PVE::Storage::DirPlugin->register();
PVE::Storage::LVMPlugin->register();
+PVE::Storage::LvmThinPlugin->register();
PVE::Storage::NFSPlugin->register();
PVE::Storage::ISCSIPlugin->register();
PVE::Storage::RBDPlugin->register();
}
my $cmd = ['/usr/bin/rsync', '--progress', '--sparse', '--whole-file',
- $src, "root\@${target_host}:$dst"];
+ $src, "[root\@${target_host}]:$dst"];
my $percent = -1;
my $snap = "zfs snapshot $zfspath\@__migration__";
- my $send = "zfs send -v $zfspath\@__migration__ \| ssh root\@$target_host zfs recv $zfspath";
+ my $send = "zfs send -Rpv $zfspath\@__migration__ \| ssh root\@$target_host zfs recv $zfspath";
my $destroy_target = "ssh root\@$target_host zfs destroy $zfspath\@__migration__";
run_command($snap);
return [qw(rootdir images vztmpl iso backup)];
}
+sub complete_volume {
+ my ($cmdname, $pname, $cvalue) = @_;
+
+ my $cfg = config();
+
+ my $storage_list = complete_storage_enabled();
+
+ if ($cvalue =~ m/^([^:]+):/) {
+ $storage_list = [ $1 ];
+ } else {
+ if (scalar(@$storage_list) > 1) {
+ # only list storage IDs to avoid large listings
+ my $res = [];
+ foreach my $storeid (@$storage_list) {
+ # Hack: simply return 2 artificial values, so that
+ # completions does not finish
+ push @$res, "$storeid:volname", "$storeid:...";
+ }
+ return $res;
+ }
+ }
+
+ 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;