The type of sensor value in redfish should be double or int64?

Brad Bishop bradleyb at fuzziesquirrel.com
Wed Oct 16 10:15:19 AEDT 2019


at 6:19 PM, Ed Tanous <ed.tanous at intel.com> wrote:

> On 10/15/19 12:04 PM, Brad Bishop wrote:
>> Is it possible to get bmcweb supporting patch with double and int?  On
>> the surface this seems like the shortest path to enabling Carol.
>
> Unless phosphor-hwmon is patched to support settable sensors, I don't
> think there's a good reason to add support to bmcweb.

Ok.  A couple different questions then.

What does it mean to be settable?  phosphor-hwmon implements Sensor.Value  
and, (in violation of the interface documentation), doesn’t prevent an  
external application from writing to the properties in it.

I assumed the assertion that phosphor-hwmon doesn’t provide settable  
sensors is because the value set by an external application doesn’t stick?   
The phosphor-hwmon application logic will write over it the next time it  
polls the hwmon device.

So what does dbus-sensors do for hardware sensors?  Does the application  
ignore the hardware state after being patched via Redfish?

> With that said,
> it's just software, it could certainly be done.  Someone would need to
> sort out how to manage the scale factor, as a Redfish PATCH request
> doesn't have a concept of scale, and operates on a float, so you'd have
> to do some software handholding to convert the value to something
> appropriate before it was scaled to the int64.
>
> With that said, all of this seems like a lot of work.

I don’t know of any alternatives that are less work.  If there are some,  
I’d love to hear about them.  There were several years of OpenBMC  
development against the integer interface signature before double became a  
problem - as Patrick mentioned - undoing all that will not be trivial.

>
> Just to clarify in case anyone isn't clear, the /xyz/* and /org/* type
> REST handlers do support SetProperty for int and double, and introspects
> the daemon to determine which one should be used.  So far as I'm aware,
> the only thing non-functional is a Redfish patch of a sensor, as it's a
> bit more complex to do properly.

I had a look at the Sensor schema in the latest Resource and Schema guide  
and the sensor reading property is read only.  Why do we even allow it to  
be patched?

>
> -Ed



More information about the openbmc mailing list