This series adds support for (nearly) all QEMU event notifications
that are currently supported by the new JSON mode monitor.
- Guest reboot
- RTC adjustment
- Watchdog firing
- Block IO errors
- Graphics client connect/disconnect
It required two new public APIs, and a bunch of extra function
callback typedefs which will be shown in each following commit
message.
This scheme is extensible to support any further events against
domains.
It does not support events on other types of object (storage,
node devices, etc), but those can follow exactly the same API
design scheme should we need them in the future. We don't want
to unify them at the public API level, since internally they
need to dispatch to separate drivers anyway.
I'm generally happy with the public API for the events, with
the exception of the graphics event which is horribly complex
due to the large amount of data. I'm not sure if there's a way
to make that event nicer....
The full diffstat for all patches
daemon/dispatch.h | 10
daemon/libvirtd.c | 20
daemon/libvirtd.h | 2
daemon/remote.c | 348 ++++++++++++++--
daemon/remote_dispatch_args.h | 2
daemon/remote_dispatch_prototypes.h | 16
daemon/remote_dispatch_table.h | 37 +
examples/domain-events/events-c/event-test.c | 168 ++++++-
include/libvirt/libvirt.h.in | 106 ++++
src/conf/domain_event.c | 580 ++++++++++++++++++++++++---
src/conf/domain_event.h | 82 +++
src/driver.c | 4
src/driver.h | 18
src/esx/esx_driver.c | 2
src/libvirt.c | 133 +++++-
src/libvirt_private.syms | 16
src/libvirt_public.syms | 6
src/lxc/lxc_driver.c | 60 ++
src/opennebula/one_driver.c | 2
src/openvz/openvz_driver.c | 2
src/phyp/phyp_driver.c | 2
src/qemu/qemu_driver.c | 290 +++++++++++++
src/qemu/qemu_monitor.c | 77 +++
src/qemu/qemu_monitor.h | 39 +
src/qemu/qemu_monitor_json.c | 144 ++++++
src/remote/remote_driver.c | 459 +++++++++++++++++----
src/remote/remote_protocol.c | 111 +++++
src/remote/remote_protocol.h | 185 ++++++--
src/remote/remote_protocol.x | 65 ++-
src/test/test_driver.c | 58 ++
src/uml/uml_driver.c | 2
src/vbox/vbox_tmpl.c | 155 +++++--
src/xen/xen_driver.c | 71 ++-
src/xenapi/xenapi_driver.c | 2
34 files changed, 2947 insertions(+), 327 deletions(-)
Daniel