From 856de8cecd64b861f731c9af598324b471ee9f21 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Mon, 16 Apr 2012 00:27:37 +0000 Subject: [PATCH] Have IPMI not send console data if a basic IPMI health check does not pass. This means ipmi console backend may spend more time holding a lock when bmcs are unreachable, but it means that the service processor addresses are not pinged all at once git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@12242 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/ipmi.pm | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index ec7169c92..b06bd64d4 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -5628,7 +5628,20 @@ sub getipmicons { $ipmicons->{node}->[0]->{bmcaddr}->[0]=$argr->[1]; $ipmicons->{node}->[0]->{bmcuser}->[0]=$argr->[2]; $ipmicons->{node}->[0]->{bmcpass}->[0]=$argr->[3]; - $cb->($ipmicons); + my $ipmisess = xCAT::IPMI->new(bmc=>$argr->[1],userid=>$argr->[2],password=>$argr->[3]); + $ipmisess->{ipmicons} = $ipmicons; + $ipmisess->{cb} = $cb; + $ipmisess->subcmd(netfn=>0x6,command=>0x38,data=>[0x0e,0x04],callback=>\&got_channel_auth_cap_foripmicons,callback_args=>$ipmisess); +} +sub got_channel_auth_cap_foripmicons { + my $rsp = shift; + my $ipmis = shift; + if ($rsp->{error}) { + return; + } + if ($rsp->{code} != 0) { return; } + my $cb = $ipmis->{cb}; + $cb->($ipmis->{ipmicons}); #ipmicons); } @@ -5696,6 +5709,7 @@ sub process_request { foreach (@donargs) { getipmicons($_,$callback); } + while (xCAT::IPMI->waitforrsp()) { yield }; return; }