[Nut-upsdev] Important regression in usbhid-ups (r1113)

Arnaud Quette aquette.dev at gmail.com
Wed Feb 20 17:04:22 UTC 2008


while finishing some work on the HAL integration (I'm now mapping DBus
method with NUT commands, to allow at least the final UPS poweroff), I
was horrified to realize (and so late) the changes in
usbhid-ups->upsdrv_shutdown().

We've lost a lot there, but making a generic code, instead of keeping
the subdrivers delegation.

For example, the shutdown.return command (which is or should be the
standard UPS poweroff method) has to set both delay.shutdown *and*
delay.start does only set the latter.
It results in an immediate UPS poweroff... The same applies to
shutdown.return. And shutdown.stop should clear both shutdown and
start delay to be sure.

The reason I previously kept the subdrv delegation (apart from the
lack of visibility on other mfrs implementation) was the same as Arjen
comment: the var. and cmd dealing with shutdown clearly have to be
reworked since we have not a 1 to 1 mapping here.

This has made its way into 2.2.1 only (r1127) and the trunk (since r1113).

The fix will obviously have to go into 2.2.2, and the best would be to
keep the generic method (not subdrv delegation).

So we have 2 possibilities (non exclusive. We may apply (1) quickly,
while waiting for (2))
1) change upsdrv_shutdown() to proceed with setvar instead of (or
with) the current instcmd
2) modify the hid2nut mapping to better deal with the shutdown related
vars and commands.

Can you (all subdrivers maintainers) please ack this, make some tests
on your side and report back your feeling about that.

Arnaud
-- 
Linux / Unix Expert R&D - MGE Office Protection Systems - http://www.mgeops.com
Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/
Debian Developer - http://people.debian.org/~aquette/
Free Software Developer - http://arnaud.quette.free.fr/



More information about the Nut-upsdev mailing list