diff mbox

[3/4] ui/input: Add activate/remove for keyboard handlers

Message ID 1496927734-29174-4-git-send-email-owen.smith@citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Owen Smith June 8, 2017, 1:15 p.m. UTC
Adds missing functions to activate and remove keyboard handlers
* qemu_activate_kbd_event_handler
* qemu_remove_kbd_event_handler

Signed-off-by: Owen Smith <owen.smith@citrix.com>
---
 include/ui/console.h |  2 ++
 ui/input-legacy.c    | 12 ++++++++++++
 2 files changed, 14 insertions(+)

Comments

Gerd Hoffmann June 8, 2017, 1:39 p.m. UTC | #1
diff --git a/ui/input-legacy.c b/ui/input-legacy.c
> index 7159747..fbe1ce7 100644
> --- a/ui/input-legacy.c
> +++ b/ui/input-legacy.c
> @@ -142,6 +142,18 @@ QEMUPutKbdEntry
> *qemu_add_kbd_event_handler(QEMUPutKBDEvent *func, void *opaque)
>      return entry;
>  }
>  
> +void qemu_activate_kbd_event_handler(QEMUPutKbdEntry *entry)

Please don't add new code to input-legacy.c please.

Switch your code to use the new qemu_input_handler_*() functions
directly instead.

cheers,
  Gerd
Owen Smith June 13, 2017, 3:01 p.m. UTC | #2
Noted, I have had a look at porting the xenfb input handlers to the

qemu_input_handler_*() functions, and will post an update that combines patch

3 and 4 of this series.



From: Gerd Hoffmann<mailto:kraxel@redhat.com>
Sent: 08 June 2017 14:39
To: Owen Smith<mailto:owen.smith@citrix.com>; qemu-devel@nongnu.org<mailto:qemu-devel@nongnu.org>
Cc: sstabellini@kernel.org<mailto:sstabellini@kernel.org>; Anthony Perard<mailto:anthony.perard@citrix.com>; xen-devel@lists.xenproject.org<mailto:xen-devel@lists.xenproject.org>
Subject: Re: [PATCH 3/4] ui/input: Add activate/remove for keyboard handlers



diff --git a/ui/input-legacy.c b/ui/input-legacy.c
> index 7159747..fbe1ce7 100644
> --- a/ui/input-legacy.c
> +++ b/ui/input-legacy.c
> @@ -142,6 +142,18 @@ QEMUPutKbdEntry
> *qemu_add_kbd_event_handler(QEMUPutKBDEvent *func, void *opaque)
>      return entry;
>  }
>
> +void qemu_activate_kbd_event_handler(QEMUPutKbdEntry *entry)

Please don't add new code to input-legacy.c please.

Switch your code to use the new qemu_input_handler_*() functions
directly instead.

cheers,
  Gerd
diff mbox

Patch

diff --git a/include/ui/console.h b/include/ui/console.h
index 7262bef..f5045e1 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -55,6 +55,8 @@  typedef struct QEMUPutLEDEntry QEMUPutLEDEntry;
 
 QEMUPutKbdEntry *qemu_add_kbd_event_handler(QEMUPutKBDEvent *func,
                                             void *opaque);
+void qemu_remove_kbd_event_handler(QEMUPutKbdEntry *entry);
+void qemu_activate_kbd_event_handler(QEMUPutKbdEntry *entry);
 QEMUPutMouseEntry *qemu_add_mouse_event_handler(QEMUPutMouseEvent *func,
                                                 void *opaque, int absolute,
                                                 const char *name);
diff --git a/ui/input-legacy.c b/ui/input-legacy.c
index 7159747..fbe1ce7 100644
--- a/ui/input-legacy.c
+++ b/ui/input-legacy.c
@@ -142,6 +142,18 @@  QEMUPutKbdEntry *qemu_add_kbd_event_handler(QEMUPutKBDEvent *func, void *opaque)
     return entry;
 }
 
+void qemu_activate_kbd_event_handler(QEMUPutKbdEntry *entry)
+{
+    qemu_input_handler_activate(entry->s);
+}
+
+void qemu_remove_kbd_event_handler(QEMUPutKbdEntry *entry)
+{
+    qemu_input_handler_unregister(entry->s);
+
+    g_free(entry);
+}
+
 static void legacy_mouse_event(DeviceState *dev, QemuConsole *src,
                                InputEvent *evt)
 {