summaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2016-12-09 11:04:51 +0300
committerMarc-André Lureau <marcandre.lureau@redhat.com>2017-01-31 13:03:42 +0400
commit0b663b7d77f1a2170fe30a91e3d6de1bb769a378 (patch)
tree25d68b2d6118898621c3c79d30b32c6534865a3a /ui
parent279b066e4c21825c60ea04c4860a1839e1867743 (diff)
char: remove class kind field
The class kind is necessary to lookup the chardev name in qmp_chardev_add() after calling qemu_chr_new_from_opts() and to set the appropriate ChardevBackend (mainly to free the right fields). qemu_chr_new_from_opts() can be changed to use a non-qmp function using the chardev class typename. Introduce qemu_chardev_add() to be called from qemu_chr_new_from_opts() and remove the class chardev kind field. Set the backend->type in the parse callback (when non-common fields are added). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'ui')
-rw-r--r--ui/console.c2
-rw-r--r--ui/gtk.c1
2 files changed, 1 insertions, 2 deletions
diff --git a/ui/console.c b/ui/console.c
index 84fcbd86fd..8c93f2a1e8 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -2148,6 +2148,7 @@ void qemu_chr_parse_vc(QemuOpts *opts, ChardevBackend *backend, Error **errp)
int val;
ChardevVC *vc;
+ backend->type = CHARDEV_BACKEND_KIND_VC;
vc = backend->u.vc.data = g_new0(ChardevVC, 1);
qemu_chr_parse_common(opts, qapi_ChardevVC_base(vc));
@@ -2187,7 +2188,6 @@ 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;
diff --git a/ui/gtk.c b/ui/gtk.c
index f4542e3b86..4984bf3bd9 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -1737,7 +1737,6 @@ 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;