[Qemu-devel] [PATCH V3 0/3] usb-gotemp: USB thermometer emulation

2009-11-10 Thread Scott Tsai
I reworked the second patch in this series to add generic monitor commands
to change the temperature reported from thermometers. 
Thermometer devices can now include sensor.h and call 
'qemu_add_therm_temp_handler'
to register themselves.

I went with separate 'therm_set DEVICE_INDEX' and 'therm_temp TEMPERATURE' 
commands
since a 'therm_temp' command that only requires one argument seems easier
to use on the monitor command line and doesn't require searching the
list of thermometers repeatedly.

To cater to my original driver tutorial use case,
by default the temperature would still automatically increment unless
the 'controlled_by_monitor' qdev property is set.
Even when auto incrementing the temperature is now always bounded between 25C ~ 
40C.
(previously the temperature would increment until int16_t overflows)




Re: [Qemu-devel] [PATCH V3 0/3] usb-gotemp: USB thermometer emulation

2009-11-10 Thread Paul Brook
On Wednesday 11 November 2009, Scott Tsai wrote:
 I reworked the second patch in this series to add generic monitor commands
 to change the temperature reported from thermometers.
 Thermometer devices can now include sensor.h and call
  'qemu_add_therm_temp_handler' to register themselves.

This is just another HID device. As discussed previously in the context of the 
wacom tablet, duplicating this code is bad (IMO usb-wacom.c should ever have 
been committed).  Instead you should be sharing the existing code.

Paul