« Previous | Next » 

Revision 9f328977

ID9f32897768064841fe9a99145c9d15ab6667ffed

Added by Luiz Capitulino over 11 years ago

qmp: qmp_send_key(): accept key codes in hex

Before the qapi conversion, the sendkey command could be used to
send key codes in hex directly to the guest. In HMP, this would
be like:

(qemu) sendkey 0xdc

However, the qapi conversion broke this, as it only supports sending
QKeyCode values to the guest. That's a regression.

This commit fixes the problem by adding hex value support down
the QMP interface, qmp_send_key().

In more detail, this commit:

1. Adds the KeyValue union. This can represent an hex value or
a QKeyCode value
2. Changes the QMP send-key command to take an KeyValue argument
instead of a QKeyCode one
3. Adapt hmp_send_key() to the QMP interface changes

Item 2 is an incompatible change, but as we're in development phase
(and this command has been merged a few weeks ago) this shouldn't be
a problem.

Finally, it's not possible to split this commit without breaking the
build.

Reported-by: Avi Kivity <>
Signed-off-by: Luiz Capitulino <>
Reviewed-by: Eric Blake <>
Reviewed-by: Markus Armbruster <>

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences