aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2017-01-05 17:30:29 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2017-01-27 18:07:59 +0100
commit5bf5adaeb7245d7037f29429fb231b4b602d5b50 (patch)
treeb802659c7ce348b173ea0c107fa92f5e2ab6448e /ui
parentfc6d0b86c8e5486f7254e3f93fe6d8b915cfb4c1 (diff)
vc: use a common prefix for chr callbacks
vc_chr_write() is more appropriate than _puts() since no newline is appended, even though it's not used only as a callback. Keep "qemu_chr_parse" prefix, most chardev parse functions use this prefix atm. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'ui')
-rw-r--r--ui/console.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/ui/console.c b/ui/console.c
index d8bc8a63cb..c8ee164ffe 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -1051,7 +1051,7 @@ typedef struct VCChardev {
QemuConsole *console;
} VCChardev;
-static int console_puts(Chardev *chr, const uint8_t *buf, int len)
+static int vc_chr_write(Chardev *chr, const uint8_t *buf, int len)
{
VCChardev *drv = (VCChardev *)chr;
QemuConsole *s = drv->console;
@@ -1139,13 +1139,13 @@ void kbd_put_keysym_console(QemuConsole *s, int keysym)
*q++ = '[';
*q++ = keysym & 0xff;
} else if (s->echo && (keysym == '\r' || keysym == '\n')) {
- console_puts(s->chr, (const uint8_t *) "\r", 1);
+ vc_chr_write(s->chr, (const uint8_t *) "\r", 1);
*q++ = '\n';
} else {
*q++ = keysym;
}
if (s->echo) {
- console_puts(s->chr, buf, q - buf);
+ vc_chr_write(s->chr, buf, q - buf);
}
be = s->chr->be;
if (be && be->chr_read) {
@@ -1962,7 +1962,7 @@ int qemu_console_get_height(QemuConsole *con, int fallback)
return con ? surface_height(con->surface) : fallback;
}
-static void text_console_set_echo(Chardev *chr, bool echo)
+static void vc_chr_set_echo(Chardev *chr, bool echo)
{
VCChardev *drv = (VCChardev *)chr;
QemuConsole *s = drv->console;
@@ -2049,7 +2049,7 @@ static void text_console_do_init(Chardev *chr, DisplayState *ds)
s->t_attrib.bgcol = QEMU_COLOR_BLUE;
len = snprintf(msg, sizeof(msg), "%s console\r\n", chr->label);
- console_puts(chr, (uint8_t*)msg, len);
+ vc_chr_write(chr, (uint8_t *)msg, len);
s->t_attrib = s->t_attrib_default;
}
@@ -2058,10 +2058,10 @@ static void text_console_do_init(Chardev *chr, DisplayState *ds)
static const CharDriver vc_driver;
-static Chardev *vc_init(const CharDriver *driver,
- const char *id, ChardevBackend *backend,
- ChardevReturn *ret, bool *be_opened,
- Error **errp)
+static Chardev *vc_chr_init(const CharDriver *driver,
+ const char *id, ChardevBackend *backend,
+ ChardevReturn *ret, bool *be_opened,
+ Error **errp)
{
ChardevVC *vc = backend->u.vc.data;
ChardevCommon *common = qapi_ChardevVC_base(vc);
@@ -2197,9 +2197,9 @@ static const CharDriver vc_driver = {
.instance_size = sizeof(VCChardev),
.kind = CHARDEV_BACKEND_KIND_VC,
.parse = qemu_chr_parse_vc,
- .create = vc_init,
- .chr_write = console_puts,
- .chr_set_echo = text_console_set_echo,
+ .create = vc_chr_init,
+ .chr_write = vc_chr_write,
+ .chr_set_echo = vc_chr_set_echo,
};
static void register_types(void)