public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Carlo Marcelo Arenas Belon <carenas-kLeDWSohozoJb6fo7hG9ng@public.gmane.org>
To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: [PATCH] Abort if gcc4 was used to compile qemu and kvm is not enabled
Date: Mon, 8 Oct 2007 10:44:02 -0500	[thread overview]
Message-ID: <20071008154402.GB2137@tapir> (raw)

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/

             reply	other threads:[~2007-10-08 15:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-08 15:44 Carlo Marcelo Arenas Belon [this message]
2007-10-08 15:53 ` [PATCH] Abort if gcc4 was used to compile qemu and kvm is not enabled 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

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=20071008154402.GB2137@tapir \
    --to=carenas-kledwsohozojb6fo7hg9ng@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.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