From patchwork Sat Jan 5 08:33:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefan Weil X-Patchwork-Id: 209653 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 8B3332C007E for ; Sat, 5 Jan 2013 19:34:04 +1100 (EST) Received: from localhost ([::1]:55273 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TrPCc-0002fZ-As for incoming@patchwork.ozlabs.org; Sat, 05 Jan 2013 03:34:02 -0500 Received: from eggs.gnu.org ([208.118.235.92]:33858) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TrPCR-0002dX-HG for qemu-devel@nongnu.org; Sat, 05 Jan 2013 03:33:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TrPCN-0003nt-8P for qemu-devel@nongnu.org; Sat, 05 Jan 2013 03:33:51 -0500 Received: from v220110690675601.yourvserver.net ([78.47.199.172]:40694) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TrPCN-0003nb-2F for qemu-devel@nongnu.org; Sat, 05 Jan 2013 03:33:47 -0500 Received: from localhost (v220110690675601.yourvserver.net.local [127.0.0.1]) by v220110690675601.yourvserver.net (Postfix) with ESMTP id 32CAA728003D; Sat, 5 Jan 2013 09:33:45 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at weilnetz.de Received: from v220110690675601.yourvserver.net ([127.0.0.1]) by localhost (v220110690675601.yourvserver.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dE6++sZ-iv6n; Sat, 5 Jan 2013 09:33:44 +0100 (CET) Received: by v220110690675601.yourvserver.net (Postfix, from userid 1000) id A35E3728004D; Sat, 5 Jan 2013 09:33:44 +0100 (CET) From: Stefan Weil To: Anthony Liguori Date: Sat, 5 Jan 2013 09:33:43 +0100 Message-Id: <1357374823-25173-1-git-send-email-sw@weilnetz.de> X-Mailer: git-send-email 1.7.10.4 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 78.47.199.172 Cc: Lucas Meneghel Rodrigues , Stefan Weil , Marcelo Tosatti , qemu-devel@nongnu.org, Alexander Graf , Gerd Hoffmann Subject: [Qemu-devel] [PATCH v2] hw/i386: Fix broken build for non POSIX hosts 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org pc-testdev.c cannot be compiled with MinGW (and other non POSIX hosts): CC i386-softmmu/hw/i386/../pc-testdev.o qemu/hw/i386/../pc-testdev.c:38:22: warning: sys/mman.h: file not found qemu/hw/i386/../pc-testdev.c: In function ‘test_flush_page’: qemu/hw/i386/../pc-testdev.c:103: warning: implicit declaration of function ‘mprotect’ ... Signed-off-by: Stefan Weil --- v2 This patch replaces my previous patch hw/i386: Fix broken build for MinGW Instead of disabling pc-testdev.o for non KVM hosts, this version only excludes the mprotect code for non POSIX hosts. Alex Graf suggested a similar solution. - Stefan hw/pc-testdev.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/pc-testdev.c b/hw/pc-testdev.c index 620c86c..1928489 100644 --- a/hw/pc-testdev.c +++ b/hw/pc-testdev.c @@ -35,7 +35,10 @@ * git://git.kernel.org/pub/scm/virt/kvm/kvm-unit-tests.git */ +#include "config-host.h" +#if defined(CONFIG_POSIX) #include +#endif #include "hw.h" #include "qdev.h" #include "isa.h" @@ -100,8 +103,10 @@ static void test_flush_page(void *opaque, hwaddr addr, uint64_t data, /* We might not be able to get the full page, only mprotect what we actually have mapped */ +#if defined(CONFIG_POSIX) mprotect(a, page, PROT_NONE); mprotect(a, page, PROT_READ|PROT_WRITE); +#endif cpu_physical_memory_unmap(a, page, 0, 0); }