From 2e5567c903ad05d312de0c3188cb2d3b856fa4c4 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Thu, 8 Mar 2018 17:18:03 +0100 Subject: vnc: deal with surface NULL pointers Secondary displays in multihead setups are allowed to have a NULL DisplaySurface. Typically user interfaces handle this by hiding the window which shows the display in question. This isn't an option for vnc though because it simply hasn't a concept of windows or outputs. So handle the situation by showing a placeholder DisplaySurface instead. Also check in console_select whenever a surface is preset in the first place before requesting an update. This fixes a segfault which can be triggered by switching to an unused display (via vtrl-alt-) in a multihead setup, for example using -device virtio-vga,max_outputs=2. Cc: Christian Borntraeger Signed-off-by: Gerd Hoffmann Reviewed-by: Philippe Mathieu-Daudé Tested-by: Christian Borntraeger Message-id: 20180308161803.6152-1-kraxel@redhat.com --- include/ui/console.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/ui/console.h') diff --git a/include/ui/console.h b/include/ui/console.h index aae9e44cb3..5fca9afcbc 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -260,6 +260,8 @@ DisplaySurface *qemu_create_displaysurface_guestmem(int width, int height, pixman_format_code_t format, int linesize, uint64_t addr); +DisplaySurface *qemu_create_message_surface(int w, int h, + const char *msg); PixelFormat qemu_default_pixelformat(int bpp); DisplaySurface *qemu_create_displaysurface(int width, int height); -- cgit v1.2.3-55-g7522