From: =?ISO-8859-1?Q?Andreas_F=E4rber?= Subject: Re: [Qemu-devel] [PATCH] kvm: Set default accelerator to "kvm" if the host supports it Date: Mon, 01 Oct 2012 18:43:00 +0200 Message-ID: <5069C814.7010201@suse.de> References: <20120930191146.GA20012@amt.cnet> <50694EC1.8060006@siemens.com> <20121001093102.GA14797@amt.cnet> <50696E9E.7030302@siemens.com> <87zk468h3y.fsf@codemonkey.ws> <50699CDC.1010604@redhat.com> <87wqzap9ui.fsf@codemonkey.ws> <5069A9DF.4040606@siemens.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Anthony Liguori , kvm , Scott Moser , Marcelo Tosatti , Michael Tokarev , qemu-devel , Avi Kivity , Cole Robinson , Paolo Bonzini , Bruce Rogers To: Jan Kiszka Return-path: Received: from cantor2.suse.de ([195.135.220.15]:44001 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753622Ab2JAQnG (ORCPT ); Mon, 1 Oct 2012 12:43:06 -0400 In-Reply-To: <5069A9DF.4040606@siemens.com> Sender: kvm-owner@vger.kernel.org List-ID: Hello Jan, Am 01.10.2012 16:34, schrieb Jan Kiszka: > If we built a target for a host that supports KVM in principle, set t= he > default accelerator to KVM as well. This also means the start of QEMU > will fail to start if KVM support turns out to be unavailable at > runtime. =46rom a distro point of view this of course means that we will build against KVM and that the new KVM default will start to fail for users o= n very old hardware. Can't we do a runtime check to select the default? Would be nice to at least amend the commit message with how they are expected to remedy that via command line. -machine accel=3Dtcg? Regards, Andreas >=20 > Signed-off-by: Jan Kiszka > --- > kvm-all.c | 1 + > kvm-stub.c | 1 + > kvm.h | 1 + > vl.c | 4 ++-- > 4 files changed, 5 insertions(+), 2 deletions(-) >=20 > diff --git a/kvm-all.c b/kvm-all.c > index 92a7137..4d5f86c 100644 > --- a/kvm-all.c > +++ b/kvm-all.c > @@ -103,6 +103,7 @@ struct KVMState > #endif > }; > =20 > +bool kvm_configured =3D true; > KVMState *kvm_state; > bool kvm_kernel_irqchip; > bool kvm_async_interrupts_allowed; > diff --git a/kvm-stub.c b/kvm-stub.c > index 3c52eb5..86a6451 100644 > --- a/kvm-stub.c > +++ b/kvm-stub.c > @@ -17,6 +17,7 @@ > #include "gdbstub.h" > #include "kvm.h" > =20 > +bool kvm_configured; > KVMState *kvm_state; > bool kvm_kernel_irqchip; > bool kvm_async_interrupts_allowed; > diff --git a/kvm.h b/kvm.h > index dea2998..9936e5f 100644 > --- a/kvm.h > +++ b/kvm.h > @@ -22,6 +22,7 @@ > #include > #endif > =20 > +extern bool kvm_configured; > extern int kvm_allowed; > extern bool kvm_kernel_irqchip; > extern bool kvm_async_interrupts_allowed; > diff --git a/vl.c b/vl.c > index 8d305ca..f557bd1 100644 > --- a/vl.c > +++ b/vl.c > @@ -2215,8 +2215,8 @@ static int configure_accelerator(void) > } > =20 > if (p =3D=3D NULL) { > - /* Use the default "accelerator", tcg */ > - p =3D "tcg"; > + /* The default accelerator depends on the availability of KV= M. */ > + p =3D kvm_configured ? "kvm" : "tcg"; > } > =20 > while (!accel_initialised && *p !=3D '\0') { >=20 --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrn= berg