Patchwork [08/11] qemu-char: add_handlers: Don't re-send the be_open event on unregister

login
register
mail settings
Submitter Hans de Goede
Date March 26, 2013, 10:08 a.m.
Message ID <1364292483-16564-9-git-send-email-hdegoede@redhat.com>
Download mbox | patch
Permalink /patch/231150/
State New
Headers show

Comments

Hans de Goede - March 26, 2013, 10:08 a.m.
Resending the be_open event only is useful when a frontend is registering, not
when it is unregistering.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 qemu-char.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/qemu-char.c b/qemu-char.c
index 368e7f5..edf3779 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -214,7 +214,7 @@  void qemu_chr_add_handlers(CharDriverState *s,
 
     /* We're connecting to an already opened device, so let's make sure we
        also get the open event */
-    if (s->be_open) {
+    if (fe_open && s->be_open) {
         qemu_chr_be_generic_open(s);
     }
 }