ID: 3577154 - 'lib/ipmi_mc.c' - return value of 'mc reset'

Commit adds response handling for 'mc reset' commands according to IPMI
specification.

Reported by: Duncan Idaho
This commit is contained in:
Zdenek Styblik 2012-12-20 08:53:05 +00:00
parent 791268a61c
commit 5dbb6b69de

View File

@ -79,6 +79,17 @@ ipmi_mc_reset(struct ipmi_intf * intf, int cmd)
if (cmd == BMC_COLD_RESET)
intf->abort = 1;
if (cmd == BMC_COLD_RESET && rsp == NULL) {
/* This is expected. See 20.2 Cold Reset Command, p.243, IPMIv2.0 rev1.0 */
} else if (rsp == NULL) {
lprintf(LOG_ERR, "MC reset command failed.");
return (-1);
} else if (rsp->ccode > 0) {
lprintf(LOG_ERR, "MC reset command failed: %s",
val2str(rsp->ccode, completion_code_vals));
return (-1);
}
printf("Sent %s reset command to MC\n",
(cmd == BMC_WARM_RESET) ? "warm" : "cold");