Patchwork [3/3] char: emit the OPENED event only when a new char connection is opened

login
register
mail settings
Submitter Amit Shah
Date Oct. 7, 2009, 11:10 a.m.
Message ID <1254913840-10358-4-git-send-email-amit.shah@redhat.com>
Download mbox | patch
Permalink /patch/35261/
State Changes Requested
Headers show

Comments

Amit Shah - Oct. 7, 2009, 11:10 a.m.
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 <amit.shah@redhat.com>
---
 qemu-char.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

Patch

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;
 }