> You've got whitespace damage. You're mixing tabs and spaces. Please > only use spaces. Fixed. >> + if ((size == -1 && EIO == errno) || >> + (size == 0)) { >> > > errno == EIO Fixed. >> + /* >> + * Short timeout here: just need wait long enougth that qemu makes >> + * it through the poll loop once. When reconnected we want a >> + * short timeout so we notice it almost instantly. Otherwise >> + * read() gives us -EIO instantly, making pty_chr_state() reset the >> + * timeout to the normal (much longer) poll interval before the >> + * timer triggers. >> + */ >> + qemu_mod_timer(s->timer, qemu_get_clock(rt_clock) + 10); >> > > Perhaps what you really want here is a bottom half? Looked promising, tried, doesn't work. bh is called *before* the pty file handle is checked at least once for being readable. >> + if (s->connected) { >> + fprintf(stderr,"%s: %s disconnected\n", __FUNCTION__, >> ptsname(s->fd)); >> > > Obviously this debugging has to go. Dropped. >> + /* Try reading again ... */ >> +#if 0 >> + fprintf(stderr,"%s: %s checking ...\n", __FUNCTION__, >> ptsname(s->fd)); >> +#endif ... this too while being at it ;) >> + if (!s) { >> + free(chr); >> > > qemu_free() Fixed. New patch attached. cheers, Gerd -- http://kraxel.fedorapeople.org/xenner/