aboutsummaryrefslogtreecommitdiff
path: root/ui/gtk.c
diff options
context:
space:
mode:
Diffstat (limited to 'ui/gtk.c')
-rw-r--r--ui/gtk.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/ui/gtk.c b/ui/gtk.c
index 86368e38b7..608400b56d 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -1703,6 +1703,12 @@ static CharDriverState *vcs[MAX_VCS];
static CharDriverState *gd_vc_handler(ChardevVC *vc, Error **errp)
{
+ static const CharDriver gd_vc_driver = {
+ .kind = CHARDEV_BACKEND_KIND_VC,
+ .chr_write = gd_vc_chr_write,
+ .chr_set_echo = gd_vc_chr_set_echo,
+ };
+
ChardevCommon *common = qapi_ChardevVC_base(vc);
CharDriverState *chr;
@@ -1711,14 +1717,11 @@ static CharDriverState *gd_vc_handler(ChardevVC *vc, Error **errp)
return NULL;
}
- chr = qemu_chr_alloc(common, errp);
+ chr = qemu_chr_alloc(&gd_vc_driver, common, errp);
if (!chr) {
return NULL;
}
- chr->chr_write = gd_vc_chr_write;
- chr->chr_set_echo = gd_vc_chr_set_echo;
-
/* Temporary, until gd_vc_vte_init runs. */
chr->opaque = g_new0(VirtualConsole, 1);