Use array to run_command instead of a string.
This commit is contained in:
committed by
Dietmar Maurer
parent
2d22db9a99
commit
b650f029d3
@ -510,18 +510,19 @@ sub storage_migrate {
|
|||||||
|
|
||||||
my $zfspath = "$scfg->{pool}\/$volname";
|
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);
|
run_command($snap);
|
||||||
eval{
|
eval{
|
||||||
run_command($send);
|
run_command($send);
|
||||||
};
|
};
|
||||||
my $err;
|
my $err;
|
||||||
if ($err = $@){
|
if ($err = $@){
|
||||||
run_command("zfs destroy $zfspath\@__migration__");
|
run_command(['zfs', 'destroy', "$zfspath\@__migration__"]);
|
||||||
die $err;
|
die $err;
|
||||||
}
|
}
|
||||||
run_command($destroy_target);
|
run_command($destroy_target);
|
||||||
|
|||||||
Reference in New Issue
Block a user