Skip to content

Commit

Permalink
chardev: add msmouse support to qapi
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
kraxel committed Mar 13, 2013
1 parent 80dca9e commit f5a51ca
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions backends/msmouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);
3 changes: 3 additions & 0 deletions include/char/char.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion qapi-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3210,7 +3210,8 @@
'socket' : 'ChardevSocket',
'pty' : 'ChardevDummy',
'null' : 'ChardevDummy',
'mux' : 'ChardevMux' } }
'mux' : 'ChardevMux',
'msmouse': 'ChardevDummy' } }

##
# @ChardevReturn:
Expand Down
3 changes: 3 additions & 0 deletions qemu-char.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f5a51ca

Please sign in to comment.