static int kvm_virtio_pci_vq_vector_unmask(VirtIOPCIProxy *proxy,

                                        unsigned int queue_no,

                                        unsigned int vector,

                                        MSIMessage msg)

{

    VirtQueue *vq = virtio_get_queue(proxy->vdev, queue_no);

    EventNotifier *n = virtio_queue_get_guest_notifier(vq);

    VirtIOIRQFD *irqfd = &proxy->vector_irqfd[vector];

    int ret;



    if (irqfd->msg.data != msg.data || irqfd->msg.address != msg.address) {

        ret = kvm_irqchip_update_msi_route(kvm_state, irqfd->virq, msg);

        if (ret < 0) {

            return ret;

        }

    }



    /* If guest supports masking, irqfd is already setup, unmask it.

     * Otherwise, set it up now.

     */

    if (proxy->vdev->guest_notifier_mask) {

        proxy->vdev->guest_notifier_mask(proxy->vdev, queue_no, false);

        /* Test after unmasking to avoid losing events. */

        if (proxy->vdev->guest_notifier_pending &&

            proxy->vdev->guest_notifier_pending(proxy->vdev, queue_no)) {

            event_notifier_set(n);

        }

    } else {

        ret = kvm_virtio_pci_irqfd_use(proxy, queue_no, vector);

    }

    return ret;

}

static int kvm_virtio_pci_vq_vector_unmask(VirtIOPCIProxy *proxy,

                                        unsigned int queue_no,

                                        unsigned int vector,

                                        MSIMessage msg)

{

    VirtQueue *vq = virtio_get_queue(proxy->vdev, queue_no);

    EventNotifier *n = virtio_queue_get_guest_notifier(vq);

    VirtIOIRQFD *irqfd = &proxy->vector_irqfd[vector];

    int ret;



    if (irqfd->msg.data != msg.data || irqfd->msg.address != msg.address) {

        ret = kvm_irqchip_update_msi_route(kvm_state, irqfd->virq, msg);

        if (ret < 0) {

            return ret;

        }

    }



    





    if (proxy->vdev->guest_notifier_mask) {

        proxy->vdev->guest_notifier_mask(proxy->vdev, queue_no, false);

        

        if (proxy->vdev->guest_notifier_pending &&

            proxy->vdev->guest_notifier_pending(proxy->vdev, queue_no)) {

            event_notifier_set(n);

        }

    } else {

        ret = kvm_virtio_pci_irqfd_use(proxy, queue_no, vector);

    }

    return ret;

}

    int ret;
static int FUNC_0(VirtIOPCIProxy *VAR_0,

                                        unsigned int VAR_1,

                                        unsigned int VAR_2,

                                        MSIMessage VAR_3)

{

    VirtQueue *vq = virtio_get_queue(VAR_0->vdev, VAR_1);

    EventNotifier *n = virtio_queue_get_guest_notifier(vq);

    VirtIOIRQFD *irqfd = &VAR_0->vector_irqfd[VAR_2];

    int VAR_4;



    if (irqfd->VAR_3.data != VAR_3.data || irqfd->VAR_3.address != VAR_3.address) {

        VAR_4 = kvm_irqchip_update_msi_route(kvm_state, irqfd->virq, VAR_3);

        if (VAR_4 < 0) {

            return VAR_4;

        }

    }



    





    if (VAR_0->vdev->guest_notifier_mask) {

        VAR_0->vdev->guest_notifier_mask(VAR_0->vdev, VAR_1, false);

        

        if (VAR_0->vdev->guest_notifier_pending &&

            VAR_0->vdev->guest_notifier_pending(VAR_0->vdev, VAR_1)) {

            event_notifier_set(n);

        }

    } else {

        VAR_4 = kvm_virtio_pci_irqfd_use(VAR_0, VAR_1, VAR_2);

    }

    return VAR_4;

}

static int FUNC_0(VirtIOPCIProxy *VAR_0,
unsigned int VAR_1,
unsigned int VAR_2,
MSIMessage VAR_3)
{ VirtQueue *vq = virtio_get_queue(VAR_0->vdev, VAR_1); EventNotifier *n = virtio_queue_get_guest_notifier(vq); VirtIOIRQFD *irqfd = &VAR_0->vector_irqfd[VAR_2]; int VAR_4; if (irqfd->VAR_3.data != VAR_3.data || irqfd->VAR_3.address != VAR_3.address) { VAR_4 = kvm_irqchip_update_msi_route(kvm_state, irqfd->virq, VAR_3); if (VAR_4 < 0) { return VAR_4; } } if (VAR_0->vdev->guest_notifier_mask) { VAR_0->vdev->guest_notifier_mask(VAR_0->vdev, VAR_1, false); if (VAR_0->vdev->guest_notifier_pending &&
VAR_0->vdev->guest_notifier_pending(VAR_0->vdev, VAR_1)) { event_notifier_set(n); } } else { VAR_4 = kvm_virtio_pci_irqfd_use(VAR_0, VAR_1, VAR_2); } return VAR_4; }