summaryrefslogtreecommitdiff
path: root/ui/console.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2016-12-07 16:20:22 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2017-01-27 18:07:59 +0100
commit0ec7b3e7f21caf6bfde404528928d600b661ea8d (patch)
tree85e1a8b7e7234d22b9e7fc4947f89d50f4bcbcfb /ui/console.c
parentd5cafc733d21167fce7fcc3b45530ecb1f878e09 (diff)
downloadqemu-0ec7b3e7f21caf6bfde404528928d600b661ea8d.tar.gz
char: rename CharDriverState Chardev
Pick a uniform chardev type name. 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/console.c')
-rw-r--r--ui/console.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/ui/console.c b/ui/console.c
index 495d5a2121..7420f28349 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -158,7 +158,7 @@ struct QemuConsole {
int esc_params[MAX_ESC_PARAMS];
int nb_esc_params;
- CharDriverState *chr;
+ Chardev *chr;
/* fifo for key pressed */
QEMUFIFO out_fifo;
uint8_t out_fifo_buf[16];
@@ -183,7 +183,7 @@ static int nb_consoles = 0;
static bool cursor_visible_phase;
static QEMUTimer *cursor_timer;
-static void text_console_do_init(CharDriverState *chr, DisplayState *ds);
+static void text_console_do_init(Chardev *chr, DisplayState *ds);
static void dpy_refresh(DisplayState *s);
static DisplayState *get_alloc_displaystate(void);
static void text_console_update_cursor_timer(void);
@@ -1046,14 +1046,14 @@ void console_select(unsigned int index)
}
}
-typedef struct VCDriverState {
- CharDriverState parent;
+typedef struct VCChardev {
+ Chardev parent;
QemuConsole *console;
-} VCDriverState;
+} VCChardev;
-static int console_puts(CharDriverState *chr, const uint8_t *buf, int len)
+static int console_puts(Chardev *chr, const uint8_t *buf, int len)
{
- VCDriverState *drv = (VCDriverState *)chr;
+ VCChardev *drv = (VCChardev *)chr;
QemuConsole *s = drv->console;
int i;
@@ -1962,9 +1962,9 @@ int qemu_console_get_height(QemuConsole *con, int fallback)
return con ? surface_height(con->surface) : fallback;
}
-static void text_console_set_echo(CharDriverState *chr, bool echo)
+static void text_console_set_echo(Chardev *chr, bool echo)
{
- VCDriverState *drv = (VCDriverState *)chr;
+ VCChardev *drv = (VCChardev *)chr;
QemuConsole *s = drv->console;
s->echo = echo;
@@ -2003,9 +2003,9 @@ static const GraphicHwOps text_console_ops = {
.text_update = text_console_update,
};
-static void text_console_do_init(CharDriverState *chr, DisplayState *ds)
+static void text_console_do_init(Chardev *chr, DisplayState *ds)
{
- VCDriverState *drv = (VCDriverState *)chr;
+ VCChardev *drv = (VCChardev *)chr;
QemuConsole *s = drv->console;
int g_width = 80 * FONT_WIDTH;
int g_height = 24 * FONT_HEIGHT;
@@ -2058,11 +2058,11 @@ static void text_console_do_init(CharDriverState *chr, DisplayState *ds)
static const CharDriver vc_driver;
-static CharDriverState *text_console_init(ChardevVC *vc, Error **errp)
+static Chardev *text_console_init(ChardevVC *vc, Error **errp)
{
ChardevCommon *common = qapi_ChardevVC_base(vc);
- CharDriverState *chr;
- VCDriverState *drv;
+ Chardev *chr;
+ VCChardev *drv;
QemuConsole *s;
unsigned width = 0;
unsigned height = 0;
@@ -2099,7 +2099,7 @@ static CharDriverState *text_console_init(ChardevVC *vc, Error **errp)
}
s->chr = chr;
- drv = (VCDriverState *)chr;
+ drv = (VCChardev *)chr;
drv->console = s;
if (display_state) {
@@ -2110,10 +2110,10 @@ static CharDriverState *text_console_init(ChardevVC *vc, Error **errp)
static VcHandler *vc_handler = text_console_init;
-static CharDriverState *vc_init(const CharDriver *driver,
- const char *id, ChardevBackend *backend,
- ChardevReturn *ret, bool *be_opened,
- Error **errp)
+static Chardev *vc_init(const CharDriver *driver,
+ const char *id, ChardevBackend *backend,
+ ChardevReturn *ret, bool *be_opened,
+ Error **errp)
{
/* console/chardev init sometimes completes elsewhere in a 2nd
* stage, so defer OPENED events until they are fully initialized
@@ -2204,7 +2204,7 @@ static const TypeInfo qemu_console_info = {
};
static const CharDriver vc_driver = {
- .instance_size = sizeof(VCDriverState),
+ .instance_size = sizeof(VCChardev),
.kind = CHARDEV_BACKEND_KIND_VC,
.parse = qemu_chr_parse_vc,
.create = vc_init,