From: Paolo Bonzini <pbonzini@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Blue Swirl <blauwirbel@gmail.com>, Alexander Graf <agraf@suse.de>,
qemu-devel@nongnu.org, Aurelien Jarno <aurelien@aurel32.net>,
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [PATCHv2] Add compat eventfd header
Date: Thu, 30 Jun 2011 17:58:26 +0200 [thread overview]
Message-ID: <4E0C9D22.1060408@redhat.com> (raw)
In-Reply-To: <20110630155725.GA9765@redhat.com>
On 06/30/2011 05:57 PM, Michael S. Tsirkin wrote:
> Support build on rhel 5.X where we have syscall for eventfd but not
> userspace wrapper.
>
> (cherry-picked from commit 9e3269181e9bc56feb43bcd4e8ce0b82cd543e65
> in qemu-kvm.git).
>
> Signed-off-by: Michael S. Tsirkin<mst@redhat.com>
> ---
>
> Changes from v1:
> checkpatch fix
> address comments by agraf
> verify we are on linux
>
> compat/sys/eventfd.h | 20 ++++++++++++++++++++
> configure | 6 ++++--
> 2 files changed, 24 insertions(+), 2 deletions(-)
> create mode 100644 compat/sys/eventfd.h
>
> diff --git a/compat/sys/eventfd.h b/compat/sys/eventfd.h
> new file mode 100644
> index 0000000..1801a5f
> --- /dev/null
> +++ b/compat/sys/eventfd.h
> @@ -0,0 +1,20 @@
> +#ifndef _COMPAT_SYS_EVENTFD
> +#define _COMPAT_SYS_EVENTFD
> +
> +#ifdef CONFIG_EVENTFD
> +
> +#ifndef __linux__
> +#error __linux__ is not defined: eventfd is only supported on linux
> +#endif
> +
> +#include<unistd.h>
> +#include<syscall.h>
> +
> +static inline int eventfd(int count, int flags)
> +{
> + return syscall(SYS_eventfd, count, flags);
> +}
> +
> +#endif
> +
> +#endif
> diff --git a/configure b/configure
> index 856b41e..6f7dd74 100755
> --- a/configure
> +++ b/configure
> @@ -822,7 +822,6 @@ esac
>
> [ -z "$guest_base" ]&& guest_base="$host_guest_base"
>
> -
> default_target_list=""
>
> # these targets are portable
> @@ -891,6 +890,9 @@ sparc64-bsd-user \
> "
> fi
>
> +#compat headers
> +QEMU_CFLAGS="$QEMU_CFLAGS -idirafter $source_path/compat"
> +
> if test x"$show_help" = x"yes" ; then
> cat<< EOF
>
> @@ -2122,7 +2124,7 @@ int main(void)
> return 0;
> }
> EOF
> -if compile_prog "" "" ; then
> +if compile_prog "-DCONFIG_EVENTFD" "" ; then
> eventfd=yes
> fi
>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo
next prev parent reply other threads:[~2011-06-30 15:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-30 15:57 [Qemu-devel] [PATCHv2] Add compat eventfd header Michael S. Tsirkin
2011-06-30 15:58 ` Paolo Bonzini [this message]
2011-06-30 17:27 ` Peter Maydell
2011-06-30 17:54 ` Michael S. Tsirkin
2011-07-01 20:05 ` Blue Swirl
2011-07-03 8:17 ` Michael S. Tsirkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E0C9D22.1060408@redhat.com \
--to=pbonzini@redhat.com \
--cc=agraf@suse.de \
--cc=aurelien@aurel32.net \
--cc=blauwirbel@gmail.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.