From patchwork Tue Jul 28 22:12:21 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 37913 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n6SMCQPm025382 for ; Tue, 28 Jul 2009 22:12:26 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755027AbZG1WMY (ORCPT ); Tue, 28 Jul 2009 18:12:24 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753870AbZG1WMX (ORCPT ); Tue, 28 Jul 2009 18:12:23 -0400 Received: from cantor.suse.de ([195.135.220.2]:45771 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752726AbZG1WMX (ORCPT ); Tue, 28 Jul 2009 18:12:23 -0400 Received: from relay1.suse.de (relay-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id 28B235362F; Wed, 29 Jul 2009 00:12:23 +0200 (CEST) Cc: "kvm@vger.kernel.org" , "avi@redhat.com" Message-Id: From: Alexander Graf To: Glauber Costa In-Reply-To: <20090728212852.GY4776@poweredge.glommer> Mime-Version: 1.0 (Apple Message framework v935.3) Subject: Re: [PATCH] exit if we fail to initialize kvm Date: Wed, 29 Jul 2009 00:12:21 +0200 References: <1248814374-7953-1-git-send-email-glommer@redhat.com> <20090728212852.GY4776@poweredge.glommer> X-Mailer: Apple Mail (2.935.3) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On 28.07.2009, at 23:28, Glauber Costa wrote: > On Tue, Jul 28, 2009 at 11:15:19PM +0200, Alexander Graf wrote: >> >> On 28.07.2009, at 22:52, Glauber Costa wrote: >> >>> Falling back to tcg has proven to be evil through time. The option >>> is >>> to >>> do not try to act behind user's back, and quit the program >>> completely >>> if >>> we fail to initialize kvm. Right now, the only way to run tcg from >>> our >>> tree >>> becomes explicitly asking for it, with the -no-kvm option. >> >> Well, actually there's one little difference: I tell the user to >> use - >> no-kvm if he really wants cpu emulation. >> >> But simply failing is probably good enough. > With my patch, we won't fail if the user asked -no-kvm, because then > we won't > even try to initialize kvm. > > We only exit here, if we try, but fail This is the patch as I had it in kvm-86. It's really only about being helpful to the user. fprintf(stderr, "Compiled with --disable-cpu-emulation, exiting. \n"); exit(1); Alex --- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: kvm-86/vl.c =================================================================== --- kvm-86.orig/vl.c +++ kvm-86/vl.c @@ -5836,7 +5836,8 @@ int main(int argc, char **argv, char **e #ifdef USE_KVM if (kvm_enabled()) { if (kvm_qemu_init() < 0) { - fprintf(stderr, "Could not initialize KVM, will disable KVM support\n"); + fprintf(stderr, "Could not initialize KVM. Do you have kvm-amd or kvm-intel modprobe'd?\nIf you want to use CPU emulation, start with -no-kvm.\n"); + exit(1); #ifdef NO_CPU_EMULATION