public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <levinsasha928@gmail.com>
To: penberg@kernel.org
Cc: john@jfloren.net, kvm@vger.kernel.org, mingo@elte.hu,
	asias.hejun@gmail.com, gorcunov@gmail.com,
	prasadjoshi124@gmail.com, Sasha Levin <levinsasha928@gmail.com>
Subject: [PATCH 2/5 V2] kvm tools: Add video mode to kernel initialization
Date: Mon, 23 May 2011 14:19:10 +0300	[thread overview]
Message-ID: <1306149553-26793-2-git-send-email-levinsasha928@gmail.com> (raw)
In-Reply-To: <1306149553-26793-1-git-send-email-levinsasha928@gmail.com>

Allow setting video mode in guest kernel.

For possible values see Documentation/fb/vesafb.txt

Signed-off-by: John Floren <john@jfloren.net>
[ turning code into patches and cleanup ]
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
---
 tools/kvm/include/kvm/kvm.h |    2 +-
 tools/kvm/kvm.c             |    7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/tools/kvm/include/kvm/kvm.h b/tools/kvm/include/kvm/kvm.h
index 08c6fda..f951f2d 100644
--- a/tools/kvm/include/kvm/kvm.h
+++ b/tools/kvm/include/kvm/kvm.h
@@ -41,7 +41,7 @@ int kvm__max_cpus(struct kvm *kvm);
 void kvm__init_ram(struct kvm *kvm);
 void kvm__delete(struct kvm *kvm);
 bool kvm__load_kernel(struct kvm *kvm, const char *kernel_filename,
-			const char *initrd_filename, const char *kernel_cmdline);
+			const char *initrd_filename, const char *kernel_cmdline, u16 vidmode);
 void kvm__setup_bios(struct kvm *kvm);
 void kvm__start_timer(struct kvm *kvm);
 void kvm__stop_timer(struct kvm *kvm);
diff --git a/tools/kvm/kvm.c b/tools/kvm/kvm.c
index 4393a41..7284211 100644
--- a/tools/kvm/kvm.c
+++ b/tools/kvm/kvm.c
@@ -320,7 +320,7 @@ static int load_flat_binary(struct kvm *kvm, int fd)
 static const char *BZIMAGE_MAGIC	= "HdrS";
 
 static bool load_bzimage(struct kvm *kvm, int fd_kernel,
-			int fd_initrd, const char *kernel_cmdline)
+			int fd_initrd, const char *kernel_cmdline, u16 vidmode)
 {
 	struct boot_params *kern_boot;
 	unsigned long setup_sects;
@@ -383,6 +383,7 @@ static bool load_bzimage(struct kvm *kvm, int fd_kernel,
 	kern_boot->hdr.type_of_loader	= 0xff;
 	kern_boot->hdr.heap_end_ptr	= 0xfe00;
 	kern_boot->hdr.loadflags	|= CAN_USE_HEAP;
+	kern_boot->hdr.vid_mode		= vidmode;
 
 	/*
 	 * Read initrd image into guest memory
@@ -441,7 +442,7 @@ static bool initrd_check(int fd)
 }
 
 bool kvm__load_kernel(struct kvm *kvm, const char *kernel_filename,
-		const char *initrd_filename, const char *kernel_cmdline)
+		const char *initrd_filename, const char *kernel_cmdline, u16 vidmode)
 {
 	bool ret;
 	int fd_kernel = -1, fd_initrd = -1;
@@ -459,7 +460,7 @@ bool kvm__load_kernel(struct kvm *kvm, const char *kernel_filename,
 			die("%s is not an initrd", initrd_filename);
 	}
 
-	ret = load_bzimage(kvm, fd_kernel, fd_initrd, kernel_cmdline);
+	ret = load_bzimage(kvm, fd_kernel, fd_initrd, kernel_cmdline, vidmode);
 
 	if (initrd_filename)
 		close(fd_initrd);
-- 
1.7.5.rc3


  reply	other threads:[~2011-05-23 11:19 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-23 11:19 [PATCH 1/5 V2] kvm tools: Add BIOS INT10 handler Sasha Levin
2011-05-23 11:19 ` Sasha Levin [this message]
2011-05-23 11:30   ` [PATCH 2/5 V2] kvm tools: Add video mode to kernel initialization Ingo Molnar
2011-05-23 11:19 ` [PATCH 3/5 V2] kvm tools: Add VESA device Sasha Levin
2011-05-23 11:32   ` Ingo Molnar
2011-05-23 11:19 ` [PATCH 4/5 V2] kvm tools: Update makefile and feature tests Sasha Levin
2011-05-23 11:19 ` [PATCH 5/5 V2] kvm tools: Initialize and use VESA and VNC Sasha Levin
2011-05-23 11:38   ` Ingo Molnar
2011-05-23 11:45     ` Pekka Enberg
2011-05-24  8:37     ` Paolo Bonzini
2011-05-24  8:50       ` Ingo Molnar
2011-05-24  9:10         ` Paolo Bonzini
2011-05-24  9:55           ` Pekka Enberg
2011-05-24 11:22             ` Avi Kivity
2011-05-24 11:26               ` Pekka Enberg
2011-05-24 11:30                 ` Sasha Levin
2011-05-24 11:30                 ` Avi Kivity
2011-05-24 11:38                   ` Pekka Enberg
2011-05-24 11:41                     ` Avi Kivity
2011-05-24 11:56                       ` Pekka Enberg
2011-05-24 12:27                         ` Paolo Bonzini
2011-05-24 14:38                           ` Avi Kivity
2011-05-24 14:37                       ` Avi Kivity
2011-05-24 14:54                         ` Pekka Enberg
2011-05-24 19:03                           ` Ingo Molnar
2011-05-24 19:00                     ` Ingo Molnar
2011-05-24 19:16           ` Ingo Molnar
2011-05-24  9:18         ` Paolo Bonzini
2011-05-24 19:40           ` Ingo Molnar
2011-05-25  8:21             ` Paolo Bonzini
2011-05-25  8:32               ` Ingo Molnar
2011-05-25  9:15                 ` Paolo Bonzini
2011-05-25  9:36                   ` Ingo Molnar
2011-05-25 10:01                     ` Paolo Bonzini
2011-05-25 10:17                       ` Ingo Molnar
2011-05-25 10:44                         ` Paolo Bonzini
2011-05-25 12:53                           ` Ingo Molnar
2011-05-25 15:37                             ` Paolo Bonzini
2011-05-25  9:49                   ` Ingo Molnar
2011-05-25  8:38               ` Ingo Molnar
2011-05-24  8:51       ` Cyrill Gorcunov
2011-05-23 14:10   ` Pekka Enberg
2011-05-23 11:29 ` [PATCH 1/5 V2] kvm tools: Add BIOS INT10 handler Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1306149553-26793-2-git-send-email-levinsasha928@gmail.com \
    --to=levinsasha928@gmail.com \
    --cc=asias.hejun@gmail.com \
    --cc=gorcunov@gmail.com \
    --cc=john@jfloren.net \
    --cc=kvm@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=penberg@kernel.org \
    --cc=prasadjoshi124@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox