mirror of https://gitee.com/openkylin/libvirt.git
![]() Filtering monitor events by name requires tracking the name for the duration of the filtering. In order to free the name, I found it easiest to just piggyback on the user's freecb function, which gets called when the event is deregistered. For events without a name filter, we have the design of multiple client registrations sharing a common server registration, because the server side uses the same callback function and we reject duplicate use of the same function. But with events in the mix, we want to be able to allow the same function pointer to be used with more than one event name. The solution is to tweak the duplicate detection code to only act when there is no additional filtering; if name filtering is in use, there is exactly one client registration per server registration. Yes, this means that there is no longer a bound on the number of server registrations possible, so a malicious client could repeatedly register for the same name event to exhaust server memory. On the other hand, we already restricted monitor events to require write access (compared to normal events only needing read access), and separated it into the intentionally unsupported libvirt-qemu.so, with documentation that using this function is for debug purposes only; so it is not a security risk worth worrying about a client trying to abuse multiple registrations. * src/conf/domain_event.c (virDomainQemuMonitorEventData): New struct. (virDomainQemuMonitorEventFilter) (virDomainQemuMonitorEventCleanup): New functions. (virDomainQemuMonitorEventDispatchFunc) (virDomainQemuMonitorEventStateRegisterID): Use new struct. * src/conf/object_event.c (virObjectEventCallbackListCount) (virObjectEventCallbackListAddID) (virObjectEventCallbackListRemoveID) (virObjectEventCallbackListMarkDeleteID): Drop duplicate detection when filtering is in effect. Signed-off-by: Eric Blake <eblake@redhat.com> |
||
---|---|---|
.gnulib@72fb9075b2 | ||
build-aux | ||
daemon | ||
docs | ||
examples | ||
gnulib | ||
include | ||
m4 | ||
po | ||
src | ||
tests | ||
tools | ||
.ctags | ||
.dir-locals.el | ||
.gitignore | ||
.gitmodules | ||
.mailmap | ||
AUTHORS.in | ||
COPYING | ||
COPYING.LESSER | ||
ChangeLog-old | ||
HACKING | ||
Makefile.am | ||
Makefile.nonreentrant | ||
README | ||
README-hacking | ||
TODO | ||
autobuild.sh | ||
autogen.sh | ||
bootstrap | ||
bootstrap.conf | ||
cfg.mk | ||
config-post.h | ||
configure.ac | ||
libvirt.pc.in | ||
libvirt.spec.in | ||
mingw-libvirt.spec.in | ||
run.in |
README
LibVirt : simple API for virtualization Libvirt is a C toolkit to interact with the virtualization capabilities of recent versions of Linux (and other OSes). It is free software available under the GNU Lesser General Public License. Virtualization of the Linux Operating System means the ability to run multiple instances of Operating Systems concurrently on a single hardware system where the basic resources are driven by a Linux instance. The library aim at providing long term stable C API initially for the Xen paravirtualization but should be able to integrate other virtualization mechanisms if needed. Daniel Veillard <veillard@redhat.com>