aboutsummaryrefslogtreecommitdiff
path: root/ui/gtk.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2016-12-09 00:50:12 +0300
committerMarc-André Lureau <marcandre.lureau@redhat.com>2017-01-31 13:01:47 +0400
commit88cace9f119b85ac2d40a8b10c24e05ccfa6da07 (patch)
tree9aa623eb65581a78d3c1d910f2a787990260c1eb /ui/gtk.c
parent8cddc46990ab0310af9fb148143326f832802fca (diff)
char: get rid of CharDriver
qemu_chr_new_from_opts() is modified to not need CharDriver backend[] array, but uses instead objectified qmp_query_chardev_backends() and char_get_class(). The alias field is moved outside in a ChardevAlias[], similar to QDevAlias for devices. "kind" and "parse" are moved to ChardevClass ("kind" is to be removed next) Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'ui/gtk.c')
-rw-r--r--ui/gtk.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/ui/gtk.c b/ui/gtk.c
index bdd831c268..f4542e3b86 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -1715,8 +1715,6 @@ static void gd_vc_chr_set_echo(Chardev *chr, bool echo)
static int nb_vcs;
static Chardev *vcs[MAX_VCS];
-static const CharDriver gd_vc_driver;
-
static void gd_vc_open(Chardev *chr,
ChardevBackend *backend,
bool *be_opened,
@@ -1739,6 +1737,8 @@ static void char_gd_vc_class_init(ObjectClass *oc, void *data)
{
ChardevClass *cc = CHARDEV_CLASS(oc);
+ cc->kind = CHARDEV_BACKEND_KIND_VC;
+ cc->parse = qemu_chr_parse_vc;
cc->open = gd_vc_open;
cc->chr_write = gd_vc_chr_write;
cc->chr_set_echo = gd_vc_chr_set_echo;
@@ -1751,11 +1751,6 @@ static const TypeInfo char_gd_vc_type_info = {
.class_init = char_gd_vc_class_init,
};
-static const CharDriver gd_vc_driver = {
- .kind = CHARDEV_BACKEND_KIND_VC,
- .parse = qemu_chr_parse_vc,
-};
-
static gboolean gd_vc_in(VteTerminal *terminal, gchar *text, guint size,
gpointer user_data)
{
@@ -2353,6 +2348,5 @@ void early_gtk_display_init(int opengl)
#if defined(CONFIG_VTE)
type_register(&char_gd_vc_type_info);
- register_char_driver(&gd_vc_driver);
#endif
}