All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v7 00/12] virtio-console: notify about the terminal size
@ 2026-06-09 19:16 Filip Hejsek
  2026-06-09 19:16 ` [PATCH v7 01/12] chardev: add cols, rows fields Filip Hejsek
                   ` (11 more replies)
  0 siblings, 12 replies; 16+ messages in thread
From: Filip Hejsek @ 2026-06-09 19:16 UTC (permalink / raw)
  To: qemu-devel
  Cc: Marc-André Lureau, Paolo Bonzini, Michael S. Tsirkin,
	Laurent Vivier, Amit Shah, Markus Armbruster, Eric Blake,
	Eduardo Habkost, Marcel Apfelbaum, Yanan Wang, Zhao Liu,
	Daniel P. Berrangé, Maximilian Immanuel Brandtner,
	Philippe Mathieu-Daudé, Szymon Lukasz

Summary of The Series
---------------------

This series adds terminal size support to the virtio-console device.
The goal is to make it possible to get a resizable terminal into a guest
without using e.g. ssh.

Support for detecting terminal size is added to stdio and vc backends,
but not pty and serial, because for the later it's unfortunately
impossible to get resize notifications.

A QMP command is added for notifying QEMU about the terminal size
of any chardev. This can be used by clients to support resizing for
devices where QEMU is not able to detect the size by itself (e.g. virsh
console).

There was a bug in Linux versions prior to 6.15 which caused the
dimensions to be interpreted incorrectly by the guest. The fix has
been backported to currently supported kernels, but to avoid making the
terminal harder to use on out of date guests, the feature is disabled
by default and must be enabled with the console-size property.

Limitations
-----------

There is still no documentation for the console-size property, which
would be nice to have so that people can discover this functionality.

Resizing support for the spice version of 'vc' chardev is still missing.

After migration, the guest is not informed about the new console size
(fixing this requires migration stream changes).

Full Changelog
--------------

v7:
- Rebased
- Renamed some functions
- Made virtio size support disabled by default
- "Since: 11.0" -> "Since: 11.1"
- Dropped "must exist" from chardev id param description in qmp docs
- Link to v6: https://lore.kernel.org/qemu-devel/20260119-console-resize-v6-0-33a7b0330a7a@gmail.com

v6:
- Rebased (renaming CharBackend -> CharFrontend)
- Virtio resize message code rewritten to fix corner cases
- Updated version numbers ('Since: 11.0', hw_compat_10_2)
- Added note to CHR_EVENT_RESIZE definition comment, explaining
  that only the focused frontend gets the event
- Fixed checkpatch warning (line length)
- Link to v5: https://lore.kernel.org/qemu-devel/20250921-console-resize-v5-0-89e3c6727060@gmail.com

v5:
- Rename chardev-resize -> chardev-window-size-changed
- Improve chardev-window-size-changed documentation
- Add partial implementation for 'vc' chardev
- Config space now returns port 0 size if multiport
- Console-size property completely disables size support
- Fix misnamed variables in char-win-stdio
- Link to v4: https://lore.kernel.org/qemu-devel/20250912-console-resize-v4-0-7925e444afc4@gmail.com

v4:
- Changed order of rows and cols fields
- Added support for terminal size on Windows
- Trace event is also emitted for legacy (non-multiport) drivers
- Minor fixes required because of changes in QEMU (DECLARE_INSTANCE_CHECKER, qmp-example)
- Updated version numbers ('Since: 10.2', hw_compat_10_1)
- Link to v3: https://lore.kernel.org/qemu-devel/20200629164041.472528-1-noh4hss@gmail.com

v3:
- Add resize messages over QMP, as suggested by Daniel

v2:
- Fix adding a new virtio feature bit to the virtio console device

---
Filip Hejsek (4):
      char-win-stdio: add support for terminal size
      ui/console-vc: forward text console size to vc chardev
      ui/gtk: forward gtk console size to vc chardev
      virtio-serial-bus: add terminal resize messages

