From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:46022) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ScAR7-0008QQ-Sk for qemu-devel@nongnu.org; Wed, 06 Jun 2012 03:13:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ScAR5-0001vg-OZ for qemu-devel@nongnu.org; Wed, 06 Jun 2012 03:13:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1382) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ScAR5-0001vJ-Gd for qemu-devel@nongnu.org; Wed, 06 Jun 2012 03:13:43 -0400 Message-ID: <4FCF0323.9070806@redhat.com> Date: Wed, 06 Jun 2012 15:13:39 +0800 From: Amos Kong MIME-Version: 1.0 References: <20a919f7-f1f2-4fdd-b27c-e126364d9040@zmail13.collab.prod.int.phx2.redhat.com> <4FCE2027.5060002@redhat.com> In-Reply-To: <4FCE2027.5060002@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 6/6] qapi: convert sendkey List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org, lcapitulino@redhat.com 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.