qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: qemu-devel@nongnu.org
Cc: armbru@redhat.com, kraxel@redhat.com
Subject: [Qemu-devel] [PATCH for-2.5 2/2] input: Promote 'input-send-event' to stable API
Date: Wed, 11 Nov 2015 14:57:08 -0700	[thread overview]
Message-ID: <1447279028-2114-3-git-send-email-eblake@redhat.com> (raw)
In-Reply-To: <1447279028-2114-1-git-send-email-eblake@redhat.com>

We've had 'x-input-send-event' since 2.3, with no further
changes to the interface other than tweaks in the previous patch
to the spelling of the enum constants ('X' and 'WheelUp' changed
to 'x' and 'wheel-up').

What's more, changing the spelling of enum constants is not easy
to introspect prior to 2.5; so a client that was relying on the
experimental command can't easily tell which spelling is expected.
But 'query-commands' works in all qemu versions that supported
the command, so renaming the command now makes it an easy thing
to determine which spelling of the enum values to use.

Thus, it's time to promote this interface to stable.

CC: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
---
 qapi-schema.json |  8 +++-----
 qmp-commands.hx  | 16 +++++++---------
 ui/input.c       |  4 ++--
 3 files changed, 12 insertions(+), 16 deletions(-)

diff --git a/qapi-schema.json b/qapi-schema.json
index ecefb17..f99d413 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -3605,7 +3605,7 @@
               'abs'     : 'InputMoveEvent' } }

 ##
-# @x-input-send-event
+# @input-send-event
 #
 # Send input event(s) to guest.
 #
@@ -3627,12 +3627,10 @@
 #
 # Returns: Nothing on success.
 #
-# Since: 2.2
-#
-# Note: this command is experimental, and not a stable API.
+# Since: 2.5
 #
 ##
-{ 'command': 'x-input-send-event',
+{ 'command': 'input-send-event',
   'data': { '*console':'int', 'events': [ 'InputEvent' ] } }

 ##
diff --git a/qmp-commands.hx b/qmp-commands.hx
index 8f25fe0..cde7505 100644
--- a/qmp-commands.hx
+++ b/qmp-commands.hx
@@ -4475,13 +4475,13 @@ Example:
 EQMP

     {
-        .name       = "x-input-send-event",
+        .name       = "input-send-event",
         .args_type  = "console:i?,events:q",
-        .mhandler.cmd_new = qmp_marshal_x_input_send_event,
+        .mhandler.cmd_new = qmp_marshal_input_send_event,
     },

 SQMP
-@x-input-send-event
+@input-send-event
 -----------------

 Send input event to guest.
@@ -4495,19 +4495,17 @@ The consoles are visible in the qom tree, under
 /backend/console[$index]. They have a device link and head property, so
 it is possible to map which console belongs to which device and display.

-Note: this command is experimental, and not a stable API.
-
 Example (1):

 Press left mouse button.

--> { "execute": "x-input-send-event",
+-> { "execute": "input-send-event",
     "arguments": { "console": 0,
                    "events": [ { "type": "btn",
                     "data" : { "down": true, "button": "left" } } ] } }
 <- { "return": {} }

--> { "execute": "x-input-send-event",
+-> { "execute": "input-send-event",
     "arguments": { "console": 0,
                    "events": [ { "type": "btn",
                     "data" : { "down": false, "button": "left" } } ] } }
@@ -4517,7 +4515,7 @@ Example (2):

 Press ctrl-alt-del.

--> { "execute": "x-input-send-event",
+-> { "execute": "input-send-event",
      "arguments": { "console": 0, "events": [
         { "type": "key", "data" : { "down": true,
           "key": {"type": "qcode", "data": "ctrl" } } },
@@ -4531,7 +4529,7 @@ Example (3):

 Move mouse pointer to absolute coordinates (20000, 400).

--> { "execute": "x-input-send-event" ,
+-> { "execute": "input-send-event" ,
   "arguments": { "console": 0, "events": [
                { "type": "abs", "data" : { "axis": "x", "value" : 20000 } },
                { "type": "abs", "data" : { "axis": "y", "value" : 400 } } ] } }
diff --git a/ui/input.c b/ui/input.c
index a0f9873..59560f0 100644
--- a/ui/input.c
+++ b/ui/input.c
@@ -125,8 +125,8 @@ qemu_input_find_handler(uint32_t mask, QemuConsole *con)
     return NULL;
 }

-void qmp_x_input_send_event(bool has_console, int64_t console,
-                            InputEventList *events, Error **errp)
+void qmp_input_send_event(bool has_console, int64_t console,
+                          InputEventList *events, Error **errp)
 {
     InputEventList *e;
     QemuConsole *con;
-- 
2.4.3

  parent reply	other threads:[~2015-11-11 21:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-11 21:57 [Qemu-devel] [PATCH for-2.5 0/2] Promote 'input-send-event' to supported Eric Blake
2015-11-11 21:57 ` [Qemu-devel] [PATCH for-2.5 1/2] input: Avoid CamelCase in InputEvent enums Eric Blake
2015-11-12  8:23   ` Markus Armbruster
2015-11-12 13:24     ` Eric Blake
2015-11-11 21:57 ` Eric Blake [this message]
2015-11-12  8:23   ` [Qemu-devel] [PATCH for-2.5 2/2] input: Promote 'input-send-event' to stable API Markus Armbruster
2015-11-12  9:09     ` Gerd Hoffmann
2015-11-12 11:10       ` Markus Armbruster

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=1447279028-2114-3-git-send-email-eblake@redhat.com \
    --to=eblake@redhat.com \
    --cc=armbru@redhat.com \
    --cc=kraxel@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).