WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [patch 02/21] Xen-paravirt: Handle a zero-sized VT console

To: Andi Kleen <ak@xxxxxx>
Subject: [Xen-devel] [patch 02/21] Xen-paravirt: Handle a zero-sized VT console
From: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Date: Tue, 13 Feb 2007 14:17:31 -0800
Cc: Andrew Morton <akpm@xxxxxxxx>, Zachary Amsden <zach@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, Chris Wright <chrisw@xxxxxxxxxxxx>, virtualization@xxxxxxxxxxxxxx, Gerd Hoffmann <kraxel@xxxxxxx>, Alan <alan@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Tue, 13 Feb 2007 14:28:37 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20070213221729.772002682@xxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: quilt/0.46-1
If we're running under Xen, then there's no VT console.  This results
in vc->vc_screenbuf_size == 0, which causes alloc_bootmem to panic.
Don't bother allocating a vc_screenbuf if its going to be 0 sized.

(Cleanup: remove unnecessary cast)

Signed-off-by: Jeremy Fitzhardinge <jeremy@xxxxxxxxxxxxx>
Cc: Alan <alan@xxxxxxxxxxxxxxxxxxx>
Cc: Gerd Hoffmann <kraxel@xxxxxxx>
Cc: Chris Wright <chrisw@xxxxxxxxxxxx>

===================================================================
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -2638,7 +2638,10 @@ static int __init con_init(void)
        for (currcons = 0; currcons < MIN_NR_CONSOLES; currcons++) {
                vc_cons[currcons].d = vc = alloc_bootmem(sizeof(struct 
vc_data));
                visual_init(vc, currcons, 1);
-               vc->vc_screenbuf = (unsigned short 
*)alloc_bootmem(vc->vc_screenbuf_size);
+
+               vc->vc_screenbuf = NULL;
+               if (vc->vc_screenbuf_size)
+                       vc->vc_screenbuf = alloc_bootmem(vc->vc_screenbuf_size);
                vc->vc_kmalloced = 0;
                vc_init(vc, vc->vc_rows, vc->vc_cols,
                        currcons || !vc->vc_sw->con_save_screen);

-- 


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel