From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33456) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbvJx-0007CR-LE for qemu-devel@nongnu.org; Tue, 05 Jun 2012 11:05:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SbvJs-0001DX-I0 for qemu-devel@nongnu.org; Tue, 05 Jun 2012 11:05:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:15865) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbvJs-0001D8-9H for qemu-devel@nongnu.org; Tue, 05 Jun 2012 11:05:16 -0400 Message-ID: <4FCE2027.5060002@redhat.com> Date: Tue, 05 Jun 2012 09:05:11 -0600 From: Eric Blake MIME-Version: 1.0 References: <20a919f7-f1f2-4fdd-b27c-e126364d9040@zmail13.collab.prod.int.phx2.redhat.com> In-Reply-To: <20a919f7-f1f2-4fdd-b27c-e126364d9040@zmail13.collab.prod.int.phx2.redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig15C2F567CE6015C17E90013A" Subject: Re: [Qemu-devel] [PATCH v2 6/6] qapi: convert sendkey List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amos Kong Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org, lcapitulino@redhat.com This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig15C2F567CE6015C17E90013A Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 forma= t. 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. >=20 >=20 > # 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. >=20 >=20 >=20 > 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 =2E.. 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. --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enig15C2F567CE6015C17E90013A Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJPziAnAAoJEKeha0olJ0NqKPYH/35+9ZCVOhi91+oyc8/rpyeI t8teGFReckdgvEwyM0wn/0DVE4TSHLrP+bGf9/8dtfMIU5l2jJytWOm/7eV2zf75 Y5D0ZfN9cysmtdrxqZs6iKU8BB6OvrOB271kL7qQHsYDgDJ9+k6Y8xonXLQ3mMiL OpsHl0lP9/qOGUVZqJH70HRT6O+0hL+cZsLdQvE9YClgCAojk7pyUTrSoZ+Qha/9 vVmuJImL/JdMpu5e1GB6KVvzJosAT6Txp0fu5ncouqw/T3dGrjyhv+NjEdvRcwha awMIMyFhnMAbSpNw6dsuf2fcHsy7z+4EqDjJ87sJbMyTQ01NWDOuPLx/qEnH/q0= =Jt3B -----END PGP SIGNATURE----- --------------enig15C2F567CE6015C17E90013A--