mirror of
https://github.com/mii443/qemu.git
synced 2025-08-23 15:48:20 +00:00
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:
@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user