diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2013-02-21 11:58:44 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2013-03-13 10:27:46 +0100 |
commit | f5a51cab2afd1124f0988081207d506fbec629b4 (patch) | |
tree | 85a7ae86cc9593c49c6935eb4b43513f711ad73e | |
parent | 80dca9e643d11b54f1b9bafbaefeadfb1099e023 (diff) |
chardev: add msmouse support to qapi
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 <kraxel@redhat.com>
-rw-r--r-- | backends/msmouse.c | 4 | ||||
-rw-r--r-- | include/char/char.h | 3 | ||||
-rw-r--r-- | qapi-schema.json | 3 | ||||
-rw-r--r-- | qemu-char.c | 3 |
4 files changed, 10 insertions, 3 deletions
diff --git a/backends/msmouse.c b/backends/msmouse.c index 407ec87784..61052fe783 100644 --- a/backends/msmouse.c +++ b/backends/msmouse.c @@ -63,7 +63,7 @@ static void msmouse_chr_close (struct CharDriverState *chr) g_free (chr); } -static CharDriverState *qemu_chr_open_msmouse(QemuOpts *opts) +CharDriverState *qemu_chr_open_msmouse(void) { CharDriverState *chr; @@ -78,7 +78,7 @@ static CharDriverState *qemu_chr_open_msmouse(QemuOpts *opts) static void register_types(void) { - register_char_driver("msmouse", qemu_chr_open_msmouse); + register_char_driver_qapi("msmouse", CHARDEV_BACKEND_KIND_MSMOUSE, NULL); } type_init(register_types); diff --git a/include/char/char.h b/include/char/char.h index afe002498e..80e8e30e15 100644 --- a/include/char/char.h +++ b/include/char/char.h @@ -261,4 +261,7 @@ size_t qemu_chr_mem_osize(const CharDriverState *chr); CharDriverState *qemu_char_get_next_serial(void); +/* msmouse */ +CharDriverState *qemu_chr_open_msmouse(void); + #endif diff --git a/qapi-schema.json b/qapi-schema.json index 4ad92b07f1..86c04dc9ff 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -3210,7 +3210,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 e6f67d8c5d..e860ba30aa 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -3719,6 +3719,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; |