From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60011) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaiak-0006PT-U3 for qemu-devel@nongnu.org; Tue, 01 Mar 2016 06:35:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aaiaj-0004E2-NP for qemu-devel@nongnu.org; Tue, 01 Mar 2016 06:35:50 -0500 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:34055) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaiaj-0004Dv-7i for qemu-devel@nongnu.org; Tue, 01 Mar 2016 06:35:49 -0500 Received: by mail-wm0-x242.google.com with SMTP id p65so3606894wmp.1 for ; Tue, 01 Mar 2016 03:35:49 -0800 (PST) Sender: Paolo Bonzini References: <1456771254-17511-1-git-send-email-armbru@redhat.com> <1456771254-17511-4-git-send-email-armbru@redhat.com> From: Paolo Bonzini Message-ID: <56D57E91.40404@redhat.com> Date: Tue, 1 Mar 2016 12:35:45 +0100 MIME-Version: 1.0 In-Reply-To: <1456771254-17511-4-git-send-email-armbru@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 03/38] event_notifier: Make event_notifier_init_fd() #ifdef CONFIG_EVENTFD List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Cc: mlureau@redhat.com, cam@cs.ualberta.ca, claudio.fontana@huawei.com, david.marchand@6wind.com On 29/02/2016 19:40, Markus Armbruster wrote: > 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 > --- > 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) > { > Reviewed-by: Paolo Bonzini