From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LOsvx-0001YN-Uk for qemu-devel@nongnu.org; Mon, 19 Jan 2009 07:08:50 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LOsvw-0001XW-0f for qemu-devel@nongnu.org; Mon, 19 Jan 2009 07:08:49 -0500 Received: from [199.232.76.173] (port=60149 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LOsvv-0001XK-Qj for qemu-devel@nongnu.org; Mon, 19 Jan 2009 07:08:47 -0500 Received: from smtp.eu.citrix.com ([62.200.22.115]:45886) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LOsvv-0001CN-CI for qemu-devel@nongnu.org; Mon, 19 Jan 2009 07:08:47 -0500 Message-ID: <49746C96.90902@eu.citrix.com> Date: Mon, 19 Jan 2009 12:05:42 +0000 From: Stefano Stabellini MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [6322] add a -vga none cli option (Stefano Stabellini) References: <2272E7B0C2F247A596D206A7A486B3B2@FSCPC> <20090118230418.GA11968@redhat.com> In-Reply-To: <20090118230418.GA11968@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" , qemu-devel@nongnu.org Daniel P. Berrange wrote: >> I just tried this with r6367 on WinXP and SDL support as >> >> qemu.exe -L . -hda dummy.img -vga none >> >> and it made qemu crash. This happens on the call to >> "sdl_display_init(ds, full_screen, no_frame);" in vl.c. >> >> Maybe "-vga none" should imply "-nographic" ? > > The VGA adapter isn't the only thing being displayed on the SDL/VNC > display - you potentially have the monitor console, and serial / parallel > devices & anything else that's using one of QEMU's text consoles. So it > is correct that '-vga none' is independant of '-nographic' & thus it is > neccessary to fix the crash seen. > Yes the two options should be independent but currently they are not because the qemu console code doesn't allocate and manage its own DisplayState but uses the one allocated by the graphic card instead. This is a known problem and when we implement multiple DisplayState handling, this bug will be fixed properly. At the moment we either set nographic = 1 when "-vga none" or we go with the following patch. Please note that this patch is alternative to the other patch I sent today as a reply to the thread "Adds null check for DisplayStatus", and fixes that bug too. Signed-off-by: Stefano Stabellini --- diff --git a/vl.c b/vl.c index bfacdcf..b356323 100644 --- a/vl.c +++ b/vl.c @@ -2774,26 +2774,17 @@ DisplayState *get_displaystate(void) } /* dumb display */ - -static void dumb_update(DisplayState *ds, int x, int y, int w, int h) +static void dumb_display_init(void) { -} - -static void dumb_resize(DisplayState *ds) -{ -} + DisplayState *ds; -static void dumb_display_init(DisplayState *ds) -{ - DisplayChangeListener *dcl = qemu_mallocz(sizeof(DisplayChangeListener)); - if (!dcl) + ds = (DisplayState *) qemu_mallocz(sizeof(DisplayState)); + if (ds == NULL) { + fprintf(stderr, "dumb_display_init: DisplayState allocation failed\n"); exit(1); - dcl->dpy_update = dumb_update; - dcl->dpy_resize = dumb_resize; - dcl->dpy_refresh = NULL; - dcl->idle = 1; - dcl->gui_timer_interval = 500; - register_displaychangelistener(ds, dcl); + } + ds->surface = qemu_create_displaysurface(640, 480, 32, 640 * 4); + register_displaystate(ds); } /***********************************************************/ @@ -5535,6 +5526,8 @@ int main(int argc, char **argv, char **envp) } } + if (!display_state) + dumb_display_init(); /* just use the first displaystate for the moment */ ds = display_state; /* terminal init */ @@ -5543,8 +5536,6 @@ int main(int argc, char **argv, char **envp) fprintf(stderr, "fatal: -nographic can't be used with -curses\n"); exit(1); } - /* nearly nothing to do */ - dumb_display_init(ds); } else { #if defined(CONFIG_CURSES) if (curses) { @@ -5563,8 +5554,6 @@ int main(int argc, char **argv, char **envp) sdl_display_init(ds, full_screen, no_frame); #elif defined(CONFIG_COCOA) cocoa_display_init(ds, full_screen); -#else - dumb_display_init(ds); #endif } }