void pc_guest_info_init(PCMachineState *pcms)

{

    int i, j;



    pcms->apic_xrupt_override = kvm_allows_irq0_override();

    pcms->numa_nodes = nb_numa_nodes;

    pcms->node_mem = g_malloc0(pcms->numa_nodes *

                                    sizeof *pcms->node_mem);

    for (i = 0; i < nb_numa_nodes; i++) {

        pcms->node_mem[i] = numa_info[i].node_mem;

    }



    pcms->node_cpu = g_malloc0(pcms->apic_id_limit *

                                     sizeof *pcms->node_cpu);



    for (i = 0; i < max_cpus; i++) {

        unsigned int apic_id = x86_cpu_apic_id_from_index(i);

        assert(apic_id < pcms->apic_id_limit);

        for (j = 0; j < nb_numa_nodes; j++) {

            if (test_bit(i, numa_info[j].node_cpu)) {

                pcms->node_cpu[apic_id] = j;

                break;

            }

        }

    }



    pcms->machine_done.notify = pc_machine_done;

    qemu_add_machine_init_done_notifier(&pcms->machine_done);

}

void pc_guest_info_init(PCMachineState *pcms)

{

    int i, j;



    pcms->apic_xrupt_override = kvm_allows_irq0_override();

    pcms->numa_nodes = nb_numa_nodes;

    pcms->node_mem = g_malloc0(pcms->numa_nodes *

                                    sizeof *pcms->node_mem);

    for (i = 0; i < nb_numa_nodes; i++) {

        pcms->node_mem[i] = numa_info[i].node_mem;

    }



    pcms->node_cpu = g_malloc0(pcms->apic_id_limit *

                                     sizeof *pcms->node_cpu);



    for (i = 0; i < max_cpus; i++) {

        unsigned int apic_id = x86_cpu_apic_id_from_index(i);

        assert(apic_id < pcms->apic_id_limit);

        for (j = 0; j < nb_numa_nodes; j++) {

            if (test_bit(i, numa_info[j].node_cpu)) {

                pcms->node_cpu[apic_id] = j;

                break;

            }

        }

    }



    pcms->machine_done.notify = pc_machine_done;

    qemu_add_machine_init_done_notifier(&pcms->machine_done);

}

void FUNC_0(PCMachineState *VAR_0)

{

    int VAR_1, VAR_2;



    VAR_0->apic_xrupt_override = kvm_allows_irq0_override();

    VAR_0->numa_nodes = nb_numa_nodes;

    VAR_0->node_mem = g_malloc0(VAR_0->numa_nodes *

                                    sizeof *VAR_0->node_mem);

    for (VAR_1 = 0; VAR_1 < nb_numa_nodes; VAR_1++) {

        VAR_0->node_mem[VAR_1] = numa_info[VAR_1].node_mem;

    }



    VAR_0->node_cpu = g_malloc0(VAR_0->apic_id_limit *

                                     sizeof *VAR_0->node_cpu);



    for (VAR_1 = 0; VAR_1 < max_cpus; VAR_1++) {

        unsigned int apic_id = x86_cpu_apic_id_from_index(VAR_1);

        assert(apic_id < VAR_0->apic_id_limit);

        for (VAR_2 = 0; VAR_2 < nb_numa_nodes; VAR_2++) {

            if (test_bit(VAR_1, numa_info[VAR_2].node_cpu)) {

                VAR_0->node_cpu[apic_id] = VAR_2;

                break;

            }

        }

    }



    VAR_0->machine_done.notify = pc_machine_done;

    qemu_add_machine_init_done_notifier(&VAR_0->machine_done);

}

void FUNC_0(PCMachineState *VAR_0)
{ int VAR_1, VAR_2; VAR_0->apic_xrupt_override = kvm_allows_irq0_override(); VAR_0->numa_nodes = nb_numa_nodes; VAR_0->node_mem = g_malloc0(VAR_0->numa_nodes *
sizeof *VAR_0->node_mem); for (VAR_1 = 0; VAR_1 < nb_numa_nodes; VAR_1++) { VAR_0->node_mem[VAR_1] = numa_info[VAR_1].node_mem; } VAR_0->node_cpu = g_malloc0(VAR_0->apic_id_limit *
sizeof *VAR_0->node_cpu); for (VAR_1 = 0; VAR_1 < max_cpus; VAR_1++) { unsigned int apic_id = x86_cpu_apic_id_from_index(VAR_1); assert(apic_id < VAR_0->apic_id_limit); for (VAR_2 = 0; VAR_2 < nb_numa_nodes; VAR_2++) { if (test_bit(VAR_1, numa_info[VAR_2].node_cpu)) { VAR_0->node_cpu[apic_id] = VAR_2; break; } } } VAR_0->machine_done.notify = pc_machine_done; qemu_add_machine_init_done_notifier(&VAR_0->machine_done); }