qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH for-2.5 2/2] input: Promote 'input-send-event' to st


From: Eric Blake
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

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 <address@hidden>
Signed-off-by: Eric Blake <address@hidden>
---
 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
address@hidden
address@hidden
 -----------------

 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]