QMP/input-send-event: make console parameter optional
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAABAgAGBQJUZILeAAoJEEy22O7T6HE4GEUP/ifgp2zb7u/92UEBRcHFk08s fway1QJg/3aWCropLAh1ns+thh1XKn1Q6xOkyqdM2v+C7bsqcd94Dyw3Gha6R96I yIbkqggkjyRdE24A4fY/xBuERNWK3Sf2bNk+lCgLzCQSpCl615NBiqhT1+TY0AIE rvCBB7MzmAjMKY6P/FxjrwV1E40vZ3fJUwroDx5ZrHx3CAG9n5I05nGe8JZxZP16 SE0RfStzP8B9z5/sZmxsURZ3ZaeXBmbBEU+9OtcRxbkiCE53gvhFXXKuqGIjnO+i D7FTipts7AJ1ggQj8SDSUc6oILWDiLhqPQMPwYrRRZhFEUN4zY44izYwe+yGURC1 Sv6TkNRv/jqsQAW6Vo9cd++f/knWqs1JeTWzzH/j0PaX5egfdvjXzxK3I2p7Y2IC z9r/cfIKi0Piei3V+b885V8SCmkudLgnrfcfR5G06ZLWCCcUlNSCgB2P7PkAyUzT sPEJaDFwSUOLW//1h53j1/si6/WE65lYWp/K+4TS1bq9/OeM0xY4PMaIgkapk0no 4oed7wlJqozYDs+33HM/mIc+gIx/E9VAWNgoJ+6JyK7gAi4MU421f1IvPtZ57w8u G48nITYQrpkPoaBru3ApptIRydgwQf22yzMIgA/c4lMC3FWUKfpYOxrkvy5PRnCZ beinmgQt8r5kJCkbeqrs =l7/I -----END PGP SIGNATURE----- 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>
This commit is contained in:
commit
e08d300450
@ -3231,6 +3231,11 @@
|
|||||||
#
|
#
|
||||||
# Input event union.
|
# Input event union.
|
||||||
#
|
#
|
||||||
|
# @key: Input event of Keyboard
|
||||||
|
# @btn: Input event of pointer buttons
|
||||||
|
# @rel: Input event of relative pointer motion
|
||||||
|
# @abs: Input event of absolute pointer motion
|
||||||
|
#
|
||||||
# Since: 2.0
|
# Since: 2.0
|
||||||
##
|
##
|
||||||
{ 'union' : 'InputEvent',
|
{ 'union' : 'InputEvent',
|
||||||
@ -3244,7 +3249,7 @@
|
|||||||
#
|
#
|
||||||
# Send input event(s) to guest.
|
# Send input event(s) to guest.
|
||||||
#
|
#
|
||||||
# @console: Which console to send event(s) to.
|
# @console: #optional console to send event(s) to.
|
||||||
#
|
#
|
||||||
# @events: List of InputEvent union.
|
# @events: List of InputEvent union.
|
||||||
#
|
#
|
||||||
@ -3254,7 +3259,7 @@
|
|||||||
#
|
#
|
||||||
##
|
##
|
||||||
{ 'command': 'input-send-event',
|
{ 'command': 'input-send-event',
|
||||||
'data': { 'console':'int', 'events': [ 'InputEvent' ] } }
|
'data': { '*console':'int', 'events': [ 'InputEvent' ] } }
|
||||||
|
|
||||||
##
|
##
|
||||||
# @NumaOptions
|
# @NumaOptions
|
||||||
|
@ -3792,7 +3792,7 @@ EQMP
|
|||||||
|
|
||||||
{
|
{
|
||||||
.name = "input-send-event",
|
.name = "input-send-event",
|
||||||
.args_type = "console:i,events:q",
|
.args_type = "console:i?,events:q",
|
||||||
.mhandler.cmd_new = qmp_marshal_input_input_send_event,
|
.mhandler.cmd_new = qmp_marshal_input_input_send_event,
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -3804,7 +3804,7 @@ Send input event to guest.
|
|||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
|
|
||||||
- "console": console index.
|
- "console": console index. (json-int, optional)
|
||||||
- "events": list of input events.
|
- "events": list of input events.
|
||||||
|
|
||||||
The consoles are visible in the qom tree, under
|
The consoles are visible in the qom tree, under
|
||||||
|
@ -122,17 +122,20 @@ qemu_input_find_handler(uint32_t mask, QemuConsole *con)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void qmp_input_send_event(int64_t console, InputEventList *events,
|
void qmp_input_send_event(bool has_console, int64_t console,
|
||||||
Error **errp)
|
InputEventList *events, Error **errp)
|
||||||
{
|
{
|
||||||
InputEventList *e;
|
InputEventList *e;
|
||||||
QemuConsole *con;
|
QemuConsole *con;
|
||||||
|
|
||||||
|
con = NULL;
|
||||||
|
if (has_console) {
|
||||||
con = qemu_console_lookup_by_index(console);
|
con = qemu_console_lookup_by_index(console);
|
||||||
if (!con) {
|
if (!con) {
|
||||||
error_setg(errp, "console %" PRId64 " not found", console);
|
error_setg(errp, "console %" PRId64 " not found", console);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!runstate_is_running() && !runstate_check(RUN_STATE_SUSPENDED)) {
|
if (!runstate_is_running() && !runstate_check(RUN_STATE_SUSPENDED)) {
|
||||||
error_setg(errp, "VM not running");
|
error_setg(errp, "VM not running");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user