On 2012年03月09日 16:55, Daniel Veillard wrote:
On Mon, Mar 05, 2012 at 06:25:39PM +0800, Osier Yang wrote:
This patch introduces a new event type for the QMP event
DEVICE_TRAY_MOVED, which occurs when the tray of a removable
disk is moved (i.e opened or closed):
The event's data includes the device alias and the tray's
status, which indicates whether the tray has been opened
or closed. Thus the callback definition for the event is:
const char *devAlias,
unsigned int trayOpened,
Hum ... could we make that slightly more generic.
Instead of just being able to report on tray opened or not (i.e. closed)
Let's report TrayChangeCallback, and have an 'int reason' instead.
Hmm, yes, 'int reason' is good idea.
But for the name, TrayMoved might describe the real action more
precisely. Unlike DiskChange, it says there was some medium was
changed, TrayMoved only intends to report the tray status changeing
event, nothing really changed, or we can rename it to TrayStatusChange
to indicate the tray status is changed, but IMO it's not much
difference except getting a longer name. :-)
Then for example the API would be able to cope with more set of events,
one of the thing I can think of now would be the ability to emulate
multiple device in one as disk changers,
What does "emulate multiple device" mean? is it "s/device/event/"?