From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MvUQg-0000HG-Az for qemu-devel@nongnu.org; Wed, 07 Oct 2009 07:11:34 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MvUQb-0000DS-Kt for qemu-devel@nongnu.org; Wed, 07 Oct 2009 07:11:33 -0400 Received: from [199.232.76.173] (port=46356 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MvUQb-0000DG-FI for qemu-devel@nongnu.org; Wed, 07 Oct 2009 07:11:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56458) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MvUQb-0007BR-1S for qemu-devel@nongnu.org; Wed, 07 Oct 2009 07:11:29 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n97BBSEO005842 for ; Wed, 7 Oct 2009 07:11:28 -0400 From: Amit Shah Date: Wed, 7 Oct 2009 16:40:40 +0530 Message-Id: <1254913840-10358-4-git-send-email-amit.shah@redhat.com> In-Reply-To: <1254913840-10358-3-git-send-email-amit.shah@redhat.com> References: <1254913840-10358-1-git-send-email-amit.shah@redhat.com> <1254913840-10358-2-git-send-email-amit.shah@redhat.com> <1254913840-10358-3-git-send-email-amit.shah@redhat.com> Subject: [Qemu-devel] [PATCH 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: qemu-devel@nongnu.org Cc: Amit Shah 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. Signed-off-by: Amit Shah --- qemu-char.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/qemu-char.c b/qemu-char.c index 8fde8cf..02c096c 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -120,7 +120,10 @@ static void qemu_chr_event(CharDriverState *s, int event) static void qemu_chr_reset_bh(void *opaque) { CharDriverState *s = opaque; - qemu_chr_event(s, CHR_EVENT_OPENED); + + if (initial_reset_issued) { + qemu_chr_event(s, CHR_EVENT_OPENED); + } qemu_bh_delete(s->bh); s->bh = NULL; } -- 1.6.2.5