static int kvm_update_routing_entry(KVMState *s,

                                    struct kvm_irq_routing_entry *new_entry)

{

    struct kvm_irq_routing_entry *entry;

    int n;



    for (n = 0; n < s->irq_routes->nr; n++) {

        entry = &s->irq_routes->entries[n];

        if (entry->gsi != new_entry->gsi) {

            continue;

        }



        entry->type = new_entry->type;

        entry->flags = new_entry->flags;

        entry->u = new_entry->u;



        kvm_irqchip_commit_routes(s);



        return 0;

    }



    return -ESRCH;

}

static int kvm_update_routing_entry(KVMState *s,

                                    struct kvm_irq_routing_entry *new_entry)

{

    struct kvm_irq_routing_entry *entry;

    int n;



    for (n = 0; n < s->irq_routes->nr; n++) {

        entry = &s->irq_routes->entries[n];

        if (entry->gsi != new_entry->gsi) {

            continue;

        }



        entry->type = new_entry->type;

        entry->flags = new_entry->flags;

        entry->u = new_entry->u;



        kvm_irqchip_commit_routes(s);



        return 0;

    }



    return -ESRCH;

}

        entry->type = new_entry->type;         entry->flags = new_entry->flags;         entry->u = new_entry->u;
static int FUNC_0(KVMState *VAR_0,

                                    struct kvm_irq_routing_entry *VAR_1)

{

    struct kvm_irq_routing_entry *VAR_2;

    int VAR_3;



    for (VAR_3 = 0; VAR_3 < VAR_0->irq_routes->nr; VAR_3++) {

        VAR_2 = &VAR_0->irq_routes->entries[VAR_3];

        if (VAR_2->gsi != VAR_1->gsi) {

            continue;

        }



        VAR_2->type = VAR_1->type;

        VAR_2->flags = VAR_1->flags;

        VAR_2->u = VAR_1->u;



        kvm_irqchip_commit_routes(VAR_0);



        return 0;

    }



    return -ESRCH;

}

static int FUNC_0(KVMState *VAR_0,
struct kvm_irq_routing_entry *VAR_1)
{ struct kvm_irq_routing_entry *VAR_2; int VAR_3; for (VAR_3 = 0; VAR_3 < VAR_0->irq_routes->nr; VAR_3++) { VAR_2 = &VAR_0->irq_routes->entries[VAR_3]; if (VAR_2->gsi != VAR_1->gsi) { continue; } VAR_2->type = VAR_1->type; VAR_2->flags = VAR_1->flags; VAR_2->u = VAR_1->u; kvm_irqchip_commit_routes(VAR_0); return 0; } return -ESRCH; }