mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-05-29 17:23:08 +00:00
commit
2bcd8b89a0
@ -181,6 +181,7 @@ sub new {
|
||||
my $self = {};
|
||||
bless $self, $class;
|
||||
my %args = @_;
|
||||
$self->init();
|
||||
unless ($ipmi2support) {
|
||||
$self->{ipmi15only} = 1;
|
||||
}
|
||||
@ -238,7 +239,6 @@ sub new {
|
||||
} else {
|
||||
$self->{peeraddr} = sockaddr_in($self->{port}, $bmc_n);
|
||||
}
|
||||
$self->init();
|
||||
return $self;
|
||||
}
|
||||
|
||||
@ -471,6 +471,11 @@ sub checksum {
|
||||
sub subcmd {
|
||||
my $self = shift;
|
||||
my %args = @_;
|
||||
while ($self->{incommand}) {
|
||||
$self->waitforrsp(timeout=>1);
|
||||
}
|
||||
$self->{incommand} = 1;
|
||||
|
||||
$self->{expectedcmd} = $args{command};
|
||||
$self->{expectednetfn} = $args{netfn} + 1;
|
||||
if ($self->{onlogon_args}->{xcatdebugmode}) {
|
||||
@ -573,6 +578,7 @@ sub timedout {
|
||||
$self->{timeout} = $initialtimeout + (0.5 * rand());
|
||||
my $rsp = {};
|
||||
$rsp->{error} = "timeout";
|
||||
$self->{incommand} = 0;
|
||||
$self->{ipmicallback}->($rsp, $self->{ipmicallback_args});
|
||||
$self->{nowait} = 0;
|
||||
return;
|
||||
@ -833,6 +839,7 @@ sub init {
|
||||
#if we should incur 7 bumps, clear the taboo list and continue on, hoping for best (pessimistically assuming the spec means seq number or that someone could at least interpret it that way)
|
||||
#I'll implement this later...
|
||||
$self->{'logged'} = 0;
|
||||
$self->{'incommand'} = 0;
|
||||
}
|
||||
|
||||
sub relog {
|
||||
@ -1008,6 +1015,7 @@ sub parse_ipmi_payload {
|
||||
$rsp->{code} = shift @payload;
|
||||
$rsp->{data} = \@payload;
|
||||
$self->{timeout} = $initialtimeout + (0.5 * rand());
|
||||
$self->{incommand} = 0;
|
||||
$self->{ipmicallback}->($rsp, $self->{ipmicallback_args});
|
||||
return 0;
|
||||
}
|
||||
|
@ -2470,6 +2470,8 @@ sub fpc_firmxfer_watch {
|
||||
}
|
||||
}
|
||||
|
||||
my %fpcsessions;
|
||||
|
||||
sub reseat_node {
|
||||
my $sessdata = shift;
|
||||
if (1) { # TODO: FPC path checked for
|
||||
@ -2490,8 +2492,19 @@ sub reseat_node {
|
||||
my $nodeuser = $authdata->{$fpc}->{username};
|
||||
my $nodepass = $authdata->{$fpc}->{password};
|
||||
$sessdata->{slotnumber} = $mpent->{id};
|
||||
$sessdata->{fpcipmisession} = xCAT::IPMI->new(bmc => $mpent->{mpa}, userid => $nodeuser, password => $nodepass);
|
||||
$sessdata->{fpcipmisession}->login(callback => \&fpc_node_reseat, callback_args => $sessdata);
|
||||
if (exists $fpcsessions{$mpent->{mpa}}) {
|
||||
$sessdata->{fpcipmisession} = $fpcsessions{$mpent->{mpa}};
|
||||
until ($sessdata->{fpcipmisession}->{logged}) {
|
||||
$sessdata->{fpcipmisession}->waitforrsp(timeout=>1);
|
||||
}
|
||||
$sessdata->{fpcipmisession}->subcmd(netfn => 0x32, command => 0xa4,
|
||||
data => [ $sessdata->{slotnumber}, 2 ],
|
||||
callback => \&fpc_node_reseat_complete, callback_args => $sessdata);
|
||||
} else {
|
||||
$sessdata->{fpcipmisession} = xCAT::IPMI->new(bmc => $mpent->{mpa}, userid => $nodeuser, password => $nodepass);
|
||||
$fpcsessions{$mpent->{mpa}} = $sessdata->{fpcipmisession};
|
||||
$sessdata->{fpcipmisession}->login(callback => \&fpc_node_reseat, callback_args => $sessdata);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user