From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KtMpL-0003OD-93 for qemu-devel@nongnu.org; Fri, 24 Oct 2008 09:35:43 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KtMpJ-0003Kp-AH for qemu-devel@nongnu.org; Fri, 24 Oct 2008 09:35:42 -0400 Received: from [199.232.76.173] (port=54155 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KtMpJ-0003KZ-3c for qemu-devel@nongnu.org; Fri, 24 Oct 2008 09:35:41 -0400 Received: from mx2.redhat.com ([66.187.237.31]:45533) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KtMpI-0004wd-SX for qemu-devel@nongnu.org; Fri, 24 Oct 2008 09:35:41 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id m9ODZe7g012779 for ; Fri, 24 Oct 2008 09:35:40 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m9ODZdD2004815 for ; Fri, 24 Oct 2008 09:35:39 -0400 Received: from localhost (vpn-6-13.fab.redhat.com [10.33.6.13]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id m9ODZcSP020420 for ; Fri, 24 Oct 2008 09:35:38 -0400 Date: Fri, 24 Oct 2008 14:35:36 +0100 From: "Richard W.M. Jones" Message-ID: <20081024133536.GA12450@amd.home.annexia.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="VbJkn9YxBvnuCH5J" Content-Disposition: inline Subject: [Qemu-devel] [PATCH] Fix compilation on MinGW Windows cross-compiler Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --VbJkn9YxBvnuCH5J Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Inspired by some comments by Anthony Liguori yesterday, I got qemu to compile using the Fedora MinGW cross-compiler[1]. There are some problems introduced by what I think is new code (the migration code), so I just hacked those bits out. Not a good fix, but the patch is attached anyhow. After installing the MinGW packages in Fedora[2], the command to compile qemu is: PATH=/usr/i686-pc-mingw32/sys-root/mingw/bin:$PATH \ PKG_CONFIG_PATH=/usr/i686-pc-mingw32/sys-root/mingw/lib/pkgconfig \ ./configure \ --cross-prefix=i686-pc-mingw32- \ --host-cc=i686-pc-mingw32-gcc \ --cpu=i386 \ --disable-gcc-check \ --audio-drv-list= make This produces Windows binaries (eg. qemu-system-x86_64.exe) which work to some extent under Wine. In fact I was able to boot a 64 bit Fedora 9 guest up to the point where it runs initrd, at which point qemu crashes somewhere. I didn't test the binaries on real Windows. Rich. [1] http://fedoraproject.org/wiki/MinGW [2] http://www.annexia.org/tmp/mingw/fedora-9/ -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://et.redhat.com/~rjones/virt-top --VbJkn9YxBvnuCH5J Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="qemu-mingw32-get-it-working.patch" Index: migration.c =================================================================== --- migration.c (revision 5521) +++ migration.c (working copy) @@ -15,6 +15,8 @@ #include "migration.h" #include "console.h" +#if !defined(WIN32) + /* Migration speed throttling */ static uint32_t max_throttle = (32 << 20); @@ -101,3 +103,4 @@ } } +#endif /* !WIN32 */ Index: vl.c =================================================================== --- vl.c (revision 5521) +++ vl.c (working copy) @@ -6213,6 +6213,7 @@ return 18; /* len */ } +#if !defined(WIN32) void qemu_announce_self(void) { int i, j, len; @@ -6230,6 +6231,7 @@ } } } +#endif /***********************************************************/ /* savevm/loadvm support */ @@ -9744,10 +9746,12 @@ if (loadvm) do_loadvm(loadvm); +#if !defined(WIN32) if (incoming) { autostart = 0; /* fixme how to deal with -daemonize */ qemu_start_incoming_migration(incoming); } +#endif { /* XXX: simplify init */ Index: monitor.c =================================================================== --- monitor.c (revision 5521) +++ monitor.c (working copy) @@ -1455,12 +1455,14 @@ { "nmi", "i", do_inject_nmi, "cpu", "inject an NMI on the given CPU", }, #endif +#if !defined(WIN32) { "migrate", "-ds", do_migrate, "[-d] uri", "migrate to URI (using -d to not wait for completion)" }, { "migrate_cancel", "", do_migrate_cancel, "", "cancel the current VM migration" }, { "migrate_set_speed", "s", do_migrate_set_speed, "value", "set maximum speed (in bytes) for migrations" }, +#endif { NULL, NULL, }, }; @@ -1523,7 +1525,9 @@ { "slirp", "", do_info_slirp, "", "show SLIRP statistics", }, #endif +#if !defined(WIN32) { "migrate", "", do_info_migrate, "", "show migration status" }, +#endif { NULL, NULL, }, }; Index: migration-tcp.c =================================================================== --- migration-tcp.c (revision 5521) +++ migration-tcp.c (working copy) @@ -20,6 +20,8 @@ #include "buffered_file.h" #include "block.h" +#if !defined(WIN32) + //#define DEBUG_MIGRATION_TCP typedef struct FdMigrationState @@ -369,3 +371,5 @@ close(s); return -errno; } + +#endif /* !WIN32 */ --VbJkn9YxBvnuCH5J--