From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cyrill Gorcunov Subject: [patch 2/5] kvm tools: Introduce vidmode parmeter Date: Tue, 07 Jun 2011 23:41:13 +0400 Message-ID: <20110607194153.843315267@gmail.com> References: <20110607194111.025052224@gmail.com> Cc: asias.hejun@gmail.com, mingo@elte.hu, levinsasha928@gmail.com, prasadjoshi124@gmail.com, kvm@vger.kernel.org, Cyrill Gorcunov To: penberg@kernel.org Return-path: Received: from mail-bw0-f46.google.com ([209.85.214.46]:36800 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758448Ab1FGTl7 (ORCPT ); Tue, 7 Jun 2011 15:41:59 -0400 Received: by bwz15 with SMTP id 15so50521bwz.19 for ; Tue, 07 Jun 2011 12:41:58 -0700 (PDT) Content-Disposition: inline; filename=kvm-tools-vidmode Sender: kvm-owner@vger.kernel.org List-ID: 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 --- tools/kvm/kvm-run.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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 = 0x312; 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; @@ -541,12 +545,10 @@ int kvm_cmd_run(int argc, const char **a memset(real_cmdline, 0, sizeof(real_cmdline)); strcpy(real_cmdline, "notsc noapic noacpi pci=conf1"); - if (vnc || sdl) { + 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));