]> git.ipfire.org Git - thirdparty/libvirt.git/commit
src: introduce helper API for creating GSource for socket
authorDaniel P. Berrangé <berrange@redhat.com>
Fri, 24 Jan 2020 13:44:29 +0000 (13:44 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Fri, 7 Feb 2020 15:03:53 +0000 (15:03 +0000)
commit5de317b8e742699a9de3db2b5ad299d718b2b45e
tree807f8455c10baa0d790bef0790489fef10f1ecf8
parentdc0771cfa2e78ffecd7c8234538ee548748d7bef
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: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
build-aux/syntax-check.mk
src/util/Makefile.inc.am
src/util/vireventglibwatch.c [new file with mode: 0644]
src/util/vireventglibwatch.h [new file with mode: 0644]