diff mbox

migration/postcopy-ram: Guard use of sys/eventfd.h with CONFIG_EVENTFD

Message ID 6D39441BF12EF246A7ABCE6654B023536BB85DEB@hhmail02.hh.imgtec.org (mailing list archive)
State New, archived
Headers show

Commit Message

Matthew Fortune Feb. 23, 2016, 4:09 p.m. UTC
sys/eventfd.h was being guarded only by a check for linux but does
not exist on older distributions like CentOS 5. Move the include
into the code that uses it and add an appropriate guard.

Signed-off-by: Matthew Fortune <matthew.fortune@imgtec.com>
---
 migration/postcopy-ram.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Juan Quintela Feb. 24, 2016, 11:41 a.m. UTC | #1
Matthew Fortune <Matthew.Fortune@imgtec.com> wrote:
> sys/eventfd.h was being guarded only by a check for linux but does
> not exist on older distributions like CentOS 5. Move the include
> into the code that uses it and add an appropriate guard.
>
> Signed-off-by: Matthew Fortune <matthew.fortune@imgtec.com>
> ---
>  migration/postcopy-ram.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>

Reviewed-by: Juan Quintela <quintela@redhat.com>

Thanks.

> diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c
> index 254c629..fbd0064 100644
> --- a/migration/postcopy-ram.c
> +++ b/migration/postcopy-ram.c
> @@ -52,14 +52,14 @@ struct PostcopyDiscardState {
>  #if defined(__linux__)
>  
>  #include <poll.h>
> -#include <sys/eventfd.h>
>  #include <sys/mman.h>
>  #include <sys/ioctl.h>
>  #include <sys/syscall.h>
>  #include <asm/types.h> /* for __u64 */
>  #endif
>  
> -#if defined(__linux__) && defined(__NR_userfaultfd)
> +#if defined(__linux__) && defined(__NR_userfaultfd) && defined(CONFIG_EVENTFD)
> +#include <sys/eventfd.h>
>  #include <linux/userfaultfd.h>
>  
>  static bool ufd_version_check(int ufd)
diff mbox

Patch

diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c
index 254c629..fbd0064 100644
--- a/migration/postcopy-ram.c
+++ b/migration/postcopy-ram.c
@@ -52,14 +52,14 @@  struct PostcopyDiscardState {
 #if defined(__linux__)
 
 #include <poll.h>
-#include <sys/eventfd.h>
 #include <sys/mman.h>
 #include <sys/ioctl.h>
 #include <sys/syscall.h>
 #include <asm/types.h> /* for __u64 */
 #endif
 
-#if defined(__linux__) && defined(__NR_userfaultfd)
+#if defined(__linux__) && defined(__NR_userfaultfd) && defined(CONFIG_EVENTFD)
+#include <sys/eventfd.h>
 #include <linux/userfaultfd.h>
 
 static bool ufd_version_check(int ufd)