public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Abort if gcc4 was used to compile qemu and kvm is not enabled
@ 2007-10-08 15:44 Carlo Marcelo Arenas Belon
  2007-10-08 15:53 ` Anthony Liguori
  0 siblings, 1 reply; 7+ messages in thread
From: Carlo Marcelo Arenas Belon @ 2007-10-08 15:44 UTC (permalink / raw)
  To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Using gcc4 to compile qemu will generate broken code for its cpu emulation
but should be fine if using kvm only.

This will allow users that have no access to gcc4 on their platforms to at
least get kvm compiled and use it while preventing them to run a broken
qemu if kvm is not available.

This is not meant to be used in the long run when a solution to qemu's use
of gcc-3.x for code generation is finally resolved upstream, which is why
it is kept inside the KVM specific sections of the code only.

Signed-off-by: Carlo Marcelo Arenas Belon <carenas-kLeDWSohozoJb6fo7hG9ng@public.gmane.org>
---
 qemu/vl.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/qemu/vl.c b/qemu/vl.c
index 634fb34..549f008 100644
--- a/qemu/vl.c
+++ b/qemu/vl.c
@@ -8425,8 +8425,13 @@ int main(int argc, char **argv)
 #endif
 #ifdef USE_KVM
 	    case QEMU_OPTION_no_kvm:
+#if __GNUC__ >= 4
+		fprintf(stderr, "Can't run without kvm if compiled with gcc4\n");
+		exit(1);
+#else
 		kvm_allowed = 0;
 		break;
+#endif
 	    case QEMU_OPTION_no_kvm_irqchip:
 		kvm_irqchip = 0;
 		break;
@@ -8559,8 +8564,13 @@ int main(int argc, char **argv)
 #if USE_KVM
     if (kvm_allowed) {
 	if (kvm_qemu_init() < 0) {
+#if __GNUC__ >= 4
+	    fprintf(stderr, "Could not initialize KVM, can't run without kvm if compiled with gcc4\n");
+	    exit(1);
+#else
 	    fprintf(stderr, "Could not initialize KVM, will disable KVM support\n");
 	    kvm_allowed = 0;
+#endif
 	}
     }
 #endif
-- 
1.5.2.5


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-10-09 14:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-08 15:44 [PATCH] Abort if gcc4 was used to compile qemu and kvm is not enabled Carlo Marcelo Arenas Belon
2007-10-08 15:53 ` Anthony Liguori
     [not found]   ` <470A5290.4040504-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org>
2007-10-08 18:45     ` Byron Stanoszek
     [not found]       ` <Pine.LNX.4.64.0710081411160.27239-4mf1WHGLwUrYtjvyW6yDsg@public.gmane.org>
2007-10-08 19:29         ` Anthony Liguori
     [not found]           ` <470A851C.3050602-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org>
2007-10-09  6:46             ` Carlo Marcelo Arenas Belon
2007-10-09 14:53               ` Anthony Liguori
2007-10-09 13:28         ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox