Commit f93cc8f331 for qemu.org

commit f93cc8f3314e094ff6f64db397494c881b0c0478
Author: Marc-André Lureau <marcandre.lureau@redhat.com>
Date:   Thu Feb 19 13:50:22 2026 +0100

    ui/console-vc: move vc_put_lf() to VT100 layer as vt100_put_lf()

    Decouple the line-feed handling from VCChardev by operating on
    QemuVT100 directly. The function no longer needs the chardev or
    console pointers — callers pass &s->vt instead. This continues the
    effort to make the VT100 terminal emulation self-contained.

    Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
    Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>

diff --git a/ui/console-vc.c b/ui/console-vc.c
index 00de9291d3..2de096db3a 100644
--- a/ui/console-vc.c
+++ b/ui/console-vc.c
@@ -432,10 +432,8 @@ static void vt100_set_image(QemuVT100 *vt, pixman_image_t *image)
     vt->cells = cells;
 }

-static void vc_put_lf(VCChardev *vc)
+static void vt100_put_lf(QemuVT100 *vt)
 {
-    QemuTextConsole *s = vc->console;
-    QemuVT100 *vt = &s->vt;
     TextCell *c;
     int x, y1;

@@ -626,7 +624,7 @@ static void vc_put_one(VCChardev *vc, int ch)
     if (vt->x >= vt->width) {
         /* line wrap */
         vt->x = 0;
-        vc_put_lf(vc);
+        vt100_put_lf(vt);
     }
     y1 = (vt->y_base + vt->y) % vt->total_height;
     c = &vt->cells[y1 * vt->width + vt->x];
@@ -792,7 +790,7 @@ static void vc_putchar(VCChardev *vc, int ch)
             vt->x = 0;
             break;
         case '\n':  /* newline */
-            vc_put_lf(vc);
+            vt100_put_lf(&s->vt);
             break;
         case '\b':  /* backspace */
             if (vt->x > 0)
@@ -801,7 +799,7 @@ static void vc_putchar(VCChardev *vc, int ch)
         case '\t':  /* tabspace */
             if (vt->x + (8 - (vt->x % 8)) > vt->width) {
                 vt->x = 0;
-                vc_put_lf(vc);
+                vt100_put_lf(vt);
             } else {
                 vt->x = vt->x + (8 - (vt->x % 8));
             }