]> git.proxmox.com Git - pve-storage.git/blobdiff - PVE/Storage.pm
Use array to run_command instead of a string.
[pve-storage.git] / PVE / Storage.pm
index a2487730ba0dab7d72ea8cc8fb0802840d4da86a..e7ff5a0e9e753acdfb4a436b1584ffb71fd6b066 100755 (executable)
@@ -510,18 +510,19 @@ sub storage_migrate {
 
            my $zfspath = "$scfg->{pool}\/$volname";
 
-           my $snap = "zfs snapshot $zfspath\@__migration__";
+           my $snap = ['zfs', 'snapshot', "$zfspath\@__migration__"];
 
-           my $send = "zfs send -Rpv $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__";
+           my $destroy_target = ['ssh', "root\@$target_host", 'zfs', 'destroy', "$zfspath\@__migration__"];
            run_command($snap);
            eval{
                run_command($send);
            };
            my $err;
            if ($err = $@){
-               run_command("zfs destroy $zfspath\@__migration__");
+               run_command(['zfs', 'destroy', "$zfspath\@__migration__"]);
                die $err;
            }
            run_command($destroy_target);