From: "Richard W.M. Jones" <rjones@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] Fix compilation on MinGW Windows cross-compiler
Date: Fri, 24 Oct 2008 14:35:36 +0100 [thread overview]
Message-ID: <20081024133536.GA12450@amd.home.annexia.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 1279 bytes --]
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
[-- Attachment #2: qemu-mingw32-get-it-working.patch --]
[-- Type: text/plain, Size: 2338 bytes --]
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 */
next reply other threads:[~2008-10-24 13:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-24 13:35 Richard W.M. Jones [this message]
2008-10-24 13:58 ` [Qemu-devel] [PATCH] Fix compilation on MinGW Windows cross-compiler Anthony Liguori
2008-10-24 14:05 ` Anthony Liguori
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=20081024133536.GA12450@amd.home.annexia.org \
--to=rjones@redhat.com \
--cc=qemu-devel@nongnu.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).