Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OperatingSystemState property is not writable #6

Open
jk-ozlabs opened this issue Jul 24, 2020 · 1 comment
Open

OperatingSystemState property is not writable #6

jk-ozlabs opened this issue Jul 24, 2020 · 1 comment

Comments

@jk-ozlabs
Copy link
Member

x86-power-control exposes the OperatingSystem.Status interface, but can only set two values - Inactive and Standby.

The full enumeration available includes other states, but those are only (generally) determined by host firmware. In those cases, it's usually up to host firmware to update this state (typically by a Set Sensor Reading IPMI command, but any mechanism would be fine).

However, we currently export that property as readOnly (the default for register_property with only two arguments), so those other states cannot be set.

@jk-ozlabs
Copy link
Member Author

Something like this should be sufficient:

--- a/power-control-x86/src/power_control.cpp
+++ b/power-control-x86/src/power_control.cpp
@@ -2414,7 +2414,8 @@ int main(int argc, char* argv[])
                               : "Standby";
 
     power_control::osIface->register_property("OperatingSystemState",
-                                              std::string(osState));
+                             std::string(osState),
+                             sdbusplus::asio::PropertyPermission::readWrite);
 
     power_control::osIface->initialize();

... but I'd like to first ensure that this is something we want to enable. If so, I'll submit as a proper change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant