From 96d885b93b47243d2fc6ee826abaa8c0017282c9 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Tue, 29 Sep 2015 15:29:15 +0200 Subject: qemu-char: convert msmouse backend to data-driven creation Reviewed-by: Eric Blake Signed-off-by: Paolo Bonzini --- backends/msmouse.c | 7 +++++-- include/sysemu/char.h | 3 --- qemu-char.c | 2 +- stubs/Makefile.objs | 1 - stubs/chr-msmouse.c | 7 ------- 5 files changed, 6 insertions(+), 14 deletions(-) delete mode 100644 stubs/chr-msmouse.c diff --git a/backends/msmouse.c b/backends/msmouse.c index d50ed479a5..0126fa0b13 100644 --- a/backends/msmouse.c +++ b/backends/msmouse.c @@ -63,7 +63,10 @@ static void msmouse_chr_close (struct CharDriverState *chr) g_free (chr); } -CharDriverState *qemu_chr_open_msmouse(void) +static CharDriverState *qemu_chr_open_msmouse(const char *id, + ChardevBackend *backend, + ChardevReturn *ret, + Error **errp) { CharDriverState *chr; @@ -80,7 +83,7 @@ CharDriverState *qemu_chr_open_msmouse(void) static void register_types(void) { register_char_driver("msmouse", CHARDEV_BACKEND_KIND_MSMOUSE, NULL, - NULL); + qemu_chr_open_msmouse); } type_init(register_types); diff --git a/include/sysemu/char.h b/include/sysemu/char.h index 4b01a8c26a..2fe827551c 100644 --- a/include/sysemu/char.h +++ b/include/sysemu/char.h @@ -356,9 +356,6 @@ extern int term_escape_char; CharDriverState *qemu_char_get_next_serial(void); -/* msmouse */ -CharDriverState *qemu_chr_open_msmouse(void); - /* testdev.c */ CharDriverState *chr_testdev_init(void); diff --git a/qemu-char.c b/qemu-char.c index 6f2202a3f9..64ca39761d 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -4312,7 +4312,7 @@ ChardevReturn *qmp_chardev_add(const char *id, ChardevBackend *backend, abort(); break; case CHARDEV_BACKEND_KIND_MSMOUSE: - chr = qemu_chr_open_msmouse(); + abort(); break; #ifdef CONFIG_BRLAPI case CHARDEV_BACKEND_KIND_BRAILLE: diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs index 85e4e81017..63988ca75e 100644 --- a/stubs/Makefile.objs +++ b/stubs/Makefile.objs @@ -1,7 +1,6 @@ stub-obj-y += arch-query-cpu-def.o stub-obj-y += bdrv-commit-all.o stub-obj-y += chr-baum-init.o -stub-obj-y += chr-msmouse.o stub-obj-y += chr-testdev.o stub-obj-y += clock-warp.o stub-obj-y += cpu-get-clock.o diff --git a/stubs/chr-msmouse.c b/stubs/chr-msmouse.c deleted file mode 100644 index 812f8b0abe..0000000000 --- a/stubs/chr-msmouse.c +++ /dev/null @@ -1,7 +0,0 @@ -#include "qemu-common.h" -#include "sysemu/char.h" - -CharDriverState *qemu_chr_open_msmouse(void) -{ - return 0; -} -- cgit v1.2.3