[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 6/6] qapi: convert sendkey
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v2 6/6] qapi: convert sendkey |
Date: |
Tue, 05 Jun 2012 09:05:11 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 |
On 06/05/2012 08:55 AM, Amos Kong wrote:
>>> +# @sendkey:
>>> +#
>>> +# Send keys to VM.
>>> +#
>>> +# @keys: key sequence
>>> +# @hold-time: time to delay key up events, milliseconds
>>> +#
>>> +# Returns: Nothing on success
>>> +# If key is unknown or redundant, QERR_INVALID_PARAMETER
>>> +# If keys number is over the limitation, QERR_OVERFLOW
>>> +#
>>> +# Notes: Send keys to the emulator. Keys could be the name of the
>>> +# key or the raw value in either decimal or hexadecimal format. Use
>>> +# "-" to press several keys simultaneously.
>>
>> These notes don't really correspond to the QMP interface of passing
>> in a JSON array of simultaneous keys to press.
>
>
> # Notes: Send keys to the emulator. Keys could be the name of the
> # key or the raw value in either decimal or hexadecimal format. Use
> # a JSON array to press several keys simultaneously.
>
>
>
> Ho, I found another bug in my code, key in decimal or hexadecimal
> format is not supported. I will fix it.
How do you plan to support decimal in QMP? I don't think it's possible,
at least not without still keeping a JSON array of keys to press. On
the other hand, I'm not sure if we need to worry about that. Let me
explain:
Let's suppose the QMP interface is symbolic only.
In the HMP interface, _you_ can use the lookup list to convert decimal
to key name, so that the HMP interface is a wrapper around the QMP
interface, but everything is symbolic by the time we get that far.
In the libvirt case, where libvirt talks directly to QMP, libvirt also
has the same table for looking up keysyms vs. values (in fact, libvirt
already uses that table to convert between different keysets, so for an
example, the libvirt user can specify a command using xt_kbd or usb or
... mappings, which libvirt then converts into the mapping desired by
qemu). Since libvirt already consults a table, libvirt can ensure that
the table has the proper QMP symbolic names in that table.
Finally, I know there was a patch proposed by Dan Berrange a while back
to let both libvirt and qemu share a common database of keyset names and
corresponding integer mappings. I don't remember if it was applied to
qemu; if not, it should be revived and used at this time.
--
Eric Blake address@hidden +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-devel] [PATCH v2 5/6] qapi: generate list struct and visit_list for enum, (continued)
Re: [Qemu-devel] [PATCH v2 5/6] qapi: generate list struct and visit_list for enum, Michael Roth, 2012/06/06
[Qemu-devel] [PATCH v2 6/6] qapi: convert sendkey, Amos Kong, 2012/06/01
- Re: [Qemu-devel] [PATCH v2 6/6] qapi: convert sendkey, Eric Blake, 2012/06/04
- Re: [Qemu-devel] [PATCH v2 6/6] qapi: convert sendkey, Amos Kong, 2012/06/05
- Re: [Qemu-devel] [PATCH v2 6/6] qapi: convert sendkey,
Eric Blake <=
- Re: [Qemu-devel] [PATCH v2 6/6] qapi: convert sendkey, Amos Kong, 2012/06/06
- Re: [Qemu-devel] [PATCH v2 6/6] qapi: convert sendkey, Eric Blake, 2012/06/06
- Re: [Qemu-devel] [PATCH v2 6/6] qapi: convert sendkey, Anthony Liguori, 2012/06/07
- Re: [Qemu-devel] [PATCH v2 6/6] qapi: convert sendkey, Eric Blake, 2012/06/07
Re: [Qemu-devel] [PATCH v2 0/6] convert sendkey to qapi, Amos Kong, 2012/06/01