Received: from eggs.gnu.org ([2001:4830:134:3::10]:56015) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VmPXb-00051j-BQ for qemu-devel@nongnu.org; Fri, 29 Nov 2013 09:59:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VmPXS-0008J5-Tg for qemu-devel@nongnu.org; Fri, 29 Nov 2013 09:59:35 -0500 Received: from mail-ie0-x22a.google.com ([2607:f8b0:4001:c03::22a]:46745) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VmPXS-0008J0-OL for qemu-devel@nongnu.org; Fri, 29 Nov 2013 09:59:26 -0500 Received: by mail-ie0-f170.google.com with SMTP id qd12so16824572ieb.29 for ; Fri, 29 Nov 2013 06:59:26 -0800 (PST) From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Fri, 29 Nov 2013 15:58:37 +0100 Message-Id: <1385737124-13964-7-git-send-email-marcandre.lureau@gmail.com> In-Reply-To: <1385737124-13964-1-git-send-email-marcandre.lureau@gmail.com> References: <1385737124-13964-1-git-send-email-marcandre.lureau@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH 06/13] char: add qemu_chr_fe_event() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, kraxel@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= From: Marc-André Lureau Teach the chardev frontend to send event. This is used by the Spice port chardev currently. Signed-off-by: Marc-André Lureau --- include/sysemu/char.h | 10 ++++++++++ qemu-char.c | 7 +++++++ 2 files changed, 17 insertions(+) diff --git a/include/sysemu/char.h b/include/sysemu/char.h index ad101d9..b81a6ff 100644 --- a/include/sysemu/char.h +++ b/include/sysemu/char.h @@ -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; @@ -138,6 +139,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: * * Write to a character backend using a printf style interface. diff --git a/qemu-char.c b/qemu-char.c index e00f84c..418dc69 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -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) { -- 1.8.4.2