static void kvm_add_routing_entry(KVMState *s,

                                  struct kvm_irq_routing_entry *entry)

{

    struct kvm_irq_routing_entry *new;

    int n, size;



    if (s->irq_routes->nr == s->nr_allocated_irq_routes) {

        n = s->nr_allocated_irq_routes * 2;

        if (n < 64) {

            n = 64;

        }

        size = sizeof(struct kvm_irq_routing);

        size += n * sizeof(*new);

        s->irq_routes = g_realloc(s->irq_routes, size);

        s->nr_allocated_irq_routes = n;

    }

    n = s->irq_routes->nr++;

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

    memset(new, 0, sizeof(*new));

    new->gsi = entry->gsi;

    new->type = entry->type;

    new->flags = entry->flags;

    new->u = entry->u;



    set_gsi(s, entry->gsi);

}

static void kvm_add_routing_entry(KVMState *s,

                                  struct kvm_irq_routing_entry *entry)

{

    struct kvm_irq_routing_entry *new;

    int n, size;



    if (s->irq_routes->nr == s->nr_allocated_irq_routes) {

        n = s->nr_allocated_irq_routes * 2;

        if (n < 64) {

            n = 64;

        }

        size = sizeof(struct kvm_irq_routing);

        size += n * sizeof(*new);

        s->irq_routes = g_realloc(s->irq_routes, size);

        s->nr_allocated_irq_routes = n;

    }

    n = s->irq_routes->nr++;

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

    memset(new, 0, sizeof(*new));

    new->gsi = entry->gsi;

    new->type = entry->type;

    new->flags = entry->flags;

    new->u = entry->u;



    set_gsi(s, entry->gsi);

}

    memset(new, 0, sizeof(*new));     new->gsi = entry->gsi;     new->type = entry->type;     new->flags = entry->flags;     new->u = entry->u;
static void FUNC_0(KVMState *VAR_0,

                                  struct kvm_irq_routing_entry *VAR_1)

{

    struct kvm_irq_routing_entry *VAR_2;

    int VAR_3, VAR_4;



    if (VAR_0->irq_routes->nr == VAR_0->nr_allocated_irq_routes) {

        VAR_3 = VAR_0->nr_allocated_irq_routes * 2;

        if (VAR_3 < 64) {

            VAR_3 = 64;

        }

        VAR_4 = sizeof(struct kvm_irq_routing);

        VAR_4 += VAR_3 * sizeof(*VAR_2);

        VAR_0->irq_routes = g_realloc(VAR_0->irq_routes, VAR_4);

        VAR_0->nr_allocated_irq_routes = VAR_3;

    }

    VAR_3 = VAR_0->irq_routes->nr++;

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

    memset(VAR_2, 0, sizeof(*VAR_2));

    VAR_2->gsi = VAR_1->gsi;

    VAR_2->type = VAR_1->type;

    VAR_2->flags = VAR_1->flags;

    VAR_2->u = VAR_1->u;



    set_gsi(VAR_0, VAR_1->gsi);

}

static void FUNC_0(KVMState *VAR_0,
struct kvm_irq_routing_entry *VAR_1)
{ struct kvm_irq_routing_entry *VAR_2; int VAR_3, VAR_4; if (VAR_0->irq_routes->nr == VAR_0->nr_allocated_irq_routes) { VAR_3 = VAR_0->nr_allocated_irq_routes * 2; if (VAR_3 < 64) { VAR_3 = 64; } VAR_4 = sizeof(struct kvm_irq_routing); VAR_4 += VAR_3 * sizeof(*VAR_2); VAR_0->irq_routes = g_realloc(VAR_0->irq_routes, VAR_4); VAR_0->nr_allocated_irq_routes = VAR_3; } VAR_3 = VAR_0->irq_routes->nr++; VAR_2 = &VAR_0->irq_routes->entries[VAR_3]; memset(VAR_2, 0, sizeof(*VAR_2)); VAR_2->gsi = VAR_1->gsi; VAR_2->type = VAR_1->type; VAR_2->flags = VAR_1->flags; VAR_2->u = VAR_1->u; set_gsi(VAR_0, VAR_1->gsi); }