chardev: add braille support to qapi

This patch adds 'braille' support to qapi and also switches over
the braille chardev initialization to the new qapi code path.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Gerd Hoffmann 2013-02-21 12:56:10 +01:00
parent f5a51cab2a
commit 2d57286da6
4 changed files with 12 additions and 3 deletions

View File

@ -561,7 +561,7 @@ static void baum_close(struct CharDriverState *chr)
g_free(baum);
}
static CharDriverState *chr_baum_init(QemuOpts *opts)
CharDriverState *chr_baum_init(void)
{
BaumDriverState *baum;
CharDriverState *chr;
@ -627,7 +627,7 @@ fail_handle:
static void register_types(void)
{
register_char_driver("braille", chr_baum_init);
register_char_driver_qapi("braille", CHARDEV_BACKEND_KIND_BRAILLE, NULL);
}
type_init(register_types);

View File

@ -264,4 +264,7 @@ CharDriverState *qemu_char_get_next_serial(void);
/* msmouse */
CharDriverState *qemu_chr_open_msmouse(void);
/* baum.c */
CharDriverState *chr_baum_init(void);
#endif

View File

@ -3211,7 +3211,8 @@
'pty' : 'ChardevDummy',
'null' : 'ChardevDummy',
'mux' : 'ChardevMux',
'msmouse': 'ChardevDummy' } }
'msmouse': 'ChardevDummy',
'braille': 'ChardevDummy' } }
##
# @ChardevReturn:

View File

@ -3722,6 +3722,11 @@ ChardevReturn *qmp_chardev_add(const char *id, ChardevBackend *backend,
case CHARDEV_BACKEND_KIND_MSMOUSE:
chr = qemu_chr_open_msmouse();
break;
#ifdef CONFIG_BRLAPI
case CHARDEV_BACKEND_KIND_BRAILLE:
chr = chr_baum_init();
break;
#endif
default:
error_setg(errp, "unknown chardev backend (%d)", backend->kind);
break;