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 <[EMAIL PROTECTED]>
---
 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/
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to