[Nut-upsdev] [nut-commits] svn commit r1074 - in trunk: . drivers

Peter Selinger selinger at mathstat.dal.ca
Fri Aug 24 22:33:06 UTC 2007


Arjen de Korte wrote:
> 
> * drivers/libhid.c:
> - The 'exact' matcher now also matches the Bus too (this won't
> change as long as the USB plug is not removed). If you don't like
> this, use the 'regex' matcher instead.

Ooh, I don't like this last one at all. One of the main reasons a
device might get disconnected is that the user physically unplugs it
while it is in operation, and then plugs it back in. Unlikely in a
server configuration, but not so unlikely for desktops. Perhaps they
had to physically move the machine, or just untangle some cables. The
user may or may not manage to hit the same physical plug, or even to
remember which one it was. It was a useful feature of NUT that it
handled such events transparently. 

I suggest reversing this change.

> * drivers/usbhid-ups.c:
> - The behaviour of reconnect is now depending on the 'reloadmatcher'
> variable. By default, it uses 'exact' matches, but this can be
> changed to 'regex', which me ans that it will use MODE_OPEN instead
> of MODE_REOPEN. Essentially, it will beha ve exactly like starting
> again.

Shouldn't the default be to use exact matching whenever possible, and
fall back to MODE_OPEN matching on failure (i.e., the currently
intended behavior)? The other choice, which a user might request, is
strict matching, i.e., to enforce exact matching all the time. I am
not sure why anyone would request exact matching to be specifically
turned off. Do I interpret the above log message correctly that the
user now only has a choice between always-lax and always-strict
matching? 

-- Peter






More information about the Nut-upsdev mailing list