Skip to content
Snippets Groups Projects
  • Gerd Hoffmann's avatar
    2e5567c9
    vnc: deal with surface NULL pointers · 2e5567c9
    Gerd Hoffmann authored
    
    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-<nr>) in a multihead setup, for example using
    -device virtio-vga,max_outputs=2.
    
    Cc: Christian Borntraeger <borntraeger@de.ibm.com>
    Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
    Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
    Tested-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
    Message-id: 20180308161803.6152-1-kraxel@redhat.com
    2e5567c9
    History
    vnc: deal with surface NULL pointers
    Gerd Hoffmann authored
    
    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-<nr>) in a multihead setup, for example using
    -device virtio-vga,max_outputs=2.
    
    Cc: Christian Borntraeger <borntraeger@de.ibm.com>
    Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
    Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
    Tested-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
    Message-id: 20180308161803.6152-1-kraxel@redhat.com