commit | 379b11316d55b114bdb1bfc5a49839b09ade9038 | [log] [tgz] |
---|---|---|
author | Patrick Williams <patrick@stwcx.xyz> | Thu Sep 02 05:42:25 2021 -0500 |
committer | Patrick Williams <patrick@stwcx.xyz> | Thu Sep 02 05:48:50 2021 -0500 |
tree | bc88c168344d5f148da0120c060d7515a946e74b | |
parent | 2932a7bb38e49ee79ec87114927b3d95a82f18cd [diff] |
sensor: remove exception in error path Any ASIO property callback handler should *not* throw an exception. This will crash the application because there is nothing in the ASIO stack that catches the exception and turns it into an sd_bus_error. It is also invalid to construct an SdBusError because it is an internal class type of sdbusplus. Instead of throwing the bad exception and crashing the sensor application, print an error message and return the intended -ERRNO (EACCES), so that sd_bus will pass it back along to the dbus client as an sd_bus_error response. The behavior of the underlying sd_bus library can be observed at: https://github.com/systemd/systemd/blob/a4121e965f43bc323ec3c0ac212cee9d339f7be0/src/libsystemd/sd-bus/bus-objects.c#L520 https://github.com/systemd/systemd/blob/a4121e965f43bc323ec3c0ac212cee9d339f7be0/src/libsystemd/sd-bus/bus-objects.c#L683 Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Icd6dfc30eb6aa4d17c846b28c69ca4a5aa253d61
dbus-sensors is a collection of sensor applications that provide the xyz.openbmc_project.Sensor collection of interfaces. They read sensor values from hwmon, d-bus, or direct driver access to provide readings. Some advance non-sensor features such as fan presence, pwm control, and automatic cpu detection (x86) are also supported.
runtime re-configurable from d-bus (entity-manager or the like)
isolated: each sensor type is isolated into its own daemon, so a bug in one sensor is unlikely to affect another, and single sensor modifications are possible
async single-threaded: uses sdbusplus/asio bindings
multiple data inputs: hwmon, d-bus, direct driver access