From patchwork Tue Jun 7 20:22:18 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cyrill Gorcunov X-Patchwork-Id: 859562 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p57KMQCq021870 for ; Tue, 7 Jun 2011 20:22:26 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754335Ab1FGUWX (ORCPT ); Tue, 7 Jun 2011 16:22:23 -0400 Received: from mail-fx0-f46.google.com ([209.85.161.46]:38586 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752316Ab1FGUWW (ORCPT ); Tue, 7 Jun 2011 16:22:22 -0400 Received: by fxm17 with SMTP id 17so64378fxm.19 for ; Tue, 07 Jun 2011 13:22:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=Q11ycTFGoJQdJRXqFZvkqjmc5ycG5PuMZGENOPTqdKg=; b=uB0nIWwm5FZpyS8J2woqW28xgt3Ncs+vPrLYQeDd2DRIwn82fqElTXn0RnEW9l299n G3asCioRWjsEB+1kiHtbdyuilbXMQ8Rrbh4wsHn6V0WZcMtgKNmnXmKWpRxiOFVv7pEc NirO3TIyLeww77MZoM8dJ5J249B0wsqHguHA4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=C7BKMHtVwWDVB921GbrbAns3Fqff0KPG/URbIy2/orpCInKm+mUbh1Uem5OOrE503X hT2+dLX0qe91Yp119PMw9yjiiU3noQ9fWVzUBQ3yENfM3LGsla3foYDbxJOkUvtsGT91 x0VyS7zdi1Sc/B7pf/8/PGsZu+bfOz6fho5SI= Received: by 10.223.54.219 with SMTP id r27mr1446242fag.124.1307478140825; Tue, 07 Jun 2011 13:22:20 -0700 (PDT) Received: from sun.localdomain (95-26-151-198.broadband.corbina.ru [95.26.151.198]) by mx.google.com with ESMTPS id q10sm1910480fan.8.2011.06.07.13.22.19 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 07 Jun 2011 13:22:20 -0700 (PDT) Received: by sun.localdomain (Postfix, from userid 500) id 9FC6160935; Wed, 8 Jun 2011 00:22:18 +0400 (MSD) Date: Wed, 8 Jun 2011 00:22:18 +0400 From: Cyrill Gorcunov To: Pekka Enberg Cc: asias.hejun@gmail.com, mingo@elte.hu, levinsasha928@gmail.com, prasadjoshi124@gmail.com, kvm@vger.kernel.org Subject: Re: [patch 2/5] kvm tools: Introduce vidmode parmeter Message-ID: <20110607202218.GZ1754@sun> References: <20110607194111.025052224@gmail.com> <20110607194153.843315267@gmail.com> <20110607201030.GY1754@sun> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20110607201030.GY1754@sun> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Tue, 07 Jun 2011 20:22:26 +0000 (UTC) On Wed, Jun 08, 2011 at 12:10:30AM +0400, Cyrill Gorcunov wrote: > On Tue, Jun 07, 2011 at 10:53:28PM +0300, Pekka Enberg wrote: > > On Tue, 7 Jun 2011, Cyrill Gorcunov wrote: > > >Usually this might be set by loader but since > > >we're the loader lets allow to specify vesa > > >mode as well. > > > > > >Signed-off-by: Cyrill Gorcunov > > > > This patch causes 'make check' to go crazy and print out bunch of these: > > > > Pekka, are you sure it's because of _this_ particular patch? > > Cyrill This one should do the trick, cant say I like it, we probably need some default values from options parser, ie to extend it. Cyrill --- kvm tools: Introduce vidmode parmeter v2 Usually this might be set by loader but since we're the loader lets allow to specify vesa mode as well. v2: Pekka spotted the default value was being compromised, so revert it back and set only if specified. Signed-off-by: Cyrill Gorcunov --- tools/kvm/kvm-run.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) -- 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: linux-2.6.git/tools/kvm/kvm-run.c =================================================================== --- linux-2.6.git.orig/tools/kvm/kvm-run.c +++ linux-2.6.git/tools/kvm/kvm-run.c @@ -80,6 +80,7 @@ extern int active_console; bool do_debug_print = false; static int nrcpus; +static int vidmode = -1; static const char * const run_usage[] = { "kvm run [] []", @@ -139,6 +140,10 @@ static const struct option options[] = { OPT_STRING('\0', "tapscript", &script, "Script path", "Assign a script to process created tap device"), + OPT_GROUP("BIOS options:"), + OPT_INTEGER('\0', "vidmode", &vidmode, + "Video mode"), + OPT_GROUP("Debug options:"), OPT_BOOLEAN('\0', "debug", &do_debug_print, "Enable debug messages"), @@ -434,7 +439,6 @@ int kvm_cmd_run(int argc, const char **a struct framebuffer *fb = NULL; unsigned int nr_online_cpus; int exit_code = 0; - u16 vidmode = 0; int max_cpus; char *hi; int i; @@ -539,14 +543,22 @@ int kvm_cmd_run(int argc, const char **a kvm->nrcpus = nrcpus; + /* + * vidmode should be either specified + * either set by default + */ + if (vnc || sdl) { + if (vidmode == -1) + vidmode = 0x312; + } else + vidmode = 0; + memset(real_cmdline, 0, sizeof(real_cmdline)); strcpy(real_cmdline, "notsc noapic noacpi pci=conf1"); if (vnc || sdl) { strcat(real_cmdline, " video=vesafb console=tty0"); - vidmode = 0x312; - } else { + } else strcat(real_cmdline, " console=ttyS0 earlyprintk=serial"); - } strcat(real_cmdline, " "); if (kernel_cmdline) strlcat(real_cmdline, kernel_cmdline, sizeof(real_cmdline));