qemu-char: add create to register_char_driver

Having creation as a member of the CharDriver struct removes the need
to export functions for qemu-char.c's usage.  After the conversion,
chardev backends implemented outside qemu-char.c will not need a stub
creation function anymore.

Ultimately all drivers will be converted.  For now, support the case
where cd->create == NULL.

Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Paolo Bonzini 2015-09-29 14:55:59 +02:00
parent d809ab9521
commit 4ca172817a
7 changed files with 142 additions and 109 deletions

View file

@ -629,7 +629,8 @@ fail_handle:
static void register_types(void)
{
register_char_driver("braille", CHARDEV_BACKEND_KIND_BRAILLE, NULL);
register_char_driver("braille", CHARDEV_BACKEND_KIND_BRAILLE, NULL,
NULL);
}
type_init(register_types);

View file

@ -79,7 +79,8 @@ CharDriverState *qemu_chr_open_msmouse(void)
static void register_types(void)
{
register_char_driver("msmouse", CHARDEV_BACKEND_KIND_MSMOUSE, NULL);
register_char_driver("msmouse", CHARDEV_BACKEND_KIND_MSMOUSE, NULL,
NULL);
}
type_init(register_types);

View file

@ -125,7 +125,8 @@ CharDriverState *chr_testdev_init(void)
static void register_types(void)
{
register_char_driver("testdev", CHARDEV_BACKEND_KIND_TESTDEV, NULL);
register_char_driver("testdev", CHARDEV_BACKEND_KIND_TESTDEV, NULL,
NULL);
}
type_init(register_types);