[Nut-upsdev] [PATCH/RFC 1/1] APC smart driver update and new features.
Michal Soltys
soltys at ziu.info
Wed Jan 26 14:52:42 UTC 2011
W dniu 26.01.2011 11:54, Arjen de Korte pisze:
> Citeren rasengan rootish <root at relay.ppgk.com.pl>:
Ups, sorry for ridiculous from: ...
>
> In case you happen to have a UPS that does report both 'battery.charge'
> and 'battery.charge.low' but for some mysterious reason doesn't use that
> to set the LB flag, you can always use 'override.battery.charge.low=0'
> to disable it.
>
Allright.
I think I found one bug with flag handling though:
dstate_setflags() uses = when setting new flags. This has a side effect,
that any later setflags() call will override earlier flags (as
expected), but that also includes the immutable flag (and that we don't
want, as it will enable the ups to e.g. poll and update the variable at
will afterwards). It could be fixed in a few ways:
1) make sure each driver reads the variable first and preserves
immutable flag (probably lots of fixing all over the place)
2) dstate_setflags() could use an extra argument to specify if to
preserve or not
3) make that an immutable flag once set, cannot be unset (simple,
probably good solution, as immutable flags come from override.*)
4) something else
I'd choose #3, but ...
More information about the Nut-upsdev
mailing list