static void fd_chr_close(struct CharDriverState *chr)

{

    FDCharDriver *s = chr->opaque;



    if (s->fd_in_tag) {

        g_source_remove(s->fd_in_tag);

        s->fd_in_tag = 0;

    }



    if (s->fd_in) {

        g_io_channel_unref(s->fd_in);

    }

    if (s->fd_out) {

        g_io_channel_unref(s->fd_out);

    }



    g_free(s);

    qemu_chr_be_event(chr, CHR_EVENT_CLOSED);

}

static void fd_chr_close(struct CharDriverState *chr)

{

    FDCharDriver *s = chr->opaque;



    if (s->fd_in_tag) {

        g_source_remove(s->fd_in_tag);

        s->fd_in_tag = 0;

    }



    if (s->fd_in) {

        g_io_channel_unref(s->fd_in);

    }

    if (s->fd_out) {

        g_io_channel_unref(s->fd_out);

    }



    g_free(s);

    qemu_chr_be_event(chr, CHR_EVENT_CLOSED);

}

        g_source_remove(s->fd_in_tag);         g_source_remove(s->fd_in_tag);
static void FUNC_0(struct CharDriverState *VAR_0)

{

    FDCharDriver *s = VAR_0->opaque;



    if (s->fd_in_tag) {

        g_source_remove(s->fd_in_tag);

        s->fd_in_tag = 0;

    }



    if (s->fd_in) {

        g_io_channel_unref(s->fd_in);

    }

    if (s->fd_out) {

        g_io_channel_unref(s->fd_out);

    }



    g_free(s);

    qemu_chr_be_event(VAR_0, CHR_EVENT_CLOSED);

}

static void FUNC_0(struct CharDriverState *VAR_0)
{ FDCharDriver *s = VAR_0->opaque; if (s->fd_in_tag) { g_source_remove(s->fd_in_tag); s->fd_in_tag = 0; } if (s->fd_in) { g_io_channel_unref(s->fd_in); } if (s->fd_out) { g_io_channel_unref(s->fd_out); } g_free(s); qemu_chr_be_event(VAR_0, CHR_EVENT_CLOSED); }