static void con_disconnect(struct XenDevice *xendev)

{

    struct XenConsole *con = container_of(xendev, struct XenConsole, xendev);



    if (con->chr) {

        qemu_chr_add_handlers(con->chr, NULL, NULL, NULL, NULL);

        qemu_chr_fe_release(con->chr);

    }

    xen_be_unbind_evtchn(&con->xendev);



    if (con->sring) {

        if (!xendev->dev) {

            munmap(con->sring, XC_PAGE_SIZE);

        } else {

            xengnttab_unmap(xendev->gnttabdev, con->sring, 1);

        }

        con->sring = NULL;

    }

}

static void con_disconnect(struct XenDevice *xendev)

{

    struct XenConsole *con = container_of(xendev, struct XenConsole, xendev);



    if (con->chr) {

        qemu_chr_add_handlers(con->chr, NULL, NULL, NULL, NULL);

        qemu_chr_fe_release(con->chr);

    }

    xen_be_unbind_evtchn(&con->xendev);



    if (con->sring) {

        if (!xendev->dev) {

            munmap(con->sring, XC_PAGE_SIZE);

        } else {

            xengnttab_unmap(xendev->gnttabdev, con->sring, 1);

        }

        con->sring = NULL;

    }

}

            munmap(con->sring, XC_PAGE_SIZE);
static void FUNC_0(struct XenDevice *VAR_0)

{

    struct XenConsole *VAR_1 = container_of(VAR_0, struct XenConsole, VAR_0);



    if (VAR_1->chr) {

        qemu_chr_add_handlers(VAR_1->chr, NULL, NULL, NULL, NULL);

        qemu_chr_fe_release(VAR_1->chr);

    }

    xen_be_unbind_evtchn(&VAR_1->VAR_0);



    if (VAR_1->sring) {

        if (!VAR_0->dev) {

            munmap(VAR_1->sring, XC_PAGE_SIZE);

        } else {

            xengnttab_unmap(VAR_0->gnttabdev, VAR_1->sring, 1);

        }

        VAR_1->sring = NULL;

    }

}

static void FUNC_0(struct XenDevice *VAR_0)
{ struct XenConsole *VAR_1 = container_of(VAR_0, struct XenConsole, VAR_0); if (VAR_1->chr) { qemu_chr_add_handlers(VAR_1->chr, NULL, NULL, NULL, NULL); qemu_chr_fe_release(VAR_1->chr); } xen_be_unbind_evtchn(&VAR_1->VAR_0); if (VAR_1->sring) { if (!VAR_0->dev) { munmap(VAR_1->sring, XC_PAGE_SIZE); } else { xengnttab_unmap(VAR_0->gnttabdev, VAR_1->sring, 1); } VAR_1->sring = NULL; } }