mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 07:13:54 -06:00
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>
This commit is contained in:
parent
f2c1d54c18
commit
b98d26e333
3 changed files with 36 additions and 28 deletions
15
ui/input.c
15
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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue