Skip to content

Commit

Permalink
ui/vc: replace vc_chr_write() with generic qemu_chr_write()
Browse files Browse the repository at this point in the history
We shouldn't call the callback directly, but use the chardev API, unless
there is a clear reason.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230830093843.3531473-5-marcandre.lureau@redhat.com>
  • Loading branch information
elmarco authored and Patchew Applier committed Sep 1, 2023
1 parent 4f2c765 commit f1f7a1e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ui/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -1169,13 +1169,13 @@ void kbd_put_keysym_console(QemuConsole *s, int keysym)
*q++ = '[';
*q++ = keysym & 0xff;
} else if (s->echo && (keysym == '\r' || keysym == '\n')) {
vc_chr_write(s->chr, (const uint8_t *) "\r", 1);
qemu_chr_write(s->chr, (uint8_t *)"\r", 1, true);
*q++ = '\n';
} else {
*q++ = keysym;
}
if (s->echo) {
vc_chr_write(s->chr, buf, q - buf);
qemu_chr_write(s->chr, buf, q - buf, true);
}
num_free = fifo8_num_free(&s->out_fifo);
fifo8_push_all(&s->out_fifo, buf, MIN(num_free, q - buf));
Expand Down Expand Up @@ -2474,7 +2474,7 @@ static void text_console_do_init(Chardev *chr, DisplayState *ds)

s->t_attrib.bgcol = QEMU_COLOR_BLUE;
msg = g_strdup_printf("%s console\r\n", chr->label);
vc_chr_write(chr, (uint8_t *)msg, strlen(msg));
qemu_chr_write(chr, (uint8_t *)msg, strlen(msg), true);
g_free(msg);
s->t_attrib = s->t_attrib_default;
}
Expand Down

0 comments on commit f1f7a1e

Please sign in to comment.