From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N1dzf-0006w1-UV for qemu-devel@nongnu.org; Sat, 24 Oct 2009 06:37:07 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N1dzb-0006vX-Ay for qemu-devel@nongnu.org; Sat, 24 Oct 2009 06:37:07 -0400 Received: from [199.232.76.173] (port=44533 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N1dzb-0006vU-1W for qemu-devel@nongnu.org; Sat, 24 Oct 2009 06:37:03 -0400 Received: from fmmailgate03.web.de ([217.72.192.234]:33458) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N1dza-000886-DI for qemu-devel@nongnu.org; Sat, 24 Oct 2009 06:37:02 -0400 Message-ID: <4AE2D8C6.7070802@web.de> Date: Sat, 24 Oct 2009 12:36:54 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <1254920477-4645-1-git-send-email-amit.shah@redhat.com> <1254920477-4645-2-git-send-email-amit.shah@redhat.com> <1254920477-4645-3-git-send-email-amit.shah@redhat.com> <1254920477-4645-4-git-send-email-amit.shah@redhat.com> In-Reply-To: <1254920477-4645-4-git-send-email-amit.shah@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigCF17DC55FE57E5907DCB07E5" Sender: jan.kiszka@web.de Subject: [Qemu-devel] Re: [PATCH v2 3/3] char: emit the OPENED event only when a new char connection is opened List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amit Shah Cc: Anthony Liguori , qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigCF17DC55FE57E5907DCB07E5 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Amit Shah wrote: > The OPENED event gets sent also when qemu resets its state initially. > The consumers of the event aren't interested in receiving this event > on reset. The monitor was. Now its initial prompt on activation is broken. Does this patch fix/improve something for a different user? If not, please let us revert it. Jan >=20 > Signed-off-by: Amit Shah > --- > qemu-char.c | 7 ++++++- > qemu-char.h | 2 ++ > 2 files changed, 8 insertions(+), 1 deletions(-) >=20 > diff --git a/qemu-char.c b/qemu-char.c > index 4757689..0fd402c 100644 > --- a/qemu-char.c > +++ b/qemu-char.c > @@ -119,7 +119,12 @@ static void qemu_chr_event(CharDriverState *s, int= event) > static void qemu_chr_reset_bh(void *opaque) > { > CharDriverState *s =3D opaque; > - qemu_chr_event(s, CHR_EVENT_OPENED); > + > + if (s->initial_reset_issued) { > + qemu_chr_event(s, CHR_EVENT_OPENED); > + } else { > + s->initial_reset_issued =3D true; > + } > qemu_bh_delete(s->bh); > s->bh =3D NULL; > } > diff --git a/qemu-char.h b/qemu-char.h > index 05fe15d..409961d 100644 > --- a/qemu-char.h > +++ b/qemu-char.h > @@ -1,6 +1,7 @@ > #ifndef QEMU_CHAR_H > #define QEMU_CHAR_H > =20 > +#include > #include "qemu-common.h" > #include "qemu-queue.h" > #include "qemu-option.h" > @@ -66,6 +67,7 @@ struct CharDriverState { > QEMUBH *bh; > char *label; > char *filename; > + bool initial_reset_issued; > QTAILQ_ENTRY(CharDriverState) next; > }; > =20 --------------enigCF17DC55FE57E5907DCB07E5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAkri2MoACgkQitSsb3rl5xRTSwCZAZFHzph/BNX/GwmYvmc6Uz6p tp0An0NMdqbqSzOSpu/YXH5Da+fA9gP+ =WwCW -----END PGP SIGNATURE----- --------------enigCF17DC55FE57E5907DCB07E5--