]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
char: add qemu_chr_fe_event()
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Sun, 1 Dec 2013 21:23:39 +0000 (22:23 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 16 Dec 2013 09:12:20 +0000 (10:12 +0100)
Teach the chardev frontend to send event. This is used by the Spice port
chardev currently.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
include/sysemu/char.h
qemu-char.c

index ad101d925830ec7a72b24a5ca83334694c6eaff4..b81a6ff1856d6a4ab90afb90af05ae12c49c052e 100644 (file)
@@ -69,6 +69,7 @@ struct CharDriverState {
     void (*chr_accept_input)(struct CharDriverState *chr);
     void (*chr_set_echo)(struct CharDriverState *chr, bool echo);
     void (*chr_set_fe_open)(struct CharDriverState *chr, int fe_open);
+    void (*chr_fe_event)(struct CharDriverState *chr, int event);
     void *opaque;
     char *label;
     char *filename;
@@ -137,6 +138,15 @@ void qemu_chr_fe_set_echo(struct CharDriverState *chr, bool echo);
  */
 void qemu_chr_fe_set_open(struct CharDriverState *chr, int fe_open);
 
+/**
+ * @qemu_chr_fe_event:
+ *
+ * Send an event from the front end to the back end.
+ *
+ * @event the event to send
+ */
+void qemu_chr_fe_event(CharDriverState *s, int event);
+
 /**
  * @qemu_chr_fe_printf:
  *
index e00f84c8e971c690e21fa8e569a22ec4229209bf..418dc69d398db5d9dd8b6c9f9b543e7dcf710c9f 100644 (file)
@@ -3353,6 +3353,13 @@ void qemu_chr_fe_set_open(struct CharDriverState *chr, int fe_open)
     }
 }
 
+void qemu_chr_fe_event(struct CharDriverState *chr, int event)
+{
+    if (chr->chr_fe_event) {
+        chr->chr_fe_event(chr, event);
+    }
+}
+
 int qemu_chr_fe_add_watch(CharDriverState *s, GIOCondition cond,
                           GIOFunc func, void *user_data)
 {