From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41636) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agxmH-0006Tr-9F for qemu-devel@nongnu.org; Fri, 18 Mar 2016 13:01:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1agxmG-000835-At for qemu-devel@nongnu.org; Fri, 18 Mar 2016 13:01:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55286) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agxmF-00082l-Tb for qemu-devel@nongnu.org; Fri, 18 Mar 2016 13:01:32 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 7D3FEC05005E for ; Fri, 18 Mar 2016 17:01:31 +0000 (UTC) From: Markus Armbruster Date: Fri, 18 Mar 2016 18:00:52 +0100 Message-Id: <1458320487-19603-6-git-send-email-armbru@redhat.com> In-Reply-To: <1458320487-19603-1-git-send-email-armbru@redhat.com> References: <1458320487-19603-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PULL 05/40] event_notifier: Make event_notifier_init_fd() #ifdef CONFIG_EVENTFD List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini 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 Signed-off-by: Markus Armbruster Reviewed-by: Paolo Bonzini Message-Id: <1458066895-20632-6-git-send-email-armbru@redhat.com> --- default-configs/pci.mak | 2 +- util/event_notifier-posix.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/default-configs/pci.mak b/default-configs/pci.mak index 4fa9a28..9c8bc68 100644 --- a/default-configs/pci.mak +++ b/default-configs/pci.mak @@ -36,5 +36,5 @@ CONFIG_SDHCI=y CONFIG_EDU=y CONFIG_VGA=y CONFIG_VGA_PCI=y -CONFIG_IVSHMEM=$(CONFIG_POSIX) +CONFIG_IVSHMEM=$(CONFIG_EVENTFD) CONFIG_ROCKER=y 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 #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) { -- 2.4.3