From patchwork Mon May 23 08:44:48 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 808082 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p4N8jkUi005720 for ; Mon, 23 May 2011 08:45:46 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752319Ab1EWIpl (ORCPT ); Mon, 23 May 2011 04:45:41 -0400 Received: from mail-bw0-f46.google.com ([209.85.214.46]:63394 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750755Ab1EWIpk (ORCPT ); Mon, 23 May 2011 04:45:40 -0400 Received: by mail-bw0-f46.google.com with SMTP id 15so4514519bwz.19 for ; Mon, 23 May 2011 01:45:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=Tg7GF8PWJ6aYV61PmWIs98velMKldk9+B2dpDiRn27s=; b=Zv5jzJIL7TFAydLf52RhKmbcYlGN5APoaRbAtJYyK1nzYR+1UjBmH7du0onQQGldK+ P8suGJd0soEK3RtE0pX6AK7u0yNOR7rYOFpgdBijsbb78IAsphFmbeDLelGfSaY4Ci+B ZOiov1CAHHMlvSNpBSKxXFcFWuuWVSD4NeFZA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=BQ4BAid4YolXwe/qQl8mom4qfmMBB0O2Y2tNo6xAqx37yQPWs1SQem0sIzohlbdynh NF2oiKv1sMmyFtXRlaNZJd+1tqcy/AA7Gfu4DbMsgP8FAVSkrcTN/ByQlxwdYod4xlA/ G/J9edWZSQ5B+hAHFTB8stTYi+Hj8ACk0H238= Received: by 10.204.143.88 with SMTP id t24mr1912319bku.189.1306140339704; Mon, 23 May 2011 01:45:39 -0700 (PDT) Received: from localhost.localdomain (bzq-79-179-199-121.red.bezeqint.net [79.179.199.121]) by mx.google.com with ESMTPS id q18sm3742392bka.15.2011.05.23.01.45.37 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 23 May 2011 01:45:39 -0700 (PDT) From: Sasha Levin 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 Subject: [PATCH 2/5] kvm tools: Add video mode to kernel initialization Date: Mon, 23 May 2011 11:44:48 +0300 Message-Id: <1306140291-17493-2-git-send-email-levinsasha928@gmail.com> X-Mailer: git-send-email 1.7.5.rc3 In-Reply-To: <1306140291-17493-1-git-send-email-levinsasha928@gmail.com> References: <1306140291-17493-1-git-send-email-levinsasha928@gmail.com> 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 (demeter1.kernel.org [140.211.167.41]); Mon, 23 May 2011 08:45:46 +0000 (UTC) Allow setting video mode in guest kernel. For possible values see Documentation/fb/vesafb.txt Signed-off-by: John Floren Signed-off-by: Sasha Levin --- 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 3cf6e6c..49ebd95 100644 --- a/tools/kvm/include/kvm/kvm.h +++ b/tools/kvm/include/kvm/kvm.h @@ -39,7 +39,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);