diff options
| author | Peter Maydell <peter.maydell@linaro.org> | 2016-03-01 11:15:00 +0000 |
|---|---|---|
| committer | Peter Maydell <peter.maydell@linaro.org> | 2016-03-01 11:15:00 +0000 |
| commit | 0b85d735831d69ff4ba776e7067ef2e285b234cf (patch) | |
| tree | 4c6ab9473a345766c3e6fe3f8742426a80c5242f /ui/input.c | |
| parent | d9c7737e57d1c5d8505d09b2803ca140875c9657 (diff) | |
| parent | 6575ccddf4e7c2484bc14b10d5e89f57506c3953 (diff) | |
| download | focaccia-qemu-0b85d735831d69ff4ba776e7067ef2e285b234cf.tar.gz focaccia-qemu-0b85d735831d69ff4ba776e7067ef2e285b234cf.zip | |
Merge remote-tracking branch 'remotes/kraxel/tags/pull-input-20160301-1' into staging
qapi: fix input-send-event and promote to stable # gpg: Signature made Tue 01 Mar 2016 08:19:52 GMT using RSA key ID D3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" * remotes/kraxel/tags/pull-input-20160301-1: qapi: promote input-send-event to stable qapi: rename InputAxis values. qapi: rename input buttons qapi: switch x-input-send-event from console to device+head console: add & use qemu_console_lookup_by_device_name Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'ui/input.c')
| -rw-r--r-- | ui/input.c | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/ui/input.c b/ui/input.c index bdcb974a89..6fd48efb57 100644 --- a/ui/input.c +++ b/ui/input.c @@ -82,19 +82,12 @@ void qemu_input_handler_bind(QemuInputHandlerState *s, const char *device_id, int head, Error **errp) { - DeviceState *dev; QemuConsole *con; + Error *err = NULL; - dev = qdev_find_recursive(sysbus_get_default(), device_id); - if (dev == NULL) { - error_set(errp, ERROR_CLASS_DEVICE_NOT_FOUND, - "Device '%s' not found", device_id); - return; - } - - con = qemu_console_lookup_by_device(dev, head); - if (con == NULL) { - error_setg(errp, "Device %s is not bound to a QemuConsole", device_id); + con = qemu_console_lookup_by_device_name(device_id, head, &err); + if (err) { + error_propagate(errp, err); return; } @@ -126,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, - InputEventList *events, Error **errp) +void qmp_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; } } |