qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] configure: check for EFD_NONBLOCK | EFD_CLOEXEC flags
@ 2011-11-21  0:54 Max Filippov
  2011-11-21 10:29 ` Stefan Hajnoczi
  2011-11-22  0:22 ` Anthony Liguori
  0 siblings, 2 replies; 3+ messages in thread
From: Max Filippov @ 2011-11-21  0:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: Max Filippov

Add check for the EFD_NONBLOCK and EFD_CLOEXEC flags to the
CONFIG_EVENTFD test.
This fixes the following build failure on Fedora 9:

      CC    event_notifier.o
    event_notifier.c: In function `event_notifier_init':
    event_notifier.c:21: error: `EFD_NONBLOCK' undeclared (first use in this function)
    event_notifier.c:21: error: (Each undeclared identifier is reported only once
    event_notifier.c:21: error: for each function it appears in.)
    event_notifier.c:21: error: `EFD_CLOEXEC' undeclared (first use in this function)
    make: *** [event_notifier.o] Error 1

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
 configure |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/configure b/configure
index 6c77fbb..580cd4d 100755
--- a/configure
+++ b/configure
@@ -2200,7 +2200,7 @@ cat > $TMPC << EOF
 
 int main(void)
 {
-    int efd = eventfd(0, 0);
+    int efd = eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC);
     return 0;
 }
 EOF
-- 
1.7.6.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] configure: check for EFD_NONBLOCK | EFD_CLOEXEC flags
  2011-11-21  0:54 [Qemu-devel] [PATCH] configure: check for EFD_NONBLOCK | EFD_CLOEXEC flags Max Filippov
@ 2011-11-21 10:29 ` Stefan Hajnoczi
  2011-11-22  0:22 ` Anthony Liguori
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2011-11-21 10:29 UTC (permalink / raw)
  To: Max Filippov; +Cc: qemu-devel

On Mon, Nov 21, 2011 at 12:54 AM, Max Filippov <jcmvbkbc@gmail.com> wrote:
> Add check for the EFD_NONBLOCK and EFD_CLOEXEC flags to the
> CONFIG_EVENTFD test.
> This fixes the following build failure on Fedora 9:
>
>      CC    event_notifier.o
>    event_notifier.c: In function `event_notifier_init':
>    event_notifier.c:21: error: `EFD_NONBLOCK' undeclared (first use in this function)
>    event_notifier.c:21: error: (Each undeclared identifier is reported only once
>    event_notifier.c:21: error: for each function it appears in.)
>    event_notifier.c:21: error: `EFD_CLOEXEC' undeclared (first use in this function)
>    make: *** [event_notifier.o] Error 1
>
> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
> ---
>  configure |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>

At first this patch seemed suspicious because is undefines
CONFIG_EVENTFD on hosts that previously had it defined.  A graceful
fallback that sets nonblocking and close-on-exec using fcntl(2) is
possible, so we don't *need* to be as aggressive as this patch.

However, I chased up the dependencies and it doesn't seem worth doing.
 CONFIG_EVENTFD is a dependency for vhost-net, aio=native, and has
fallbacks elsewhere in QEMU.  Given that vhost-net was merged in
2.6.34 and the eventfd open flags were introduced in 2.6.27, I think
the only feature we actually risk losing here is Linux AIO
(aio=native).

2.6.27-based kernels are old so I'm happy with this change.

Stefan

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] configure: check for EFD_NONBLOCK | EFD_CLOEXEC flags
  2011-11-21  0:54 [Qemu-devel] [PATCH] configure: check for EFD_NONBLOCK | EFD_CLOEXEC flags Max Filippov
  2011-11-21 10:29 ` Stefan Hajnoczi
@ 2011-11-22  0:22 ` Anthony Liguori
  1 sibling, 0 replies; 3+ messages in thread
From: Anthony Liguori @ 2011-11-22  0:22 UTC (permalink / raw)
  To: Max Filippov; +Cc: qemu-devel

On 11/20/2011 06:54 PM, Max Filippov wrote:
> Add check for the EFD_NONBLOCK and EFD_CLOEXEC flags to the
> CONFIG_EVENTFD test.
> This fixes the following build failure on Fedora 9:
>
>        CC    event_notifier.o
>      event_notifier.c: In function `event_notifier_init':
>      event_notifier.c:21: error: `EFD_NONBLOCK' undeclared (first use in this function)
>      event_notifier.c:21: error: (Each undeclared identifier is reported only once
>      event_notifier.c:21: error: for each function it appears in.)
>      event_notifier.c:21: error: `EFD_CLOEXEC' undeclared (first use in this function)
>      make: *** [event_notifier.o] Error 1
>
> Signed-off-by: Max Filippov<jcmvbkbc@gmail.com>

Applied.  Thanks.

Regards,

Anthony Liguori

> ---
>   configure |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/configure b/configure
> index 6c77fbb..580cd4d 100755
> --- a/configure
> +++ b/configure
> @@ -2200,7 +2200,7 @@ cat>  $TMPC<<  EOF
>
>   int main(void)
>   {
> -    int efd = eventfd(0, 0);
> +    int efd = eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC);
>       return 0;
>   }
>   EOF

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-11-22  0:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-21  0:54 [Qemu-devel] [PATCH] configure: check for EFD_NONBLOCK | EFD_CLOEXEC flags Max Filippov
2011-11-21 10:29 ` Stefan Hajnoczi
2011-11-22  0:22 ` Anthony Liguori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).