Received: from eggs.gnu.org ([208.118.235.92]:59916) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXtTk-0002Zf-QP for qemu-devel@nongnu.org; Fri, 25 May 2012 08:18:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SXtTe-0003wG-JQ for qemu-devel@nongnu.org; Fri, 25 May 2012 08:18:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37936) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXtTe-0003w7-Bd for qemu-devel@nongnu.org; Fri, 25 May 2012 08:18:42 -0400 From: Markus Armbruster References: <1337916721-14308-1-git-send-email-akong@redhat.com> <1337916721-14308-3-git-send-email-akong@redhat.com> <4FBF01AE.5000007@redhat.com> <4FBF24B1.8080803@redhat.com> <20120525073454.GC11895@redhat.com> Date: Fri, 25 May 2012 14:18:38 +0200 In-Reply-To: <20120525073454.GC11895@redhat.com> (Daniel P. Berrange's message of "Fri, 25 May 2012 08:34:54 +0100") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [PATCH 3/3] qapi: convert sendkey List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" Cc: aliguori@us.ibm.com, Amos Kong , Eric Blake , qemu-devel@nongnu.org, lcapitulino@redhat.com "Daniel P. Berrange" writes: > On Fri, May 25, 2012 at 02:20:33PM +0800, Amos Kong wrote: >> On 25/05/12 11:51, Eric Blake wrote: >> >On 05/24/2012 09:32 PM, Amos Kong wrote: >> >>Convert 'sendkey' to use. do_sendkey() depends on some variables >> >>in monitor.c, so reserve qmp_sendkey() to monitor.c >> >>Rename 'string' to 'keys', rename 'hold_time' to 'hold-time' >> >> >> >>Signed-off-by: Amos Kong >> > >> >>+## >> >>+# @sendkey: >> >>+# >> >>+# Send keys to VM. >> >>+# >> >>+# @keys: key sequence >> >>+# @hold-time: time to delay key up events >> >>+# >> >>+# Returns: Nothing on success >> >>+# If key is unknown or redundant, QERR_INVALID_PARAMETER >> >>+# If key is invalid, QERR_INVALID_PARAMETER_VALUE >> >>+# >> >>+# Notes: Send @var{keys} to the emulator. @var{keys} could be the name of the >> >>+# key or the raw value in either decimal or hexadecimal format. Use >> >>+# @code{-} to press several keys simultaneously. >> >>+# >> >>+# Since: 0.14.0 >> >>+## >> >>+{ 'command': 'sendkey', 'data': {'keys': 'str', '*hold-time': 'int'} } >> > >> >Rather than making 'keys' a free-form string where qemu then has to >> >parse '-' to separate keys, should we instead make it a JSON array? For >> >example, >> >> >> Anthony, Luiz, Daniel, what's your opinion? > > Using a JSON array for the key names does seem like the most > natural way to model this. A good rule of thumb is that the > implementation of a command should not need to further > parse the individual parameter values. Using a magic string > encoding instead of the JSON array requires such extra special > case parsing. We've followed this rule in QMP so far.