mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 18:47:22 +00:00
chassis: Use command-specific completion code parser
Get/set system boot option commands have some command-specific completion codes that are now reported as "Unknown (0080)", etc. Use the previously introduced specific_val2str() to convert those specific error codes to human-readable strings. Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
This commit is contained in:
parent
73d6af5782
commit
de1d5c9924
@ -46,6 +46,18 @@
|
|||||||
|
|
||||||
extern int verbose;
|
extern int verbose;
|
||||||
|
|
||||||
|
const static struct valstr get_bootparam_cc_vals[] = {
|
||||||
|
{ 0x80, "Unsupported parameter" },
|
||||||
|
{ 0x00, NULL }
|
||||||
|
};
|
||||||
|
|
||||||
|
const static struct valstr set_bootparam_cc_vals[] = {
|
||||||
|
{ 0x80, "Unsupported parameter" },
|
||||||
|
{ 0x81, "Attempt to set 'in progress' while not in 'complete' state" },
|
||||||
|
{ 0x82, "Parameter is read-only" },
|
||||||
|
{ 0x00, NULL }
|
||||||
|
};
|
||||||
|
|
||||||
int
|
int
|
||||||
ipmi_chassis_power_status(struct ipmi_intf * intf)
|
ipmi_chassis_power_status(struct ipmi_intf * intf)
|
||||||
{
|
{
|
||||||
@ -469,8 +481,12 @@ ipmi_chassis_set_bootparam(struct ipmi_intf * intf, uint8_t param, uint8_t * dat
|
|||||||
}
|
}
|
||||||
if (rsp->ccode) {
|
if (rsp->ccode) {
|
||||||
if (param != 0) {
|
if (param != 0) {
|
||||||
lprintf(LOG_ERR, "Set Chassis Boot Parameter %d failed: %s",
|
lprintf(LOG_ERR,
|
||||||
param, val2str(rsp->ccode, completion_code_vals));
|
"Set Chassis Boot Parameter %d failed: %s",
|
||||||
|
param,
|
||||||
|
specific_val2str(rsp->ccode,
|
||||||
|
set_bootparam_cc_vals,
|
||||||
|
completion_code_vals));
|
||||||
}
|
}
|
||||||
return rsp->ccode;
|
return rsp->ccode;
|
||||||
}
|
}
|
||||||
@ -514,8 +530,12 @@ ipmi_chassis_get_bootparam(struct ipmi_intf * intf, char * arg)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (rsp->ccode) {
|
if (rsp->ccode) {
|
||||||
lprintf(LOG_ERR, "Get Chassis Boot Parameter %s failed: %s",
|
lprintf(LOG_ERR,
|
||||||
arg, val2str(rsp->ccode, completion_code_vals));
|
"Get Chassis Boot Parameter %s failed: %s",
|
||||||
|
arg,
|
||||||
|
specific_val2str(rsp->ccode,
|
||||||
|
get_bootparam_cc_vals,
|
||||||
|
completion_code_vals));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -832,7 +852,10 @@ ipmi_chassis_get_bootvalid(struct ipmi_intf * intf)
|
|||||||
}
|
}
|
||||||
if (rsp->ccode) {
|
if (rsp->ccode) {
|
||||||
lprintf(LOG_ERR, "Get Chassis Boot Parameter %d failed: %s",
|
lprintf(LOG_ERR, "Get Chassis Boot Parameter %d failed: %s",
|
||||||
param_id, val2str(rsp->ccode, completion_code_vals));
|
param_id,
|
||||||
|
specific_val2str(rsp->ccode,
|
||||||
|
get_bootparam_cc_vals,
|
||||||
|
completion_code_vals));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user