Skip to contentSkip to conversation

input-linux: switch over to -object

PATCH In review Gerd Hoffmann 3 participants 3 messages Mar 11, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 input-linux: switch over to -object

This patches makes input-linux use -object instead a new command line switch. So, instead of the switch ...

-input-linux /dev/input/event$nr

... you must create an object this way:

-object input-linux,id=$name,evdev=/dev/input/event$nr

Bonus is that you can hot-add and hot-remove them via monitor now.

---
 qemu-options.hx  |   9 ----
 ui/input-linux.c | 158 +++++++++++++++++++++++++++++++++++++++++++------------
 vl.c             |  10 ----
 3 files changed, 123 insertions(+), 54 deletions(-)
qemu-options.hx +0 -9
index 0cf7bb9..2b3ed86 100644
@@ -1226,15 +1226,6 @@ STEXI
 Set the initial graphical resolution and depth (PPC, SPARC only).
 ETEXI
 
-DEF("input-linux", 1, QEMU_OPTION_input_linux,
-    "-input-linux <evdev>\n"
-    "                Use input device.\n", QEMU_ARCH_ALL)
-STEXI
-@item -input-linux @var{dev}
-@findex -input-linux
-Use input device.
-ETEXI
-
 DEF("vnc", HAS_ARG, QEMU_OPTION_vnc ,
     "-vnc display    start a VNC server on display\n", QEMU_ARCH_ALL)
 STEXI
ui/input-linux.c +123 -35

209 lines not on this page · raw message

vl.c +0 -10
index 7a28982..9a734ff 100644
@@ -3729,12 +3729,6 @@ int main(int argc, char **argv, char **envp)
 #endif
                 break;
             }
-            case QEMU_OPTION_input_linux:
-                if (!qemu_opts_parse_noisily(qemu_find_opts("input-linux"),
-                                             optarg, true)) {
-                    exit(1);
-                }
-                break;
             case QEMU_OPTION_no_acpi:
                 acpi_enabled = 0;
                 break;
@@ -4598,10 +4592,6 @@ int main(int argc, char **argv, char **envp)
         qemu_spice_display_init();
     }
 #endif
-#ifdef CONFIG_LINUX
-    qemu_opts_foreach(qemu_find_opts("input-linux"),
-                      input_linux_init, NULL, &error_fatal);
-#endif
 
     if (foreach_device_config(DEV_GDB, gdbserver_start) < 0) {
         exit(1);
Signature · 1 line
1.8.3.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Gerd Hoffmann

This patches makes input-linux use -object instead a new command line switch. So, instead of the switch ...

-input-linux /dev/input/event$nr

Quoted 8 lines

... you must create an object this way:

-object input-linux,id=$name,evdev=/dev/input/event$nr

Bonus is that you can hot-add and hot-remove them via monitor now.

Great, thank you very much!

#2 lore raw
Quoted 4 lines · Paolo Bonzini
Quoted 1 line · Gerd Hoffmann

This patches makes input-linux use -object instead a new command line

Nit: s/instead a/instead of a/

[If you want to fix up when you apply.]

Quoted 17 lines
Quoted 4 lines

switch. So, instead of the switch ...

-input-linux /dev/input/event$nr

Quoted 8 lines

... you must create an object this way:

-object input-linux,id=$name,evdev=/dev/input/event$nr

Bonus is that you can hot-add and hot-remove them via monitor now.

Great, thank you very much!

Signature · 1 line
/kashyap