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>
This commit is contained in:
Marc-André Lureau 2016-12-09 00:50:12 +03:00
parent 8cddc46990
commit 88cace9f11
8 changed files with 161 additions and 223 deletions

View file

@ -111,6 +111,7 @@ static void char_testdev_class_init(ObjectClass *oc, void *data)
{
ChardevClass *cc = CHARDEV_CLASS(oc);
cc->kind = CHARDEV_BACKEND_KIND_TESTDEV;
cc->chr_write = testdev_chr_write;
}
@ -123,11 +124,6 @@ static const TypeInfo char_testdev_type_info = {
static void register_types(void)
{
static const CharDriver driver = {
.kind = CHARDEV_BACKEND_KIND_TESTDEV,
};
register_char_driver(&driver);
type_register_static(&char_testdev_type_info);
}