From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53422) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ViO4f-0002lv-1V for qemu-devel@nongnu.org; Mon, 18 Nov 2013 07:37:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ViO4Z-0001ZG-0m for qemu-devel@nongnu.org; Mon, 18 Nov 2013 07:37:04 -0500 Received: from mx1.redhat.com ([209.132.183.28]:5510) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ViO4Y-0001Z9-PE for qemu-devel@nongnu.org; Mon, 18 Nov 2013 07:36:58 -0500 Message-ID: <528A09E4.5070700@redhat.com> Date: Mon, 18 Nov 2013 14:36:52 +0200 From: Alon Levy MIME-Version: 1.0 References: <1384777531-14635-1-git-send-email-marcandre.lureau@gmail.com> <1384777531-14635-6-git-send-email-marcandre.lureau@gmail.com> In-Reply-To: <1384777531-14635-6-git-send-email-marcandre.lureau@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 05/21] char: add qemu_chr_fe_event() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?= , qemu-devel@nongnu.org Cc: kwolf@redhat.com, =?UTF-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?= , jcody@redhat.com, kraxel@redhat.com, spice-devel@freedesktop.org On 11/18/2013 02:25 PM, Marc-Andr=C3=A9 Lureau wrote: > From: Marc-Andr=C3=A9 Lureau The patch description is incomplete, or the patch should be split - this patch also implements qemu_chr_fe_event for spiceport. >=20 > Signed-off-by: Marc-Andr=C3=A9 Lureau > --- > include/sysemu/char.h | 10 ++++++++++ > qemu-char.c | 7 +++++++ > spice-qemu-char.c | 10 ++++++++++ > 3 files changed, 27 insertions(+) >=20 > diff --git a/include/sysemu/char.h b/include/sysemu/char.h > index ad101d9..d23c8f1 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); > =20 > /** > + * @qemu_chr_fe_event: > + * > + * Send an event from the back end to the front 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) > } > } > =20 > +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) > { > diff --git a/spice-qemu-char.c b/spice-qemu-char.c > index e074d9e..16439c5 100644 > --- a/spice-qemu-char.c > +++ b/spice-qemu-char.c > @@ -222,6 +222,15 @@ static void spice_chr_set_fe_open(struct CharDrive= rState *chr, int fe_open) > } > } > =20 > +static void spice_chr_fe_event(struct CharDriverState *chr, int event) > +{ > +#if SPICE_SERVER_VERSION >=3D 0x000c02 > + SpiceCharDriver *s =3D chr->opaque; > + > + spice_server_port_event(&s->sin, event); > +#endif > +} > + > static void print_allowed_subtypes(void) > { > const char** psubtype; > @@ -255,6 +264,7 @@ static CharDriverState *chr_open(const char *subtyp= e) > chr->chr_close =3D spice_chr_close; > chr->chr_set_fe_open =3D spice_chr_set_fe_open; > chr->explicit_be_open =3D true; > + chr->chr_fe_event =3D spice_chr_fe_event; > =20 > QLIST_INSERT_HEAD(&spice_chars, s, next); > =20 >=20