diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2016-01-12 12:11:14 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2016-03-01 07:51:34 +0100 |
commit | b98d26e33327cf3009be5ead5d6dc8bc0c65dea8 (patch) | |
tree | a532496c11dbf5385c8d1882393cb1cdcca10e71 /ui | |
parent | f2c1d54c186c400ec676ec4d29ea4b8bf440c054 (diff) |
qapi: switch x-input-send-event from console to device+head
Use display device qdev id and head number instead of console index to
specify the QemuConsole. This makes things consistent with input
devices (for input routing) and vnc server configuration, which both use
display and head too.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/input.c | 15 |
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; } } |