aboutsummaryrefslogtreecommitdiff
path: root/util/event_notifier-posix.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2016-03-15 19:34:20 +0100
committerMarkus Armbruster <armbru@redhat.com>2016-03-21 21:28:59 +0100
commit330b58368ca16c31efdadcf8263f7f903546af50 (patch)
tree312ec2338bd7d0b6c2953a2e5dde097a2ee82e7d /util/event_notifier-posix.c
parentad4929384b64ffc9908915fd40cb80f455835d4a (diff)
downloadqemu-330b58368ca16c31efdadcf8263f7f903546af50.zip
qemu-330b58368ca16c31efdadcf8263f7f903546af50.tar.gz
qemu-330b58368ca16c31efdadcf8263f7f903546af50.tar.bz2
event_notifier: Make event_notifier_init_fd() #ifdef CONFIG_EVENTFD
Event notifiers are designed for eventfd(2). They can fall back to pipes, but according to Paolo, event_notifier_init_fd() really requires the real thing, and should therefore be under #ifdef CONFIG_EVENTFD. Do that. Its only user is ivshmem, which is currently CONFIG_POSIX. Narrow it to CONFIG_EVENTFD. Cc: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <1458066895-20632-6-git-send-email-armbru@redhat.com>
Diffstat (limited to 'util/event_notifier-posix.c')
-rw-r--r--util/event_notifier-posix.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/util/event_notifier-posix.c b/util/event_notifier-posix.c
index 2e30e74..c9657a6 100644
--- a/util/event_notifier-posix.c
+++ b/util/event_notifier-posix.c
@@ -20,11 +20,17 @@
#include <sys/eventfd.h>
#endif
+#ifdef CONFIG_EVENTFD
+/*
+ * Initialize @e with existing file descriptor @fd.
+ * @fd must be a genuine eventfd object, emulation with pipe won't do.
+ */
void event_notifier_init_fd(EventNotifier *e, int fd)
{
e->rfd = fd;
e->wfd = fd;
}
+#endif
int event_notifier_init(EventNotifier *e, int active)
{