From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [PATCH] Abort if gcc4 was used to compile qemu and kvm is not enabled Date: Mon, 08 Oct 2007 10:53:52 -0500 Message-ID: <470A5290.4040504@codemonkey.ws> References: <20071008154402.GB2137@tapir> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Carlo Marcelo Arenas Belon Return-path: In-Reply-To: <20071008154402.GB2137@tapir> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org Carlo Marcelo Arenas Belon wrote: > 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 a pretty bad thing IMHO. There are other patches out there that allow QEMU (even with -no-kvm) to work with GCC4. A random check like this is going to result in difficulties down the road. Maybe a release of GCC4 will allow QEMU to work in the future. A check like this is just way too general IMHO. If you're going to do anything, a firm warning when compiling with a GCC4 override would be the best thing. Regards, Anthony Liguori > 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 > --- > 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 > ------------------------------------------------------------------------- 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/