From b98d26e33327cf3009be5ead5d6dc8bc0c65dea8 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Tue, 12 Jan 2016 12:11:14 +0100 Subject: 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 Reviewed-by: Daniel P. Berrange Reviewed-by: Markus Armbruster --- ui/input.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'ui/input.c') 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; } } -- cgit v1.2.3