diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2016-12-09 00:50:12 +0300 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2017-01-31 13:01:47 +0400 |
commit | 88cace9f119b85ac2d40a8b10c24e05ccfa6da07 (patch) | |
tree | 9aa623eb65581a78d3c1d910f2a787990260c1eb /ui/console.c | |
parent | 8cddc46990ab0310af9fb148143326f832802fca (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/console.c')
-rw-r--r-- | ui/console.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/ui/console.c b/ui/console.c index fe03a666f7..84fcbd86fd 100644 --- a/ui/console.c +++ b/ui/console.c @@ -2059,8 +2059,6 @@ static void text_console_do_init(Chardev *chr, DisplayState *ds) qemu_chr_be_generic_open(chr); } -static const CharDriver vc_driver; - static void vc_chr_open(Chardev *chr, ChardevBackend *backend, bool *be_opened, @@ -2189,6 +2187,8 @@ static void char_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 = vc_chr_open; cc->chr_write = vc_chr_write; cc->chr_set_echo = vc_chr_set_echo; @@ -2206,15 +2206,9 @@ void qemu_console_early_init(void) /* set the default vc driver */ if (!object_class_by_name(TYPE_CHARDEV_VC)) { type_register(&char_vc_type_info); - register_char_driver(&vc_driver); } } -static const CharDriver vc_driver = { - .kind = CHARDEV_BACKEND_KIND_VC, - .parse = qemu_chr_parse_vc, -}; - static void register_types(void) { type_register_static(&qemu_console_info); |