aboutsummaryrefslogtreecommitdiff
path: root/ui/input.c
diff options
context:
space:
mode:
Diffstat (limited to 'ui/input.c')
-rw-r--r--ui/input.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/ui/input.c b/ui/input.c
index fce99bab40..0887bb54ca 100644
--- a/ui/input.c
+++ b/ui/input.c
@@ -119,17 +119,22 @@ qemu_input_find_handler(uint32_t mask, QemuConsole *con)
return NULL;
}
-void qmp_x_input_send_event(bool has_console, int64_t console,
+void qmp_x_input_send_event(bool has_device, const char *device,
+ bool has_head, int64_t head,
InputEventList *events, Error **errp)
{
InputEventList *e;
QemuConsole *con;
+ Error *err = NULL;
con = NULL;
- if (has_console) {
- con = qemu_console_lookup_by_index(console);
- if (!con) {
- error_setg(errp, "console %" PRId64 " not found", console);
+ if (has_device) {
+ if (!has_head) {
+ head = 0;
+ }
+ con = qemu_console_lookup_by_device_name(device, head, &err);
+ if (err) {
+ error_propagate(errp, err);
return;
}
}