Skip to content

ui/console: Remove console_select()

Akihiko Odaki qemu-devel 2 versions – In review

Get series with b4
b4 am [email protected] change-id 20240317-console-6744d4ab8ba6

Versions newest first

  1. v2 Latest4 patches 4 repliesIn review
  2. v14 patches 4 repliesSuperseded

Changes in v2 from the cover letter

- Changed to fall back to a text console if there is no graphical console as previously done.
- Link to v1: https://lore.kernel.org/r/[email protected]

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4ui/vc: Do not inherit the size of active consoleui/console-vc.c+2 -20 replies
2/4ui/vnc: Do not use console_select()include/ui/console.h include/ui/kbd-state.h ui/console.c +2 more+39 -50 replies
3/4ui/cocoa: Do not use console_select()ui/cocoa.m+26 -110 replies
4/4ui/curses: Do not use console_select()include/ui/console.h ui/console-priv.h ui/console-vc-stubs.c +3 more+51 -1260 replies

Reviews trailers per patch

1 of 4 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchMarc-André Lureau
SeriesR-b
1/4R-b
2/4
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/4] ui/console: Remove console_select()

ui/console has a concept of "active" console; the active console is used when NULL is set for DisplayListener::con, and console_select() updates the active console state. However, the global nature of the state cause odd behaviors, and replacing NULL with the active console also resulted in extra code. Remove it to solve these problems.

The active console state is shared, so if there are two displays referring to the active console, switching the console for one will also affect the other. All displays that use the active console state, namely cocoa, curses, and vnc, need to reset some of its state before switching the console, and such a reset operation cannot be performed if the console is switched by another display. This can result in stuck keys, for example.

While the active console state is shared, displays other than cocoa, curses, and vnc don't update the state. A chardev-vc inherits the size of the active console, but it does not make sense for such a display.

This series removes the shared "active" console state from ui/console. curses, cocoa, and vnc will hold the reference to the console currently shown with DisplayListener::con. This also eliminates the need to replace NULL with the active console and save code.

---
Changes in v2:
- Changed to fall back to a text console if there is no graphical console as previously done.
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Akihiko Odaki (4):
ui/vc: Do not inherit the size of active console ui/vnc: Do not use console_select() ui/cocoa: Do not use console_select() ui/curses: Do not use console_select()

 include/ui/console.h   |   2 +-
 include/ui/kbd-state.h |  11 ++++
 ui/console-priv.h      |   2 +-
 ui/console-vc-stubs.c  |   2 +-
 ui/console-vc.c        |   7 ++-
 ui/console.c           | 133 ++++++++++++-------------------------------------
 ui/curses.c            |  48 ++++++++++--------
 ui/kbd-state.c         |   6 +++
 ui/vnc.c               |  14 ++++--
 ui/cocoa.m             |  37 ++++++++++----
 10 files changed, 118 insertions(+), 144 deletions(-)

---
base-commit: ba49d760eb04630e7b15f423ebecf6c871b8f77b
change-id: 20240317-console-6744d4ab8ba6

Best regards,

Signature · 1 line
Akihiko Odaki <[email protected]>