[tip:tools/kvm] kvm tools: Introduce vidmode parmeter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit-ID:  f2dcf878865766fb2675aa851ad1cf96ed0eb447
Gitweb:     http://git.kernel.org/tip/f2dcf878865766fb2675aa851ad1cf96ed0eb447
Author:     Cyrill Gorcunov <gorcunov@xxxxxxxxx>
AuthorDate: Wed, 8 Jun 2011 00:22:18 +0400
Committer:  Pekka Enberg <penberg@xxxxxxxxxx>
CommitDate: Wed, 8 Jun 2011 17:15:25 +0300

kvm tools: Introduce vidmode parmeter

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 <gorcunov@xxxxxxxxx>
Signed-off-by: Pekka Enberg <penberg@xxxxxxxxxx>
---
 tools/kvm/kvm-run.c |   20 ++++++++++++++++----
 1 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/tools/kvm/kvm-run.c b/tools/kvm/kvm-run.c
index b688ef7..201019a 100644
--- a/tools/kvm/kvm-run.c
+++ b/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 [<options>] [<kernel image>]",
@@ -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 **argv, const char *prefix)
 	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 **argv, const char *prefix)
 
 	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));
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux