diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2014-11-13 11:52:11 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2014-11-13 11:52:11 +0000 |
commit | e08d3004506e39cf25b3e1fa01f69bd1934d2846 (patch) | |
tree | 520c6b6ac0aad3a651c91661b82035003ae712f3 /ui/input.c | |
parent | 410bd787bf44ef95192507802967a0edce19955f (diff) | |
parent | 51fc44768a5b71ad78fa40e609a58f71ed62775a (diff) |
Merge remote-tracking branch 'remotes/kraxel/tags/pull-input-20141113-1' into staging
QMP/input-send-event: make console parameter optional
# gpg: Signature made Thu 13 Nov 2014 10:07:26 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-20141113-1:
QMP/input-send-event: make console parameter optional
QMP/input-send-event: update document of union InputEvent
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'ui/input.c')
-rw-r--r-- | ui/input.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/ui/input.c b/ui/input.c index 002831ee72..37ff46fc55 100644 --- a/ui/input.c +++ b/ui/input.c @@ -122,16 +122,19 @@ qemu_input_find_handler(uint32_t mask, QemuConsole *con) return NULL; } -void qmp_input_send_event(int64_t console, InputEventList *events, - Error **errp) +void qmp_input_send_event(bool has_console, int64_t console, + InputEventList *events, Error **errp) { InputEventList *e; QemuConsole *con; - con = qemu_console_lookup_by_index(console); - if (!con) { - error_setg(errp, "console %" PRId64 " not found", console); - return; + con = NULL; + if (has_console) { + con = qemu_console_lookup_by_index(console); + if (!con) { + error_setg(errp, "console %" PRId64 " not found", console); + return; + } } if (!runstate_is_running() && !runstate_check(RUN_STATE_SUSPENDED)) { |