aboutsummaryrefslogtreecommitdiff
path: root/qemu-char.c
diff options
context:
space:
mode:
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-03-05 22:59:58 +0000
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-03-05 22:59:58 +0000
commit2970a6c9435a4857ead2120313d1b1ba4be06d5d (patch)
treea8a0e207b0695c0074a655a4f95bebf6bbdf9018 /qemu-char.c
parentb36d24b6c3708413f1174e34bd86b4bf5116012f (diff)
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 <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6700 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'qemu-char.c')
-rw-r--r--qemu-char.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/qemu-char.c b/qemu-char.c
index 7cdeffd61e..1332863ed3 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -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 @@ static void qemu_chr_reset_bh(void *opaque)
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 @@ static CharDriverState *qemu_chr_open_tcp(const char *host_str,
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;