From 091a4aa6f7935be0b3bca8a6530aab20d5b22f48 Mon Sep 17 00:00:00 2001 From: ths Date: Thu, 21 Jun 2007 23:34:19 +0000 Subject: [PATCH] Fix segfault in -nographic mode, by Stefen Weil. --- vl.c | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/vl.c b/vl.c index b26d7541b9..271233a2f2 100644 --- a/vl.c +++ b/vl.c @@ -4483,6 +4483,34 @@ void pcmcia_info(void) } /***********************************************************/ +/* dumb display */ + +static void dumb_update(DisplayState *ds, int x, int y, int w, int h) +{ +} + +static void dumb_resize(DisplayState *ds, int w, int h) +{ +} + +static void dumb_refresh(DisplayState *ds) +{ +#if defined(CONFIG_SDL) + vga_hw_update(); +#endif +} + +static void dumb_display_init(DisplayState *ds) +{ + ds->data = NULL; + ds->linesize = 0; + ds->depth = 0; + ds->dpy_update = dumb_update; + ds->dpy_resize = dumb_resize; + ds->dpy_refresh = dumb_refresh; +} + +/***********************************************************/ /* I/O handling */ #define MAX_IO_HANDLERS 64 @@ -7884,7 +7912,8 @@ int main(int argc, char **argv) /* terminal init */ memset(&display_state, 0, sizeof(display_state)); if (nographic) { - /* nothing to do */ + /* nearly nothing to do */ + dumb_display_init(ds); } else if (vnc_display != NULL) { vnc_display_init(ds, vnc_display); } else { -- 2.11.4.GIT