aboutsummaryrefslogtreecommitdiff
path: root/ui/console.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2016-12-07 15:13:50 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2017-01-27 18:07:59 +0100
commit6f974c843c7c3d142f3ce594498431ba2ac19627 (patch)
tree35676847288cdd3ceb311b30a9591b32fd5e96b5 /ui/console.c
parent776a32a0752b67d94859a60b98a1e772a85d8111 (diff)
downloadqemu-6f974c843c7c3d142f3ce594498431ba2ac19627.zip
qemu-6f974c843c7c3d142f3ce594498431ba2ac19627.tar.gz
qemu-6f974c843c7c3d142f3ce594498431ba2ac19627.tar.bz2
gtk: overwrite the console.c char driver
Instead of registering a vc handler to allocate the Gtk VC Chardev, overwrite the console.c char driver. A later patch, when switching to QOM, will register a default console vc QOM class if none has been registered before. 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.c24
1 files changed, 7 insertions, 17 deletions
diff --git a/ui/console.c b/ui/console.c
index 7420f28..d8bc8a6 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -2058,8 +2058,12 @@ static void text_console_do_init(Chardev *chr, DisplayState *ds)
static const CharDriver vc_driver;
-static Chardev *text_console_init(ChardevVC *vc, Error **errp)
+static Chardev *vc_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);
Chardev *chr;
VCChardev *drv;
@@ -2105,26 +2109,13 @@ static Chardev *text_console_init(ChardevVC *vc, Error **errp)
if (display_state) {
text_console_do_init(chr, display_state);
}
- return chr;
-}
-static VcHandler *vc_handler = text_console_init;
-
-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
*/
*be_opened = false;
- return vc_handler(backend->u.vc.data, errp);
-}
-void register_vc_handler(VcHandler *handler)
-{
- vc_handler = handler;
+ return chr;
}
void qemu_console_resize(QemuConsole *s, int width, int height)
@@ -2162,8 +2153,7 @@ PixelFormat qemu_default_pixelformat(int bpp)
return pf;
}
-static void qemu_chr_parse_vc(QemuOpts *opts, ChardevBackend *backend,
- Error **errp)
+void qemu_chr_parse_vc(QemuOpts *opts, ChardevBackend *backend, Error **errp)
{
int val;
ChardevVC *vc;