From 19242f88c210c9da6c5d6ca042b1cb2ec2bcf8d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?= <2031761+viniciusferrao@users.noreply.github.com> Date: Thu, 29 Oct 2026 15:12:56 -0300 Subject: [PATCH] fix(ipmi): report device ID and SDR errors against the node When Get Device ID or a step of the SDR read failed, the plugin reported the error through sendoutput. Seven of these calls passed an array reference, which sendoutput takes as its return code, so the error was dropped. The other five named the node BADCODE. A refused SDR reservation also went on to read records with no reservation ID. Report these errors with sendmsg against the node, as the rest of the plugin does, and stop after a refused reservation. --- xCAT-server/lib/xcat/plugins/ipmi.pm | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index e683d872e9..9081e06921 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -7653,12 +7653,12 @@ sub initsdr_withrepinfo { if ($sessdata->{sdr_info}->{version} != 0x51) { - sendoutput(1, "SDR version unsupported."); + xCAT::SvrUtils::sendmsg([ 1, "SDR version unsupported." ], $callback, $sessdata->{node}, %allerrornodes); return (1); #bail, do not try to continue } if ($sessdata->{sdr_info}->{resv_sdr} != 1) { - sendoutput(1, "SDR reservation unsupported."); + xCAT::SvrUtils::sendmsg([ 1, "SDR reservation unsupported." ], $callback, $sessdata->{node}, %allerrornodes); return 1; } @@ -7695,7 +7695,7 @@ sub start_sdr_record { my $rsp = shift; my $sessdata = shift; if ($rsp->{error}) { - sendoutput(1, $rsp->{error}); + xCAT::SvrUtils::sendmsg([ 1, $rsp->{error} ], $callback, $sessdata->{node}, %allerrornodes); return; } my $resv_id_ls = shift @{ $sessdata->{sdr_fetch_args} }; @@ -7709,7 +7709,7 @@ sub start_sdr_record { if (!$text) { $text = sprintf("unknown response %02x", $code); } - sendoutput(1, $text); + xCAT::SvrUtils::sendmsg([ 1, $text ], $callback, $sessdata->{node}, %allerrornodes); return; } $sessdata->{sdr_nrid_ls} = $returnd[1]; @@ -7763,7 +7763,7 @@ sub add_sdr_data { my $numbytes = $sessdata->{sdr_fetch_args}->[5]; my $offset = $sessdata->{sdr_offset}; #shorten typing a little if ($rsp->{error}) { - sendoutput([ 1, $rsp->{error} ]); + xCAT::SvrUtils::sendmsg([ 1, $rsp->{error} ], $callback, $sessdata->{node}, %allerrornodes); return; #give up } my @returnd = ($rsp->{code}, @{ $rsp->{data} }); @@ -7773,7 +7773,7 @@ sub add_sdr_data { if (!$text) { $text = sprintf("unknown response %02x", $code); } - sendoutput([ 1, $text ]); + xCAT::SvrUtils::sendmsg([ 1, $text ], $callback, $sessdata->{node}, %allerrornodes); return; #abort the whole mess } push @{ $sessdata->{sdr_data} }, @returnd[ 3 .. @returnd - 1 ]; @@ -7996,7 +7996,7 @@ sub gotdevid { my $text; if ($rsp->{error}) { - sendoutput([ 1, $rsp->{error} ]); + xCAT::SvrUtils::sendmsg([ 1, $rsp->{error} ], $callback, $sessdata->{node}, %allerrornodes); return; } else { @@ -8007,7 +8007,7 @@ sub gotdevid { if (!$text) { $text = sprintf("unknown response %02x", $code); } - sendoutput([ 1, $text ]); + xCAT::SvrUtils::sendmsg([ 1, $text ], $callback, $sessdata->{node}, %allerrornodes); return; } } @@ -8093,7 +8093,7 @@ sub got_sdr_rep_info { my $sessdata = shift; if ($rsp->{error}) { - sendoutput([ 1, $rsp->{error} ]); + xCAT::SvrUtils::sendmsg([ 1, $rsp->{error} ], $callback, $sessdata->{node}, %allerrornodes); return; } else { @@ -8104,7 +8104,7 @@ sub got_sdr_rep_info { if (!$text) { $text = sprintf("unknown response %02x", $code); } - sendoutput(1, $text); + xCAT::SvrUtils::sendmsg([ 1, $text ], $callback, $sessdata->{node}, %allerrornodes); return; } } @@ -8119,7 +8119,7 @@ sub reserved_sdr_repo { my $rsp = shift; my $sessdata = shift; if ($rsp->{error}) { - sendoutput([ 1, $rsp->{error} ]); + xCAT::SvrUtils::sendmsg([ 1, $rsp->{error} ], $callback, $sessdata->{node}, %allerrornodes); return; } else { @@ -8130,7 +8130,8 @@ sub reserved_sdr_repo { if (!$text) { $text = sprintf("unknown response %02x", $code); } - sendoutput([ 1, $text ]); + xCAT::SvrUtils::sendmsg([ 1, $text ], $callback, $sessdata->{node}, %allerrornodes); + return; } } my @returnd = @{ $rsp->{data} };