From patchwork Tue Feb 23 16:09:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Fortune X-Patchwork-Id: 8394091 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id F2CF3C0553 for ; Tue, 23 Feb 2016 16:10:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 50648202EC for ; Tue, 23 Feb 2016 16:10:44 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 144B0202F8 for ; Tue, 23 Feb 2016 16:10:43 +0000 (UTC) Received: from localhost ([::1]:58144 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYFXu-00046n-BM for patchwork-qemu-devel@patchwork.kernel.org; Tue, 23 Feb 2016 11:10:42 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33289) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYFWc-00028c-0Z for qemu-devel@nongnu.org; Tue, 23 Feb 2016 11:09:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aYFWX-00040M-Ms for qemu-devel@nongnu.org; Tue, 23 Feb 2016 11:09:21 -0500 Received: from mailapp01.imgtec.com ([195.59.15.196]:55220) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYFWX-00040F-Gt for qemu-devel@nongnu.org; Tue, 23 Feb 2016 11:09:17 -0500 Received: from HHMAIL01.hh.imgtec.org (unknown [10.100.10.19]) by Websense Email Security Gateway with ESMTPS id A479AF18E5D56; Tue, 23 Feb 2016 16:09:13 +0000 (GMT) Received: from hhmail02.hh.imgtec.org ([fe80::5400:d33e:81a4:f775]) by HHMAIL01.hh.imgtec.org ([fe80::710b:f219:72bc:e0b3%26]) with mapi id 14.03.0266.001; Tue, 23 Feb 2016 16:09:16 +0000 From: Matthew Fortune To: "qemu-devel@nongnu.org" Thread-Topic: [PATCH] migration/postcopy-ram: Guard use of sys/eventfd.h with CONFIG_EVENTFD Thread-Index: AdFuUTfPvh6qSGsrQAKFzTqr+kpOHg== Date: Tue, 23 Feb 2016 16:09:15 +0000 Message-ID: <6D39441BF12EF246A7ABCE6654B023536BB85DEB@hhmail02.hh.imgtec.org> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [192.168.152.105] MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 195.59.15.196 Cc: Amit Shah , Juan Quintela Subject: [Qemu-devel] [PATCH] migration/postcopy-ram: Guard use of sys/eventfd.h with CONFIG_EVENTFD X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Juan Quintela --- migration/postcopy-ram.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -#include #include #include #include #include /* for __u64 */ #endif -#if defined(__linux__) && defined(__NR_userfaultfd) +#if defined(__linux__) && defined(__NR_userfaultfd) && defined(CONFIG_EVENTFD) +#include #include static bool ufd_version_check(int ufd)