static void con_disconnect(struct XenDevice *xendev)

{

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



    if (!xendev->dev) {

        return;

    }

    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->gnttabdev) {

            munmap(con->sring, XC_PAGE_SIZE);

        } else {

            xc_gnttab_munmap(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 (!xendev->dev) {

        return;

    }

    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->gnttabdev) {

            munmap(con->sring, XC_PAGE_SIZE);

        } else {

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

        }

	con->sring = NULL;

    }

}

static void FUNC_0(struct XenDevice *VAR_0)

{

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



    if (!VAR_0->dev) {

        return;

    }

    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->gnttabdev) {

            munmap(VAR_1->sring, XC_PAGE_SIZE);

        } else {

            xc_gnttab_munmap(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_0->dev) { return; } 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->gnttabdev) { munmap(VAR_1->sring, XC_PAGE_SIZE); } else { xc_gnttab_munmap(VAR_0->gnttabdev, VAR_1->sring, 1); } VAR_1->sring = NULL; } }