int kvm_irqchip_add_adapter_route(KVMState *s, AdapterInfo *adapter)

{

    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_S390_ADAPTER;

    kroute.flags = 0;

    kroute.u.adapter.summary_addr = adapter->summary_addr;

    kroute.u.adapter.ind_addr = adapter->ind_addr;

    kroute.u.adapter.summary_offset = adapter->summary_offset;

    kroute.u.adapter.ind_offset = adapter->ind_offset;

    kroute.u.adapter.adapter_id = adapter->adapter_id;



    kvm_add_routing_entry(s, &kroute);

    kvm_irqchip_commit_routes(s);



    return virq;

}

int kvm_irqchip_add_adapter_route(KVMState *s, AdapterInfo *adapter)

{

    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_S390_ADAPTER;

    kroute.flags = 0;

    kroute.u.adapter.summary_addr = adapter->summary_addr;

    kroute.u.adapter.ind_addr = adapter->ind_addr;

    kroute.u.adapter.summary_offset = adapter->summary_offset;

    kroute.u.adapter.ind_offset = adapter->ind_offset;

    kroute.u.adapter.adapter_id = adapter->adapter_id;



    kvm_add_routing_entry(s, &kroute);

    kvm_irqchip_commit_routes(s);



    return virq;

}

    struct kvm_irq_routing_entry kroute;
int FUNC_0(KVMState *VAR_0, AdapterInfo *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_S390_ADAPTER;

    VAR_2.flags = 0;

    VAR_2.u.VAR_1.summary_addr = VAR_1->summary_addr;

    VAR_2.u.VAR_1.ind_addr = VAR_1->ind_addr;

    VAR_2.u.VAR_1.summary_offset = VAR_1->summary_offset;

    VAR_2.u.VAR_1.ind_offset = VAR_1->ind_offset;

    VAR_2.u.VAR_1.adapter_id = VAR_1->adapter_id;



    kvm_add_routing_entry(VAR_0, &VAR_2);

    kvm_irqchip_commit_routes(VAR_0);



    return VAR_3;

}

int FUNC_0(KVMState *VAR_0, AdapterInfo *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_S390_ADAPTER; VAR_2.flags = 0; VAR_2.u.VAR_1.summary_addr = VAR_1->summary_addr; VAR_2.u.VAR_1.ind_addr = VAR_1->ind_addr; VAR_2.u.VAR_1.summary_offset = VAR_1->summary_offset; VAR_2.u.VAR_1.ind_offset = VAR_1->ind_offset; VAR_2.u.VAR_1.adapter_id = VAR_1->adapter_id; kvm_add_routing_entry(VAR_0, &VAR_2); kvm_irqchip_commit_routes(VAR_0); return VAR_3; }