mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-30 17:45:23 +00:00
2629520342
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@redhat.com>
33 lines
856 B
Plaintext
33 lines
856 B
Plaintext
#
|
|
# Officially exported symbols, for which header
|
|
# file definitions are installed in /usr/include/libvirt
|
|
# from libvirt-qemu.h
|
|
#
|
|
# Versions here are *fixed* to match the libvirt version
|
|
# at which the symbol was introduced. This ensures that
|
|
# a new client app requiring symbol foo() can't accidentally
|
|
# run with old libvirt-qemu.so not providing foo() - the global
|
|
# soname version info can't enforce this since we never
|
|
# change the soname
|
|
#
|
|
LIBVIRT_QEMU_0.8.3 {
|
|
global:
|
|
virDomainQemuMonitorCommand;
|
|
};
|
|
|
|
LIBVIRT_QEMU_0.9.4 {
|
|
global:
|
|
virDomainQemuAttach;
|
|
} LIBVIRT_QEMU_0.8.3;
|
|
|
|
LIBVIRT_QEMU_0.10.0 {
|
|
global:
|
|
virDomainQemuAgentCommand;
|
|
} LIBVIRT_QEMU_0.9.4;
|
|
|
|
LIBVIRT_QEMU_1.2.3 {
|
|
global:
|
|
virConnectDomainQemuMonitorEventDeregister;
|
|
virConnectDomainQemuMonitorEventRegister;
|
|
} LIBVIRT_QEMU_0.10.0;
|