From c927922214cf1dce0e3751aa0cf5b35e6919168f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edwin=20T=C3=B6r=C3=B6k?= Date: Mon, 15 Apr 2024 09:53:00 +0100 Subject: [PATCH] IH-543: guard against buggy firmware MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There are reports of buggy firmware returning 0 ort65535 Watts. Guard against these by declaring min/max (although xcp-rrdd doesn't actually correctly ignore these yet, but that is a separate bug to be fixed). Signed-off-by: Edwin Török --- ocaml/xcp-rrdd/bin/rrdp-dcmi/rrdp_dcmi.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ocaml/xcp-rrdd/bin/rrdp-dcmi/rrdp_dcmi.ml b/ocaml/xcp-rrdd/bin/rrdp-dcmi/rrdp_dcmi.ml index 1246234346..9e45a91eea 100644 --- a/ocaml/xcp-rrdd/bin/rrdp-dcmi/rrdp_dcmi.ml +++ b/ocaml/xcp-rrdd/bin/rrdp-dcmi/rrdp_dcmi.ml @@ -64,7 +64,7 @@ let gen_dcmi_power_reading value = ( Rrd.Host , Ds.ds_make ~name:"DCMI-power-reading" ~description:"Host power usage reported by IPMI DCMI" - ~value:(Rrd.VT_Int64 value) ~ty:Rrd.Gauge ~default:true ~units:"W" ~min:0. + ~value:(Rrd.VT_Int64 value) ~ty:Rrd.Gauge ~default:true ~units:"W" ~min:Float.min_float ~max:65534. () )