From 1540008629bbb6a9c0826582d94ecf7a559f784c Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Wed, 6 Sep 2017 16:21:09 +0200 Subject: console: fix dpy_gfx_replace_surface assert MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit virtio-gpu can trigger the assert added by commit "6905b93447 console: add same surface replace pre-condition" in multihead setups (where surface can be NULL for secondary displays). Allow surface being NULL. Fixes: 6905b93447a42e606dfd126b90f75f4cd3c6fe94 Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-André Lureau Message-id: 20170906142109.2685-1-kraxel@redhat.com --- ui/console.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ui/console.c') diff --git a/ui/console.c b/ui/console.c index d2d3534c49..f0292d7820 100644 --- a/ui/console.c +++ b/ui/console.c @@ -1540,7 +1540,7 @@ void dpy_gfx_replace_surface(QemuConsole *con, DisplaySurface *old_surface = con->surface; DisplayChangeListener *dcl; - assert(old_surface != surface); + assert(old_surface != surface || surface == NULL); con->surface = surface; QLIST_FOREACH(dcl, &s->listeners, next) { -- cgit 1.4.1 From 7c336f9fe53b1a500f21241841c7bf4267c7ee14 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Tue, 29 Aug 2017 13:38:18 +0200 Subject: console: add question-mark escape operator Some termcaps (found using SLES11SP1) use [? sequences. According to man console_codes (http://linux.die.net/man/4/console_codes) the question mark is a nop and should simply be ignored. This patch does exactly that, rendering screen output readable when outputting guest serial consoles to the graphical console emulator. Signed-off-by: Alexander Graf Message-id: 20170829113818.42482-1-agraf@suse.de Signed-off-by: Gerd Hoffmann --- ui/console.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ui/console.c') diff --git a/ui/console.c b/ui/console.c index f0292d7820..b82c27960a 100644 --- a/ui/console.c +++ b/ui/console.c @@ -880,8 +880,9 @@ static void console_putchar(QemuConsole *s, int ch) } else { if (s->nb_esc_params < MAX_ESC_PARAMS) s->nb_esc_params++; - if (ch == ';') + if (ch == ';' || ch == '?') { break; + } trace_console_putchar_csi(s->esc_params[0], s->esc_params[1], ch, s->nb_esc_params); s->state = TTY_STATE_NORM; -- cgit 1.4.1