src: introduce helper API for creating GSource for socket
We need to be able to create event loop watches using the GSource API for sockets. GIOChannel is able todo this, but we don't want to use the GIOChannel APIs for reading/writing, and testing shows just using its GSource APIs is unreliable on Windows. This patch thus creates a standalone helper API for creating a GSource for a socket file descriptor. This impl is derived from code in QEMU's io/channel-watch.c file that was written by myself & Paolo Bonzini & thus under Red Hat copyright. Reviewed-by: NPavel Hrdina <phrdina@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
Showing
src/util/vireventglibwatch.c
0 → 100644
src/util/vireventglibwatch.h
0 → 100644
想要评论请 注册 或 登录