]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: enable monitor event reporting
authorEric Blake <eblake@redhat.com>
Thu, 30 Jan 2014 00:14:44 +0000 (17:14 -0700)
committerEric Blake <eblake@redhat.com>
Thu, 20 Mar 2014 17:25:37 +0000 (11:25 -0600)
commit3566599a2f19638538c98748e1271d2a7317be00
treed974fd1e9b0ecc9aed05fd752b8305bbd918ba68
parente7708a1c476202029c8c948941ec08a0ffa9b5ab
qemu: enable monitor event reporting

Wire up all the pieces to send arbitrary qemu events to a
client using libvirt-qemu.so.  If the extra bookkeeping of
generating event objects even when no one is listening turns
out to be noticeable, we can try to further optimize things
by adding a counter for how many connections are using events,
and only dump events when the counter is non-zero; but for
now, I didn't think it was worth the code complexity.

* src/qemu/qemu_driver.c
(qemuConnectDomainQemuMonitorEventRegister)
(qemuConnectDomainQemuMonitorEventDeregister): New functions.
* src/qemu/qemu_monitor.h (qemuMonitorEmitEvent): New prototype.
(qemuMonitorDomainEventCallback): New typedef.
* src/qemu/qemu_monitor_json.c (qemuMonitorJSONIOProcessEvent):
Report events.
* src/qemu/qemu_monitor.c (qemuMonitorEmitEvent): New function, to
pass events through.
* src/qemu/qemu_process.c (qemuProcessHandleEvent): Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
src/qemu/qemu_driver.c
src/qemu/qemu_monitor.c
src/qemu/qemu_monitor.h
src/qemu/qemu_monitor_json.c
src/qemu/qemu_process.c