This patch adds 'msmouse' support to qapi and also switches over the msmouse chardev initialization to the new qapi code path.
Signed-off-by: Gerd Hoffmann <kra...@redhat.com> --- hw/msmouse.c | 2 +- hw/msmouse.h | 2 +- qapi-schema.json | 3 ++- qemu-char.c | 5 ++++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/hw/msmouse.c b/hw/msmouse.c index ef47aed..1e0b84f 100644 --- a/hw/msmouse.c +++ b/hw/msmouse.c @@ -64,7 +64,7 @@ static void msmouse_chr_close (struct CharDriverState *chr) g_free (chr); } -CharDriverState *qemu_chr_open_msmouse(QemuOpts *opts) +CharDriverState *qemu_chr_open_msmouse(void) { CharDriverState *chr; diff --git a/hw/msmouse.h b/hw/msmouse.h index 8cff3a7..a1f1759 100644 --- a/hw/msmouse.h +++ b/hw/msmouse.h @@ -2,6 +2,6 @@ #define HW_MSMOUSE_H 1 /* msmouse.c */ -CharDriverState *qemu_chr_open_msmouse(QemuOpts *opts); +CharDriverState *qemu_chr_open_msmouse(void); #endif diff --git a/qapi-schema.json b/qapi-schema.json index d633e1f..cd93707 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -3160,7 +3160,8 @@ 'socket' : 'ChardevSocket', 'pty' : 'ChardevDummy', 'null' : 'ChardevDummy', - 'mux' : 'ChardevMux' } } + 'mux' : 'ChardevMux', + 'msmouse': 'ChardevDummy' } } ## # @ChardevReturn: diff --git a/qemu-char.c b/qemu-char.c index ec49fb7..c824ed8 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -2983,7 +2983,7 @@ static const struct { { .name = "null", .kind = CHARDEV_BACKEND_KIND_NULL }, { .name = "socket", .open = qemu_chr_open_socket }, { .name = "udp", .open = qemu_chr_open_udp }, - { .name = "msmouse", .open = qemu_chr_open_msmouse }, + { .name = "msmouse", .kind = CHARDEV_BACKEND_KIND_MSMOUSE }, { .name = "vc", .open = vc_init }, { .name = "memory", .open = qemu_chr_open_ringbuf }, #ifdef _WIN32 @@ -3477,6 +3477,9 @@ ChardevReturn *qmp_chardev_add(const char *id, ChardevBackend *backend, } chr = qemu_chr_open_mux(base); break; + case CHARDEV_BACKEND_KIND_MSMOUSE: + chr = qemu_chr_open_msmouse(); + break; default: error_setg(errp, "unknown chardev backend (%d)", backend->kind); break; -- 1.7.9.7