static void pty_chr_state(CharDriverState *chr, int connected)

{

    PtyCharDriver *s = chr->opaque;



    if (!connected) {

        if (s->fd_tag) {

            g_source_remove(s->fd_tag);

            s->fd_tag = 0;

        }

        s->connected = 0;

        s->polling = 0;

        /* (re-)connect poll interval for idle guests: once per second.

         * We check more frequently in case the guests sends data to

         * the virtual device linked to our pty. */

        pty_chr_rearm_timer(chr, 1000);

    } else {

        if (!s->connected)

            qemu_chr_be_generic_open(chr);

        s->connected = 1;

    }

}

static void pty_chr_state(CharDriverState *chr, int connected)

{

    PtyCharDriver *s = chr->opaque;



    if (!connected) {

        if (s->fd_tag) {

            g_source_remove(s->fd_tag);

            s->fd_tag = 0;

        }

        s->connected = 0;

        s->polling = 0;

        





        pty_chr_rearm_timer(chr, 1000);

    } else {

        if (!s->connected)

            qemu_chr_be_generic_open(chr);

        s->connected = 1;

    }

}

static void FUNC_0(CharDriverState *VAR_0, int VAR_1)

{

    PtyCharDriver *s = VAR_0->opaque;



    if (!VAR_1) {

        if (s->fd_tag) {

            g_source_remove(s->fd_tag);

            s->fd_tag = 0;

        }

        s->VAR_1 = 0;

        s->polling = 0;

        





        pty_chr_rearm_timer(VAR_0, 1000);

    } else {

        if (!s->VAR_1)

            qemu_chr_be_generic_open(VAR_0);

        s->VAR_1 = 1;

    }

}

static void FUNC_0(CharDriverState *VAR_0, int VAR_1)
{ PtyCharDriver *s = VAR_0->opaque; if (!VAR_1) { if (s->fd_tag) { g_source_remove(s->fd_tag); s->fd_tag = 0; } s->VAR_1 = 0; s->polling = 0; pty_chr_rearm_timer(VAR_0, 1000); } else { if (!s->VAR_1)
qemu_chr_be_generic_open(VAR_0); s->VAR_1 = 1; } }