summaryrefslogtreecommitdiffstats
path: root/chassishandler.cpp
diff options
context:
space:
mode:
authorMarri Devender Rao <devenrao@in.ibm.com>2018-05-07 01:06:23 -0500
committerVernon Mauery <vernon.mauery@linux.intel.com>2018-05-08 21:53:13 +0000
commit54fa13068e049ac8fe866ad2d96f89f1623c6645 (patch)
tree54b5762f370809de63d10901a637621a1816d7a8 /chassishandler.cpp
parent8171970a5ecfa1aa5b8b80b4418bf0f9fd8304e8 (diff)
downloadphosphor-host-ipmid-54fa13068e049ac8fe866ad2d96f89f1623c6645.tar.gz
phosphor-host-ipmid-54fa13068e049ac8fe866ad2d96f89f1623c6645.zip
Fix get boot options returning unexpected results
Get boot options is returning wrong value when boot device is set to cdrom followed by setting boot device to bios. In the IPMI spec the boot device selector has options for both "boot source" (default/disk/crdom/network) and "boot mode" (default/bios/safe/diag). Since this isn't a bit field, you can't override for eg both the source and mode at the same time. The solution is if a set boot device is mapping to a boot source, then reset the boot mode D-Bus property to default, or vice versa. This way the ipmid code can determine which property is not at the default value Resolves openbmc/openbmc#3067 Resolves openbmc/openbmc#3068 Change-Id: I072c82a161d56f118510fe1f9e5c75cb5c610295 Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
Diffstat (limited to 'chassishandler.cpp')
-rw-r--r--chassishandler.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/chassishandler.cpp b/chassishandler.cpp
index 9c0a97b..0ee593c 100644
--- a/chassishandler.cpp
+++ b/chassishandler.cpp
@@ -1446,6 +1446,14 @@ ipmi_ret_t ipmi_chassis_set_sys_boot_options(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
*data_len = 0;
return rc;
}
+ // If a set boot device is mapping to a boot source, then reset
+ // the boot mode D-Bus property to default.
+ // This way the ipmid code can determine which property is not
+ // at the default value
+ if(sourceItr->second != Source::Sources::Default)
+ {
+ setBootMode(Mode::Modes::Regular);
+ }
}
if (modeIpmiToDbus.end() != modeItr)
{
@@ -1455,6 +1463,14 @@ ipmi_ret_t ipmi_chassis_set_sys_boot_options(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
*data_len = 0;
return rc;
}
+ // If a set boot device is mapping to a boot mode, then reset
+ // the boot source D-Bus property to default.
+ // This way the ipmid code can determine which property is not
+ // at the default value
+ if(modeItr->second != Mode::Modes::Regular)
+ {
+ setBootSource(Source::Sources::Default);
+ }
}
}
catch (InternalFailure& e)
OpenPOWER on IntegriCloud