Skip to content
  • Laszlo Ersek's avatar
    65d7ceb4
    ui/console: sanitize search in qemu_graphic_console_is_multihead() · 65d7ceb4
    Laszlo Ersek authored
    
    
    qemu_graphic_console_is_multihead() declares the graphical console "c" a
    "multihead" console if there are two different graphical consoles in the
    system that (a) both reference "c->device", and (b) have different
    "c->head" numbers. In effect, if at least two graphical consoles exist
    that are different heads of the same device that underlies "c". In fact,
    "c" may be one of these two graphical consoles, or "c" may differ from
    both of those consoles (in case "c->device" has at least three heads).
    
    The loop currently uses this awkward "two different consoles" approach
    because the function used not to have access to "c", only to "c->device",
    which didn't allow for fetching (and comparing) "c->head". But, we've
    changed that in the last patch; we now pass all of "c" to
    qemu_graphic_console_is_multihead().
    
    Thus, look for the *first* (and possibly *only*) graphical console, if
    any, that refers to the same "device" as "c", but by a different "head"
    number.
    
    Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com> (odd fixer:Graphics)
    Cc: Gerd Hoffmann <kraxel@redhat.com> (odd fixer:Graphics)
    Signed-off-by: default avatarLaszlo Ersek <lersek@redhat.com>
    Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
    Message-ID: <20230913144959.41891-5-lersek@redhat.com>
    65d7ceb4
    ui/console: sanitize search in qemu_graphic_console_is_multihead()
    Laszlo Ersek authored
    
    
    qemu_graphic_console_is_multihead() declares the graphical console "c" a
    "multihead" console if there are two different graphical consoles in the
    system that (a) both reference "c->device", and (b) have different
    "c->head" numbers. In effect, if at least two graphical consoles exist
    that are different heads of the same device that underlies "c". In fact,
    "c" may be one of these two graphical consoles, or "c" may differ from
    both of those consoles (in case "c->device" has at least three heads).
    
    The loop currently uses this awkward "two different consoles" approach
    because the function used not to have access to "c", only to "c->device",
    which didn't allow for fetching (and comparing) "c->head". But, we've
    changed that in the last patch; we now pass all of "c" to
    qemu_graphic_console_is_multihead().
    
    Thus, look for the *first* (and possibly *only*) graphical console, if
    any, that refers to the same "device" as "c", but by a different "head"
    number.
    
    Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com> (odd fixer:Graphics)
    Cc: Gerd Hoffmann <kraxel@redhat.com> (odd fixer:Graphics)
    Signed-off-by: default avatarLaszlo Ersek <lersek@redhat.com>
    Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
    Message-ID: <20230913144959.41891-5-lersek@redhat.com>
Loading