use JSON;
use PVE::Tools;
use PVE::Cluster;
+use PVE::DataCenterConfig;
use PVE::ReplicationState;
+use PVE::SSHInfo;
my $msg2text = sub {
my ($level, $msg) = @_;
my ($self, $func, @param) = @_;
eval {
- local $SIG{INT} = $SIG{TERM} = $SIG{QUIT} = $SIG{HUP} = sub {
- $self->{delayed_interrupt} = 0;
- die "interrupted by signal\n";
- };
- local $SIG{PIPE} = sub {
- $self->{delayed_interrupt} = 0;
- die "interrupted by signal\n";
+ local $SIG{INT} =
+ local $SIG{TERM} =
+ local $SIG{QUIT} =
+ local $SIG{HUP} =
+ local $SIG{PIPE} = sub {
+ $self->{delayed_interrupt} = 0;
+ die "interrupted by signal\n";
};
my $di = $self->{delayed_interrupt};
};
};
-my @ssh_opts = ('-o', 'BatchMode=yes');
-my @ssh_cmd = ('/usr/bin/ssh', @ssh_opts);
-
# FIXME: nodeip is now unused
sub migrate {
my ($class, $node, $nodeip, $vmid, $opts) = @_;
if (!defined($migration_network)) {
$migration_network = $dc_conf->{migration}->{network};
}
- my $ssh_info = PVE::Cluster::get_ssh_info($node, $migration_network);
+ my $ssh_info = PVE::SSHInfo::get_ssh_info($node, $migration_network);
$nodeip = $ssh_info->{ip};
my $migration_type = 'secure';
node => $node,
ssh_info => $ssh_info,
nodeip => $nodeip,
- rem_ssh => PVE::Cluster::ssh_info_to_command($ssh_info)
+ rem_ssh => PVE::SSHInfo::ssh_info_to_command($ssh_info)
};
$self = bless $self, $class;
my $starttime = time();
- local $SIG{INT} = $SIG{TERM} = $SIG{QUIT} = $SIG{HUP} = $SIG{PIPE} = sub {
- $self->log('err', "received interrupt - delayed");
- $self->{delayed_interrupt} = 1;
+ local $SIG{INT} =
+ local $SIG{TERM} =
+ local $SIG{QUIT} =
+ local $SIG{HUP} =
+ local $SIG{PIPE} = sub {
+ $self->log('err', "received interrupt - delayed");
+ $self->{delayed_interrupt} = 1;
};
# lock container during migration