static int vhost_virtqueue_init(struct vhost_dev *dev,

                                struct vhost_virtqueue *vq, int n)

{

    struct vhost_vring_file file = {

        .index = n,

    };

    int r = event_notifier_init(&vq->masked_notifier, 0);

    if (r < 0) {

        return r;

    }



    file.fd = event_notifier_get_fd(&vq->masked_notifier);

    r = dev->vhost_ops->vhost_call(dev, VHOST_SET_VRING_CALL, &file);

    if (r) {

        r = -errno;

        goto fail_call;

    }

    return 0;

fail_call:

    event_notifier_cleanup(&vq->masked_notifier);

    return r;

}

static int vhost_virtqueue_init(struct vhost_dev *dev,

                                struct vhost_virtqueue *vq, int n)

{

    struct vhost_vring_file file = {

        .index = n,

    };

    int r = event_notifier_init(&vq->masked_notifier, 0);

    if (r < 0) {

        return r;

    }



    file.fd = event_notifier_get_fd(&vq->masked_notifier);

    r = dev->vhost_ops->vhost_call(dev, VHOST_SET_VRING_CALL, &file);

    if (r) {

        r = -errno;

        goto fail_call;

    }

    return 0;

fail_call:

    event_notifier_cleanup(&vq->masked_notifier);

    return r;

}

static int FUNC_0(struct vhost_dev *VAR_0,

                                struct vhost_virtqueue *VAR_1, int VAR_2)

{

    struct vhost_vring_file VAR_3 = {

        .index = VAR_2,

    };

    int VAR_4 = event_notifier_init(&VAR_1->masked_notifier, 0);

    if (VAR_4 < 0) {

        return VAR_4;

    }



    VAR_3.fd = event_notifier_get_fd(&VAR_1->masked_notifier);

    VAR_4 = VAR_0->vhost_ops->vhost_call(VAR_0, VHOST_SET_VRING_CALL, &VAR_3);

    if (VAR_4) {

        VAR_4 = -errno;

        goto fail_call;

    }

    return 0;

fail_call:

    event_notifier_cleanup(&VAR_1->masked_notifier);

    return VAR_4;

}

static int FUNC_0(struct vhost_dev *VAR_0,
struct vhost_virtqueue *VAR_1, int VAR_2)
{ struct vhost_vring_file VAR_3 = { .index = VAR_2,
}; int VAR_4 = event_notifier_init(&VAR_1->masked_notifier, 0); if (VAR_4 < 0) { return VAR_4; } VAR_3.fd = event_notifier_get_fd(&VAR_1->masked_notifier); VAR_4 = VAR_0->vhost_ops->vhost_call(VAR_0, VHOST_SET_VRING_CALL, &VAR_3); if (VAR_4) { VAR_4 = -errno; goto fail_call; } return 0; fail_call:
event_notifier_cleanup(&VAR_1->masked_notifier); return VAR_4; }