[libvirt] [PATCH 1/6] qemu: new API for tracking arbitrary monitor events
Daniel P. Berrange
berrange at redhat.com
Tue Feb 11 15:03:34 UTC 2014
On Fri, Jan 31, 2014 at 07:12:06PM -0700, Eric Blake wrote:
> Several times in the past, qemu has implemented a new event,
> but libvirt has not yet caught up to reporting that event to
> the user applications. While it is possible to track libvirt
> logs to see that an unknown event was received and ignored,
> it would be nicer to copy what 'virsh qemu-monitor-command'
> does, and expose this information to the end developer as
> one of our unsupported qemu-specific commands.
>
> If you find yourself needing to use this API for more than
> just development purposes, please ask on the libvirt list
> for a supported counterpart event to be added in libvirt.so.
>
> While the supported virConnectDomainEventRegisterAny() API
> takes an id which determines the signature of the callback,
> this version takes a string filter and always uses the same
> signature. Furthermore, I chose to expose this as a new API
> instead of trying to add a new eventID at the top level, in
> part because the generic option lacks event name filtering,
> and in part because the normal domain event namespace should
> not be polluted by a qemu-only event. I also added a flags
> argument; unused for now, but we might decide to use it to
> allow a user to request event names by glob or regex instead
> of literal match.
>
> This API intentionally requires full write access (while
> normal event registration is allowed on read-only clients);
> this is in part due to the fact that it should only be used
> by debugging situations, and in part because the design of
> per-event filtering in later patches ended up allowing for
> duplicate registrations that could potentially be abused to
> exhaust server memory - requiring write privileges means
> that such abuse will not serve as a denial of service attack
> against users with higher privileges.
>
> * include/libvirt/libvirt-qemu.h
> (virConnectDomainQemuMonitorEventCallback)
> (virConnectDomainQemuMonitorEventRegister)
> (virConnectDomainQemuMonitorEventDeregister): New prototypes.
> * src/libvirt-qemu.c (virConnectDomainQemuMonitorEventRegister)
> (virConnectDomainQemuMonitorEventDeregister): New functions.
> * src/libvirt_qemu.syms (LIBVIRT_QEMU_1.2.1): Export them.
> * src/driver.h (virDrvConnectDomainQemuMonitorEventRegister)
> (virDrvConnectDomainQemuMonitorEventDeregister): New callbacks.
>
> Signed-off-by: Eric Blake <eblake at redhat.com>
> ---
> include/libvirt/libvirt-qemu.h | 36 +++++++++++-
> src/driver.h | 17 +++++-
> src/libvirt-qemu.c | 121 +++++++++++++++++++++++++++++++++++++++++
> src/libvirt_qemu.syms | 6 ++
> 4 files changed, 178 insertions(+), 2 deletions(-)
ACK
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
More information about the libvir-list
mailing list