From: Luiz Capitulino <lcapitulino@redhat.com>
To: Amos Kong <akong@redhat.com>
Cc: aliguori@us.ibm.com, Eric Blake <eblake@redhat.com>,
qemu-devel@nongnu.org, Jeffrey Cody <jcody@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 3/3] qapi: convert sendkey
Date: Fri, 25 May 2012 10:00:54 -0300 [thread overview]
Message-ID: <20120525100054.753cb4de@doriath.home> (raw)
In-Reply-To: <4FBF24B1.8080803@redhat.com>
On Fri, 25 May 2012 14:20:33 +0800
Amos Kong <akong@redhat.com> 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<akong@redhat.com>
> >
> >> +##
> >> +# @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?
I agree it's better.
> > { "execute":"sendkey", "data":{ "keys":["ctrl", "alt", "del"],
> > "hold-time":200 } }
>
> How to make it compatible with hum command? Still use 'ctrl-alt-delete'
> for hum, separate keys and generate an array in hum_sendkey() before
> calling qmp_sendkey()?
Yes. Basically, you'll move the parsing code to hmp_sendkey() and build
a QList to be passed to qmp_sendkey(). You can take a look at
tests/check-qlist.c for examples on how to work with qlists.
> And I'm know clear about how to define command in qapi-schema.json,
> I didn't find exist example, any clue?
>
> { 'command': 'sendkey', 'data': { 'keys': [ 'str'], '*hold-time':
> 'int'} }
> --
> { 'type': 'Key', 'data': {'name': 'str'} }
> { 'command': 'sendkey', 'data': { 'keys': [ 'Key' ], '*hold-time':
> 'int'} }
Jeff, didn't you implement this?
next prev parent reply other threads:[~2012-05-25 13:00 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-25 3:31 [Qemu-devel] [PATCH 1/3] qerror: add QERR_TOO_MANY_PARAMETERS Amos Kong
2012-05-25 3:32 ` [Qemu-devel] [PATCH 2/3] fix doc of using raw values with sendkey Amos Kong
2012-05-25 3:32 ` [Qemu-devel] [PATCH 3/3] qapi: convert sendkey Amos Kong
2012-05-25 3:51 ` Eric Blake
2012-05-25 6:20 ` Amos Kong
2012-05-25 7:34 ` Daniel P. Berrange
2012-05-25 12:18 ` Markus Armbruster
2012-05-25 13:06 ` Luiz Capitulino
2012-05-25 13:12 ` Daniel P. Berrange
2012-05-25 13:15 ` Luiz Capitulino
2012-05-25 13:16 ` Anthony Liguori
2012-05-25 13:00 ` Luiz Capitulino [this message]
2012-05-25 14:23 ` Jeff Cody
2012-05-25 13:14 ` Anthony Liguori
2012-05-25 14:35 ` Luiz Capitulino
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120525100054.753cb4de@doriath.home \
--to=lcapitulino@redhat.com \
--cc=akong@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=eblake@redhat.com \
--cc=jcody@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).