qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [6692] char: Fix initial reset (Jan Kiszka)


From: Anthony Liguori
Subject: [Qemu-devel] [6692] char: Fix initial reset (Jan Kiszka)
Date: Thu, 05 Mar 2009 19:42:04 +0000

Revision: 6692
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6692
Author:   aliguori
Date:     2009-03-05 19:42:04 +0000 (Thu, 05 Mar 2009)
Log Message:
-----------
char: Fix initial reset (Jan Kiszka)

Recent changes to the graphical console initialization broke the initial
CHR_EVENT_RESET distribution. The reset BHs generated on char device
initialization are now already consumed during machine init (ide init
... -> qemu_aio_wait -> qemu_bh_poll). Therefore, this patch moves the
initial qemu_chr_reset calls into a separate funtion which is called
after machine init.

Signed-off-by: Jan Kiszka <address@hidden>
Signed-off-by: Anthony Liguori <address@hidden>

Modified Paths:
--------------
    branches/stable_0_10_0/qemu-char.c
    branches/stable_0_10_0/qemu-char.h
    branches/stable_0_10_0/vl.c

Modified: branches/stable_0_10_0/qemu-char.c
===================================================================
--- branches/stable_0_10_0/qemu-char.c  2009-03-05 19:01:53 UTC (rev 6691)
+++ branches/stable_0_10_0/qemu-char.c  2009-03-05 19:42:04 UTC (rev 6692)
@@ -101,6 +101,10 @@
 /***********************************************************/
 /* character device */
 
+static TAILQ_HEAD(CharDriverStateHead, CharDriverState) chardevs =
+    TAILQ_HEAD_INITIALIZER(chardevs);
+static int initial_reset_issued;
+
 static void qemu_chr_event(CharDriverState *s, int event)
 {
     if (!s->chr_event)
@@ -118,12 +122,23 @@
 
 void qemu_chr_reset(CharDriverState *s)
 {
-    if (s->bh == NULL) {
+    if (s->bh == NULL && initial_reset_issued) {
        s->bh = qemu_bh_new(qemu_chr_reset_bh, s);
        qemu_bh_schedule(s->bh);
     }
 }
 
+void qemu_chr_initial_reset(void)
+{
+    CharDriverState *chr;
+
+    initial_reset_issued = 1;
+
+    TAILQ_FOREACH(chr, &chardevs, next) {
+        qemu_chr_reset(chr);
+    }
+}
+
 int qemu_chr_write(CharDriverState *s, const uint8_t *buf, int len)
 {
     return s->chr_write(s, buf, len);
@@ -2076,9 +2091,6 @@
     return NULL;
 }
 
-static TAILQ_HEAD(CharDriverStateHead, CharDriverState) chardevs
-= TAILQ_HEAD_INITIALIZER(chardevs);
-
 CharDriverState *qemu_chr_open(const char *label, const char *filename, void 
(*init)(struct CharDriverState *s))
 {
     const char *p;

Modified: branches/stable_0_10_0/qemu-char.h
===================================================================
--- branches/stable_0_10_0/qemu-char.h  2009-03-05 19:01:53 UTC (rev 6691)
+++ branches/stable_0_10_0/qemu-char.h  2009-03-05 19:42:04 UTC (rev 6692)
@@ -74,6 +74,7 @@
                            void *opaque);
 int qemu_chr_ioctl(CharDriverState *s, int cmd, void *arg);
 void qemu_chr_reset(CharDriverState *s);
+void qemu_chr_initial_reset(void);
 int qemu_chr_can_read(CharDriverState *s);
 void qemu_chr_read(CharDriverState *s, uint8_t *buf, int len);
 void qemu_chr_accept_input(CharDriverState *s);

Modified: branches/stable_0_10_0/vl.c
===================================================================
--- branches/stable_0_10_0/vl.c 2009-03-05 19:01:53 UTC (rev 6691)
+++ branches/stable_0_10_0/vl.c 2009-03-05 19:42:04 UTC (rev 6692)
@@ -5693,6 +5693,7 @@
     }
 
     text_consoles_set_display(display_state);
+    qemu_chr_initial_reset();
 
     if (monitor_device && monitor_hd)
         monitor_init(monitor_hd, !nographic);





reply via email to

[Prev in Thread] Current Thread [Next in Thread]