machine.c (af3f37319cb1e1ca0c42842ecdbd1bcfc64a4b6f) machine.c (54aa3de72ea2aaa2e903e7e879a4f3dda515a00e)
1/*
2 * QEMU Machine
3 *
4 * Copyright (C) 2014 Red Hat Inc
5 *
6 * Authors:
7 * Marcel Apfelbaum <marcel.a@redhat.com>
8 *

--- 490 unchanged lines hidden (view full) ---

499 }
500
501 g_free(nvdimms_state->persistence_string);
502 nvdimms_state->persistence_string = g_strdup(value);
503}
504
505void machine_class_allow_dynamic_sysbus_dev(MachineClass *mc, const char *type)
506{
1/*
2 * QEMU Machine
3 *
4 * Copyright (C) 2014 Red Hat Inc
5 *
6 * Authors:
7 * Marcel Apfelbaum <marcel.a@redhat.com>
8 *

--- 490 unchanged lines hidden (view full) ---

499 }
500
501 g_free(nvdimms_state->persistence_string);
502 nvdimms_state->persistence_string = g_strdup(value);
503}
504
505void machine_class_allow_dynamic_sysbus_dev(MachineClass *mc, const char *type)
506{
507 strList *item = g_new0(strList, 1);
508
509 item->value = g_strdup(type);
510 item->next = mc->allowed_dynamic_sysbus_devices;
511 mc->allowed_dynamic_sysbus_devices = item;
507 QAPI_LIST_PREPEND(mc->allowed_dynamic_sysbus_devices, g_strdup(type));
512}
513
514static void validate_sysbus_device(SysBusDevice *sbdev, void *opaque)
515{
516 MachineState *machine = opaque;
517 MachineClass *mc = MACHINE_GET_CLASS(machine);
518 bool allowed = false;
519 strList *wl;

--- 44 unchanged lines hidden (view full) ---

564 HotpluggableCPUList *head = NULL;
565 MachineClass *mc = MACHINE_GET_CLASS(machine);
566
567 /* force board to initialize possible_cpus if it hasn't been done yet */
568 mc->possible_cpu_arch_ids(machine);
569
570 for (i = 0; i < machine->possible_cpus->len; i++) {
571 Object *cpu;
508}
509
510static void validate_sysbus_device(SysBusDevice *sbdev, void *opaque)
511{
512 MachineState *machine = opaque;
513 MachineClass *mc = MACHINE_GET_CLASS(machine);
514 bool allowed = false;
515 strList *wl;

--- 44 unchanged lines hidden (view full) ---

560 HotpluggableCPUList *head = NULL;
561 MachineClass *mc = MACHINE_GET_CLASS(machine);
562
563 /* force board to initialize possible_cpus if it hasn't been done yet */
564 mc->possible_cpu_arch_ids(machine);
565
566 for (i = 0; i < machine->possible_cpus->len; i++) {
567 Object *cpu;
572 HotpluggableCPUList *list_item = g_new0(typeof(*list_item), 1);
573 HotpluggableCPU *cpu_item = g_new0(typeof(*cpu_item), 1);
574
575 cpu_item->type = g_strdup(machine->possible_cpus->cpus[i].type);
576 cpu_item->vcpus_count = machine->possible_cpus->cpus[i].vcpus_count;
577 cpu_item->props = g_memdup(&machine->possible_cpus->cpus[i].props,
578 sizeof(*cpu_item->props));
579
580 cpu = machine->possible_cpus->cpus[i].cpu;
581 if (cpu) {
582 cpu_item->has_qom_path = true;
583 cpu_item->qom_path = object_get_canonical_path(cpu);
584 }
568 HotpluggableCPU *cpu_item = g_new0(typeof(*cpu_item), 1);
569
570 cpu_item->type = g_strdup(machine->possible_cpus->cpus[i].type);
571 cpu_item->vcpus_count = machine->possible_cpus->cpus[i].vcpus_count;
572 cpu_item->props = g_memdup(&machine->possible_cpus->cpus[i].props,
573 sizeof(*cpu_item->props));
574
575 cpu = machine->possible_cpus->cpus[i].cpu;
576 if (cpu) {
577 cpu_item->has_qom_path = true;
578 cpu_item->qom_path = object_get_canonical_path(cpu);
579 }
585 list_item->value = cpu_item;
586 list_item->next = head;
587 head = list_item;
580 QAPI_LIST_PREPEND(head, cpu_item);
588 }
589 return head;
590}
591
592/**
593 * machine_set_cpu_numa_node:
594 * @machine: machine object to modify
595 * @props: specifies which cpu objects to assign to

--- 662 unchanged lines hidden ---
581 }
582 return head;
583}
584
585/**
586 * machine_set_cpu_numa_node:
587 * @machine: machine object to modify
588 * @props: specifies which cpu objects to assign to

--- 662 unchanged lines hidden ---