Skip to content
  • Luiz Capitulino's avatar
    qmp: qmp_send_key(): accept key codes in hex · 9f328977
    Luiz Capitulino authored
    
    
    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: default avatarAvi Kivity <avi@redhat.com>
    Signed-off-by: default avatarLuiz Capitulino <lcapitulino@redhat.com>
    Reviewed-by: default avatarEric Blake <eblake@redhat.com>
    Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
    9f328977