aboutsummaryrefslogtreecommitdiff
path: root/hmp.c
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2011-09-21 15:29:55 -0300
committerLuiz Capitulino <lcapitulino@redhat.com>2011-10-27 11:48:46 -0200
commite235cec3762d2aa20b548114ea7b172113690463 (patch)
treea7eda7c51ade1d852efe097431676d822c48bded /hmp.c
parent694a099a542563f40116743c963066ce142a7755 (diff)
qapi: Convert query-mice
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'hmp.c')
-rw-r--r--hmp.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/hmp.c b/hmp.c
index 34416fc3c7..9c6d8966bf 100644
--- a/hmp.c
+++ b/hmp.c
@@ -94,6 +94,26 @@ void hmp_info_chardev(Monitor *mon)
qapi_free_ChardevInfoList(char_info);
}
+void hmp_info_mice(Monitor *mon)
+{
+ MouseInfoList *mice_list, *mouse;
+
+ mice_list = qmp_query_mice(NULL);
+ if (!mice_list) {
+ monitor_printf(mon, "No mouse devices connected\n");
+ return;
+ }
+
+ for (mouse = mice_list; mouse; mouse = mouse->next) {
+ monitor_printf(mon, "%c Mouse #%" PRId64 ": %s%s\n",
+ mouse->value->current ? '*' : ' ',
+ mouse->value->index, mouse->value->name,
+ mouse->value->absolute ? " (absolute)" : "");
+ }
+
+ qapi_free_MouseInfoList(mice_list);
+}
+
void hmp_quit(Monitor *mon, const QDict *qdict)
{
monitor_suspend(mon);