Szymon Lukasz (8):
      chardev: add cols, rows fields
      chardev: add CHR_EVENT_RESIZE
      chardev: add qemu_chr_resize()
      char-mux: add support for the terminal size
      main-loop: change the handling of SIGWINCH
      char-stdio: add support for the terminal size
      qmp: add chardev-window-size-changed command
      virtio-console: notify the guest about terminal resizes

 backends/cryptodev-vhost-user.c   |  1 +
 chardev/char-fe.c                 | 13 +++++++
 chardev/char-mux.c                | 19 ++++++++-
 chardev/char-stdio.c              | 30 +++++++++++++++
 chardev/char-win-stdio.c          | 19 +++++++++
 chardev/char.c                    | 26 +++++++++++++
 hw/block/vhost-user-blk.c         |  1 +
 hw/char/terminal3270.c            |  1 +
 hw/char/trace-events              |  1 +
 hw/char/virtio-console.c          | 35 +++++++++++++++--
 hw/char/virtio-serial-bus.c       | 81 ++++++++++++++++++++++++++++++++++++++-
 hw/ipmi/ipmi_bmc_extern.c         |  1 +
 hw/scsi/vhost-user-scsi.c         |  1 +
 hw/usb/ccid-card-passthru.c       |  1 +
 hw/usb/dev-serial.c               |  1 +
 hw/usb/redirect.c                 |  1 +
 hw/virtio/vhost-user-base.c       |  1 +
 hw/virtio/vhost-user-scmi.c       |  1 +
 include/chardev/char-fe.h         | 10 +++++
 include/chardev/char.h            |  9 +++++
 include/hw/virtio/virtio-serial.h |  7 ++++
 include/qemu/main-loop.h          |  4 ++
 monitor/hmp.c                     |  1 +
 monitor/qmp.c                     |  1 +
 net/passt.c                       |  1 +
 net/vhost-user.c                  |  1 +
 qapi/char.json                    | 31 +++++++++++++++
 ui/console-vc.c                   |  8 ++++
 ui/curses.c                       | 11 +++---
 ui/gtk.c                          | 28 ++++++++++++++
 util/main-loop.c                  | 21 ++++++++++
 31 files changed, 356 insertions(+), 11 deletions(-)
---
base-commit: cc329c491768b2d91eb0b0984f3baa0bf805776d
change-id: 20250912-console-resize-96c42140ba08

Best regards,
--  
Filip Hejsek <filip.hejsek@gmail.com>



^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2026-06-10 13:32 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-09 19:16 [PATCH v7 00/12] virtio-console: notify about the terminal size Filip Hejsek
2026-06-09 19:16 ` [PATCH v7 01/12] chardev: add cols, rows fields Filip Hejsek
2026-06-09 19:16 ` [PATCH v7 02/12] chardev: add CHR_EVENT_RESIZE Filip Hejsek
2026-06-10 13:25   ` Daniel P. Berrangé
2026-06-09 19:16 ` [PATCH v7 03/12] chardev: add qemu_chr_resize() Filip Hejsek
2026-06-09 19:16 ` [PATCH v7 04/12] char-mux: add support for the terminal size Filip Hejsek
2026-06-09 19:16 ` [PATCH v7 05/12] main-loop: change the handling of SIGWINCH Filip Hejsek
2026-06-09 19:16 ` [PATCH v7 06/12] char-stdio: add support for the terminal size Filip Hejsek
2026-06-09 19:16 ` [PATCH v7 07/12] char-win-stdio: add support for " Filip Hejsek
2026-06-09 19:16 ` [PATCH v7 08/12] ui/console-vc: forward text console size to vc chardev Filip Hejsek
2026-06-09 19:16 ` [PATCH v7 09/12] ui/gtk: forward gtk " Filip Hejsek
2026-06-09 19:16 ` [PATCH v7 10/12] qmp: add chardev-window-size-changed command Filip Hejsek
2026-06-09 19:16 ` [PATCH v7 11/12] virtio-serial-bus: add terminal resize messages Filip Hejsek
2026-06-09 21:48   ` marcandre.lureau
2026-06-10 13:31   ` Daniel P. Berrangé
2026-06-09 19:16 ` [PATCH v7 12/12] virtio-console: notify the guest about terminal resizes Filip Hejsek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.