int xen_be_bind_evtchn(struct XenDevice *xendev)

{

    if (xendev->local_port != -1) {

        return 0;

    }

    xendev->local_port = xc_evtchn_bind_interdomain

        (xendev->evtchndev, xendev->dom, xendev->remote_port);

    if (xendev->local_port == -1) {

        xen_be_printf(xendev, 0, "xc_evtchn_bind_interdomain failed\n");

        return -1;

    }

    xen_be_printf(xendev, 2, "bind evtchn port %d\n", xendev->local_port);

    qemu_set_fd_handler(xc_evtchn_fd(xendev->evtchndev),

                        xen_be_evtchn_event, NULL, xendev);

    return 0;

}

int xen_be_bind_evtchn(struct XenDevice *xendev)

{

    if (xendev->local_port != -1) {

        return 0;

    }

    xendev->local_port = xc_evtchn_bind_interdomain

        (xendev->evtchndev, xendev->dom, xendev->remote_port);

    if (xendev->local_port == -1) {

        xen_be_printf(xendev, 0, "xc_evtchn_bind_interdomain failed\n");

        return -1;

    }

    xen_be_printf(xendev, 2, "bind evtchn port %d\n", xendev->local_port);

    qemu_set_fd_handler(xc_evtchn_fd(xendev->evtchndev),

                        xen_be_evtchn_event, NULL, xendev);

    return 0;

}

int FUNC_0(struct XenDevice *VAR_0)

{

    if (VAR_0->local_port != -1) {

        return 0;

    }

    VAR_0->local_port = xc_evtchn_bind_interdomain

        (VAR_0->evtchndev, VAR_0->dom, VAR_0->remote_port);

    if (VAR_0->local_port == -1) {

        xen_be_printf(VAR_0, 0, "xc_evtchn_bind_interdomain failed\n");

        return -1;

    }

    xen_be_printf(VAR_0, 2, "bind evtchn port %d\n", VAR_0->local_port);

    qemu_set_fd_handler(xc_evtchn_fd(VAR_0->evtchndev),

                        xen_be_evtchn_event, NULL, VAR_0);

    return 0;

}

int FUNC_0(struct XenDevice *VAR_0)
{ if (VAR_0->local_port != -1) { return 0; } VAR_0->local_port = xc_evtchn_bind_interdomain
(VAR_0->evtchndev, VAR_0->dom, VAR_0->remote_port); if (VAR_0->local_port == -1) { xen_be_printf(VAR_0, 0, "xc_evtchn_bind_interdomain failed\n"); return -1; } xen_be_printf(VAR_0, 2, "bind evtchn port %d\n", VAR_0->local_port); qemu_set_fd_handler(xc_evtchn_fd(VAR_0->evtchndev),
xen_be_evtchn_event, NULL, VAR_0); return 0; }