int kvm_irqchip_add_msi_route(KVMState *s, MSIMessage msg)

{

    struct kvm_irq_routing_entry kroute;

    int virq;



    if (!kvm_gsi_routing_enabled()) {

        return -ENOSYS;

    }



    virq = kvm_irqchip_get_virq(s);

    if (virq < 0) {

        return virq;

    }



    kroute.gsi = virq;

    kroute.type = KVM_IRQ_ROUTING_MSI;

    kroute.flags = 0;

    kroute.u.msi.address_lo = (uint32_t)msg.address;

    kroute.u.msi.address_hi = msg.address >> 32;

    kroute.u.msi.data = msg.data;



    kvm_add_routing_entry(s, &kroute);



    return virq;

}

int kvm_irqchip_add_msi_route(KVMState *s, MSIMessage msg)

{

    struct kvm_irq_routing_entry kroute;

    int virq;



    if (!kvm_gsi_routing_enabled()) {

        return -ENOSYS;

    }



    virq = kvm_irqchip_get_virq(s);

    if (virq < 0) {

        return virq;

    }



    kroute.gsi = virq;

    kroute.type = KVM_IRQ_ROUTING_MSI;

    kroute.flags = 0;

    kroute.u.msi.address_lo = (uint32_t)msg.address;

    kroute.u.msi.address_hi = msg.address >> 32;

    kroute.u.msi.data = msg.data;



    kvm_add_routing_entry(s, &kroute);



    return virq;

}

int FUNC_0(KVMState *VAR_0, MSIMessage VAR_1)

{

    struct kvm_irq_routing_entry VAR_2;

    int VAR_3;



    if (!kvm_gsi_routing_enabled()) {

        return -ENOSYS;

    }



    VAR_3 = kvm_irqchip_get_virq(VAR_0);

    if (VAR_3 < 0) {

        return VAR_3;

    }



    VAR_2.gsi = VAR_3;

    VAR_2.type = KVM_IRQ_ROUTING_MSI;

    VAR_2.flags = 0;

    VAR_2.u.msi.address_lo = (uint32_t)VAR_1.address;

    VAR_2.u.msi.address_hi = VAR_1.address >> 32;

    VAR_2.u.msi.data = VAR_1.data;



    kvm_add_routing_entry(VAR_0, &VAR_2);



    return VAR_3;

}

int FUNC_0(KVMState *VAR_0, MSIMessage VAR_1)
{ struct kvm_irq_routing_entry VAR_2; int VAR_3; if (!kvm_gsi_routing_enabled()) { return -ENOSYS; } VAR_3 = kvm_irqchip_get_virq(VAR_0); if (VAR_3 < 0) { return VAR_3; } VAR_2.gsi = VAR_3; VAR_2.type = KVM_IRQ_ROUTING_MSI; VAR_2.flags = 0; VAR_2.u.msi.address_lo = (uint32_t)VAR_1.address; VAR_2.u.msi.address_hi = VAR_1.address >> 32; VAR_2.u.msi.data = VAR_1.data; kvm_add_routing_entry(VAR_0, &VAR_2); return VAR_3; }