[PATCH RFC v5 11/12] ui/console-vc: forward text console size to vc chardev

Filip Hejsek posted 12 patches 1 week ago
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, Stefano Garzarella <sgarzare@redhat.com>, "Gonglei (Arei)" <arei.gonglei@huawei.com>, Zhenwei Pi <pizhenwei@bytedance.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Raphael Norwitz <raphael@enfabrica.net>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, Thomas Huth <thuth@redhat.com>, Halil Pasic <pasic@linux.ibm.com>, Christian Borntraeger <borntraeger@linux.ibm.com>, "Collin L. Walling" <walling@linux.ibm.com>, Laurent Vivier <lvivier@redhat.com>, Amit Shah <amit@kernel.org>, Eduardo Habkost <eduardo@habkost.net>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Yanan Wang <wangyanan55@huawei.com>, Zhao Liu <zhao1.liu@intel.com>, Corey Minyard <minyard@acm.org>, Fam Zheng <fam@euphon.net>, Samuel Thibault <samuel.thibault@ens-lyon.org>, "Alex Bennée" <alex.bennee@linaro.org>, "Dr. David Alan Gilbert" <dave@treblig.org>, Markus Armbruster <armbru@redhat.com>, Jason Wang <jasowang@redhat.com>, Eric Blake <eblake@redhat.com>
[PATCH RFC v5 11/12] ui/console-vc: forward text console size to vc chardev
Posted by Filip Hejsek 1 week ago
Update the vc chardev size when the size of a text console is recomputed.

NOTE: It seems wrong that the dpy_text_resize callback is not called
      when the size is recomputed. I believe this is a bug, although it
      doesn't matter much because the only user of the callback is
      ui/ncurses and it only uses the size of fixed consoles.

Signed-off-by: Filip Hejsek <filip.hejsek@gmail.com>
---
 ui/console-vc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/ui/console-vc.c b/ui/console-vc.c
index 830842064d6982ee4e7882e50e5c3ef9b1e18f59..a3a90440d52754b02961e29063dda91c9f4097f2 100644
--- a/ui/console-vc.c
+++ b/ui/console-vc.c
@@ -414,6 +414,9 @@ static void text_console_resize(QemuTextConsole *t)
     }
     g_free(t->cells);
     t->cells = cells;
+
+    /* XXX Shouldn't qemu_text_console_update_size() also be called here? */
+    qemu_chr_resize(t->chr, t->width, t->height);
 }
 
 static void vc_put_lf(VCChardev *vc)

-- 
2.51.0
Re: [PATCH RFC v5 11/12] ui/console-vc: forward text console size to vc chardev
Posted by Daniel P. Berrangé 6 days, 6 hours ago
On Sun, Sep 21, 2025 at 01:45:41AM +0200, Filip Hejsek wrote:
> Update the vc chardev size when the size of a text console is recomputed.
> 
> NOTE: It seems wrong that the dpy_text_resize callback is not called
>       when the size is recomputed. I believe this is a bug, although it
>       doesn't matter much because the only user of the callback is
>       ui/ncurses and it only uses the size of fixed consoles.
> 
> Signed-off-by: Filip Hejsek <filip.hejsek@gmail.com>
> ---
>  ui/console-vc.c | 3 +++
>  1 file changed, 3 insertions(+)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|