]> xenbits.xensource.com Git - libvirt.git/commit
Add support for event tray moved of removable disks
authorOsier Yang <jyang@redhat.com>
Fri, 23 Mar 2012 13:44:50 +0000 (21:44 +0800)
committerOsier Yang <jyang@redhat.com>
Fri, 23 Mar 2012 15:10:26 +0000 (23:10 +0800)
commita26a1969c37c865b18294c5717544c1dc90beb3c
treeef2b2fc5785ae3e052c128fbc1b630f8c9dda9c2
parent25d3a2e01fa4c19e6c41e62f19eb5eef041db943
Add support for event tray moved of removable disks

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):

    VIR_DOMAIN_EVENT_ID_TRAY_CHANGE

The event's data includes the device alias and the reason
for tray status' changing, which indicates why the tray
status was changed. Thus the callback definition for the event
is:

enum {
    VIR_DOMAIN_EVENT_TRAY_CHANGE_OPEN = 0,
    VIR_DOMAIN_EVENT_TRAY_CHANGE_CLOSE,

\#ifdef VIR_ENUM_SENTINELS
    VIR_DOMAIN_EVENT_TRAY_CHANGE_LAST
\#endif
} virDomainEventTrayChangeReason;

typedef void
(*virConnectDomainEventTrayChangeCallback)(virConnectPtr conn,
                                           virDomainPtr dom,
                                           const char *devAlias,
                                           int reason,
                                           void *opaque);
16 files changed:
daemon/remote.c
examples/domain-events/events-c/event-test.c
examples/domain-events/events-python/event-test.py
include/libvirt/libvirt.h.in
python/libvirt-override-virConnect.py
python/libvirt-override.c
src/conf/domain_event.c
src/conf/domain_event.h
src/libvirt_private.syms
src/qemu/qemu_monitor.c
src/qemu/qemu_monitor.h
src/qemu/qemu_monitor_json.c
src/qemu/qemu_process.c
src/remote/remote_driver.c
src/remote/remote_protocol.x
src/remote_protocol-structs