qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 6/6] qapi: convert sendkey


From: Amos Kong
Subject: Re: [Qemu-devel] [PATCH v2 6/6] qapi: convert sendkey
Date: Wed, 06 Jun 2012 15:13:39 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110930 Thunderbird/7.0.1

On 05/06/12 23:05, Eric Blake wrote:
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?

In old do_sendkey(), only key-name and hexadecimal were supported,
the description needs to be fixed.


  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,

It seems we can only support key-name for QMP, and support key-name/hexadecimal
for HMP. Is it acceptable?


 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.


--
                        Amos.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]