diff options
Diffstat (limited to 'hw')
-rw-r--r-- | hw/arm/virt.c | 94 | ||||
-rw-r--r-- | hw/core/machine.c | 11 | ||||
-rw-r--r-- | hw/core/qdev-properties.c | 30 | ||||
-rw-r--r-- | hw/i386/pc.c | 18 | ||||
-rw-r--r-- | hw/i386/pc_piix.c | 20 | ||||
-rw-r--r-- | hw/i386/pc_q35.c | 19 | ||||
-rw-r--r-- | hw/mem/memory-device.c | 9 | ||||
-rw-r--r-- | hw/misc/ivshmem.c | 2 | ||||
-rw-r--r-- | hw/ppc/spapr.c | 102 | ||||
-rw-r--r-- | hw/timer/sun4v-rtc.c | 2 | ||||
-rw-r--r-- | hw/virtio/virtio-rng.c | 2 |
11 files changed, 95 insertions, 214 deletions
diff --git a/hw/arm/virt.c b/hw/arm/virt.c index f69e7eb399..17f1b49d11 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -74,7 +74,6 @@ static const TypeInfo machvirt_##major##_##minor##_info = { \ .name = MACHINE_TYPE_NAME("virt-" # major "." # minor), \ .parent = TYPE_VIRT_MACHINE, \ - .instance_init = virt_##major##_##minor##_instance_init, \ .class_init = virt_##major##_##minor##_class_init, \ }; \ static void machvirt_machine_##major##_##minor##_init(void) \ @@ -1778,26 +1777,7 @@ static void virt_machine_class_init(ObjectClass *oc, void *data) hc->plug = virt_machine_device_plug_cb; } -static const TypeInfo virt_machine_info = { - .name = TYPE_VIRT_MACHINE, - .parent = TYPE_MACHINE, - .abstract = true, - .instance_size = sizeof(VirtMachineState), - .class_size = sizeof(VirtMachineClass), - .class_init = virt_machine_class_init, - .interfaces = (InterfaceInfo[]) { - { TYPE_HOTPLUG_HANDLER }, - { } - }, -}; - -static void machvirt_machine_init(void) -{ - type_register_static(&virt_machine_info); -} -type_init(machvirt_machine_init); - -static void virt_3_1_instance_init(Object *obj) +static void virt_instance_init(Object *obj) { VirtMachineState *vms = VIRT_MACHINE(obj); VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(vms); @@ -1867,18 +1847,43 @@ static void virt_3_1_instance_init(Object *obj) vms->irqmap = a15irqmap; } -static void virt_machine_3_1_options(MachineClass *mc) +static const TypeInfo virt_machine_info = { + .name = TYPE_VIRT_MACHINE, + .parent = TYPE_MACHINE, + .abstract = true, + .instance_size = sizeof(VirtMachineState), + .class_size = sizeof(VirtMachineClass), + .class_init = virt_machine_class_init, + .instance_init = virt_instance_init, + .interfaces = (InterfaceInfo[]) { + { TYPE_HOTPLUG_HANDLER }, + { } + }, +}; + +static void machvirt_machine_init(void) { + type_register_static(&virt_machine_info); } -DEFINE_VIRT_MACHINE_AS_LATEST(3, 1) +type_init(machvirt_machine_init); -#define VIRT_COMPAT_3_0 \ - HW_COMPAT_3_0 +static void virt_machine_4_0_options(MachineClass *mc) +{ +} +DEFINE_VIRT_MACHINE_AS_LATEST(4, 0) -static void virt_3_0_instance_init(Object *obj) +#define VIRT_COMPAT_3_1 \ + HW_COMPAT_3_1 + +static void virt_machine_3_1_options(MachineClass *mc) { - virt_3_1_instance_init(obj); + virt_machine_4_0_options(mc); + SET_MACHINE_COMPAT(mc, VIRT_COMPAT_3_1); } +DEFINE_VIRT_MACHINE(3, 1) + +#define VIRT_COMPAT_3_0 \ + HW_COMPAT_3_0 static void virt_machine_3_0_options(MachineClass *mc) { @@ -1890,11 +1895,6 @@ DEFINE_VIRT_MACHINE(3, 0) #define VIRT_COMPAT_2_12 \ HW_COMPAT_2_12 -static void virt_2_12_instance_init(Object *obj) -{ - virt_3_0_instance_init(obj); -} - static void virt_machine_2_12_options(MachineClass *mc) { VirtMachineClass *vmc = VIRT_MACHINE_CLASS(OBJECT_CLASS(mc)); @@ -1909,11 +1909,6 @@ DEFINE_VIRT_MACHINE(2, 12) #define VIRT_COMPAT_2_11 \ HW_COMPAT_2_11 -static void virt_2_11_instance_init(Object *obj) -{ - virt_2_12_instance_init(obj); -} - static void virt_machine_2_11_options(MachineClass *mc) { VirtMachineClass *vmc = VIRT_MACHINE_CLASS(OBJECT_CLASS(mc)); @@ -1927,11 +1922,6 @@ DEFINE_VIRT_MACHINE(2, 11) #define VIRT_COMPAT_2_10 \ HW_COMPAT_2_10 -static void virt_2_10_instance_init(Object *obj) -{ - virt_2_11_instance_init(obj); -} - static void virt_machine_2_10_options(MachineClass *mc) { virt_machine_2_11_options(mc); @@ -1944,11 +1934,6 @@ DEFINE_VIRT_MACHINE(2, 10) #define VIRT_COMPAT_2_9 \ HW_COMPAT_2_9 -static void virt_2_9_instance_init(Object *obj) -{ - virt_2_10_instance_init(obj); -} - static void virt_machine_2_9_options(MachineClass *mc) { virt_machine_2_10_options(mc); @@ -1959,11 +1944,6 @@ DEFINE_VIRT_MACHINE(2, 9) #define VIRT_COMPAT_2_8 \ HW_COMPAT_2_8 -static void virt_2_8_instance_init(Object *obj) -{ - virt_2_9_instance_init(obj); -} - static void virt_machine_2_8_options(MachineClass *mc) { VirtMachineClass *vmc = VIRT_MACHINE_CLASS(OBJECT_CLASS(mc)); @@ -1980,11 +1960,6 @@ DEFINE_VIRT_MACHINE(2, 8) #define VIRT_COMPAT_2_7 \ HW_COMPAT_2_7 -static void virt_2_7_instance_init(Object *obj) -{ - virt_2_8_instance_init(obj); -} - static void virt_machine_2_7_options(MachineClass *mc) { VirtMachineClass *vmc = VIRT_MACHINE_CLASS(OBJECT_CLASS(mc)); @@ -2001,11 +1976,6 @@ DEFINE_VIRT_MACHINE(2, 7) #define VIRT_COMPAT_2_6 \ HW_COMPAT_2_6 -static void virt_2_6_instance_init(Object *obj) -{ - virt_2_7_instance_init(obj); -} - static void virt_machine_2_6_options(MachineClass *mc) { VirtMachineClass *vmc = VIRT_MACHINE_CLASS(OBJECT_CLASS(mc)); diff --git a/hw/core/machine.c b/hw/core/machine.c index da50ad6de7..c51423b647 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -834,16 +834,6 @@ void machine_run_board_init(MachineState *machine) machine_class->init(machine); } -static void machine_class_finalize(ObjectClass *klass, void *data) -{ - MachineClass *mc = MACHINE_CLASS(klass); - - if (mc->compat_props) { - g_array_free(mc->compat_props, true); - } - g_free(mc->name); -} - void machine_register_compat_props(MachineState *machine) { MachineClass *mc = MACHINE_GET_CLASS(machine); @@ -869,7 +859,6 @@ static const TypeInfo machine_info = { .class_size = sizeof(MachineClass), .class_init = machine_class_init, .class_base_init = machine_class_base_init, - .class_finalize = machine_class_finalize, .instance_size = sizeof(MachineState), .instance_init = machine_initfn, .instance_finalize = machine_finalize, diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 35072dec1e..bd84c4ea4c 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -1180,36 +1180,6 @@ void qdev_prop_register_global(GlobalProperty *prop) global_props = g_list_append(global_props, prop); } -void register_compat_prop(const char *driver, - const char *property, - const char *value) -{ - GlobalProperty *p = g_new0(GlobalProperty, 1); - - /* Any compat_props must never cause error */ - p->errp = &error_abort; - p->driver = driver; - p->property = property; - p->value = value; - qdev_prop_register_global(p); -} - -void register_compat_props_array(GlobalProperty *prop) -{ - for (; prop && prop->driver; prop++) { - register_compat_prop(prop->driver, prop->property, prop->value); - } -} - -void qdev_prop_register_global_list(GlobalProperty *props) -{ - int i; - - for (i = 0; props[i].driver != NULL; i++) { - qdev_prop_register_global(props+i); - } -} - int qdev_prop_check_globals(void) { GList *l; diff --git a/hw/i386/pc.c b/hw/i386/pc.c index f095725dba..4cd2fbca4d 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -2222,42 +2222,42 @@ static bool pc_machine_get_smbus(Object *obj, Error **errp) { PCMachineState *pcms = PC_MACHINE(obj); - return pcms->smbus; + return pcms->smbus_enabled; } static void pc_machine_set_smbus(Object *obj, bool value, Error **errp) { PCMachineState *pcms = PC_MACHINE(obj); - pcms->smbus = value; + pcms->smbus_enabled = value; } static bool pc_machine_get_sata(Object *obj, Error **errp) { PCMachineState *pcms = PC_MACHINE(obj); - return pcms->sata; + return pcms->sata_enabled; } static void pc_machine_set_sata(Object *obj, bool value, Error **errp) { PCMachineState *pcms = PC_MACHINE(obj); - pcms->sata = value; + pcms->sata_enabled = value; } static bool pc_machine_get_pit(Object *obj, Error **errp) { PCMachineState *pcms = PC_MACHINE(obj); - return pcms->pit; + return pcms->pit_enabled; } static void pc_machine_set_pit(Object *obj, bool value, Error **errp) { PCMachineState *pcms = PC_MACHINE(obj); - pcms->pit = value; + pcms->pit_enabled = value; } static void pc_machine_initfn(Object *obj) @@ -2271,9 +2271,9 @@ static void pc_machine_initfn(Object *obj) pcms->acpi_nvdimm_state.is_enabled = false; /* acpi build is enabled by default if machine supports it */ pcms->acpi_build_enabled = PC_MACHINE_GET_CLASS(pcms)->has_acpi_build; - pcms->smbus = true; - pcms->sata = true; - pcms->pit = true; + pcms->smbus_enabled = true; + pcms->sata_enabled = true; + pcms->pit_enabled = true; } static void pc_machine_reset(void) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 7092d6d13f..6981cfa740 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -239,7 +239,8 @@ static void pc_init1(MachineState *machine, /* init basic PC hardware */ pc_basic_device_init(isa_bus, pcms->gsi, &rtc_state, true, - (pcms->vmport != ON_OFF_AUTO_ON), pcms->pit, 0x4); + (pcms->vmport != ON_OFF_AUTO_ON), pcms->pit_enabled, + 0x4); pc_nic_init(pcmc, isa_bus, pci_bus); @@ -320,7 +321,6 @@ static void pc_compat_2_3(MachineState *machine) static void pc_compat_2_2(MachineState *machine) { pc_compat_2_3(machine); - machine->suppress_vmdesc = true; } static void pc_compat_2_1(MachineState *machine) @@ -428,21 +428,30 @@ static void pc_i440fx_machine_options(MachineClass *m) machine_class_allow_dynamic_sysbus_dev(m, TYPE_RAMFB_DEVICE); } -static void pc_i440fx_3_1_machine_options(MachineClass *m) +static void pc_i440fx_4_0_machine_options(MachineClass *m) { pc_i440fx_machine_options(m); m->alias = "pc"; m->is_default = 1; } +DEFINE_I440FX_MACHINE(v4_0, "pc-i440fx-4.0", NULL, + pc_i440fx_4_0_machine_options); + +static void pc_i440fx_3_1_machine_options(MachineClass *m) +{ + pc_i440fx_4_0_machine_options(m); + m->is_default = 0; + m->alias = NULL; + SET_MACHINE_COMPAT(m, PC_COMPAT_3_1); +} + DEFINE_I440FX_MACHINE(v3_1, "pc-i440fx-3.1", NULL, pc_i440fx_3_1_machine_options); static void pc_i440fx_3_0_machine_options(MachineClass *m) { pc_i440fx_3_1_machine_options(m); - m->is_default = 0; - m->alias = NULL; SET_MACHINE_COMPAT(m, PC_COMPAT_3_0); } @@ -562,6 +571,7 @@ static void pc_i440fx_2_2_machine_options(MachineClass *m) PCMachineClass *pcmc = PC_MACHINE_CLASS(m); pc_i440fx_2_3_machine_options(m); m->hw_version = "2.2.0"; + m->default_machine_opts = "firmware=bios-256k.bin,suppress-vmdesc=on"; SET_MACHINE_COMPAT(m, PC_COMPAT_2_2); pcmc->rsdp_in_ram = false; } diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 4702bb13c4..58459bdab5 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -236,13 +236,13 @@ static void pc_q35_init(MachineState *machine) /* init basic PC hardware */ pc_basic_device_init(isa_bus, pcms->gsi, &rtc_state, !mc->no_floppy, - (pcms->vmport != ON_OFF_AUTO_ON), pcms->pit, + (pcms->vmport != ON_OFF_AUTO_ON), pcms->pit_enabled, 0xff0104); /* connect pm stuff to lpc */ ich9_lpc_pm_init(lpc, pc_machine_is_smm_enabled(pcms)); - if (pcms->sata) { + if (pcms->sata_enabled) { /* ahci and SATA device, for q35 1 ahci controller is built-in */ ahci = pci_create_simple_multifunction(host_bus, PCI_DEVFN(ICH9_SATA1_DEV, @@ -262,7 +262,7 @@ static void pc_q35_init(MachineState *machine) ehci_create_ich9_with_companions(host_bus, 0x1d); } - if (pcms->smbus) { + if (pcms->smbus_enabled) { /* TODO: Populate SPD eeprom data. */ smbus_eeprom_init(ich9_smb_init(host_bus, PCI_DEVFN(ICH9_SMB_DEV, ICH9_SMB_FUNC), @@ -311,19 +311,28 @@ static void pc_q35_machine_options(MachineClass *m) m->max_cpus = 288; } -static void pc_q35_3_1_machine_options(MachineClass *m) +static void pc_q35_4_0_machine_options(MachineClass *m) { pc_q35_machine_options(m); m->alias = "q35"; } +DEFINE_Q35_MACHINE(v4_0, "pc-q35-4.0", NULL, + pc_q35_4_0_machine_options); + +static void pc_q35_3_1_machine_options(MachineClass *m) +{ + pc_q35_4_0_machine_options(m); + m->alias = NULL; + SET_MACHINE_COMPAT(m, PC_COMPAT_3_1); +} + DEFINE_Q35_MACHINE(v3_1, "pc-q35-3.1", NULL, pc_q35_3_1_machine_options); static void pc_q35_3_0_machine_options(MachineClass *m) { pc_q35_3_1_machine_options(m); - m->alias = NULL; SET_MACHINE_COMPAT(m, PC_COMPAT_3_0); } diff --git a/hw/mem/memory-device.c b/hw/mem/memory-device.c index 7de1ccd497..8be63c8032 100644 --- a/hw/mem/memory-device.c +++ b/hw/mem/memory-device.c @@ -85,7 +85,8 @@ static void memory_device_check_addable(MachineState *ms, uint64_t size, /* will we exceed the total amount of memory specified */ memory_device_used_region_size(OBJECT(ms), &used_region_size); - if (used_region_size + size > ms->maxram_size - ms->ram_size) { + if (used_region_size + size < used_region_size || + used_region_size + size > ms->maxram_size - ms->ram_size) { error_setg(errp, "not enough space, currently 0x%" PRIx64 " in use of total space for memory devices 0x" RAM_ADDR_FMT, used_region_size, ms->maxram_size - ms->ram_size); @@ -120,7 +121,7 @@ static uint64_t memory_device_get_free_addr(MachineState *ms, g_assert(address_space_end >= address_space_start); /* address_space_start indicates the maximum alignment we expect */ - if (QEMU_ALIGN_UP(address_space_start, align) != address_space_start) { + if (!QEMU_IS_ALIGNED(address_space_start, align)) { error_setg(errp, "the alignment (0x%" PRIx64 ") is not supported", align); return 0; @@ -131,13 +132,13 @@ static uint64_t memory_device_get_free_addr(MachineState *ms, return 0; } - if (hint && QEMU_ALIGN_UP(*hint, align) != *hint) { + if (hint && !QEMU_IS_ALIGNED(*hint, align)) { error_setg(errp, "address must be aligned to 0x%" PRIx64 " bytes", align); return 0; } - if (QEMU_ALIGN_UP(size, align) != size) { + if (!QEMU_IS_ALIGNED(size, align)) { error_setg(errp, "backend memory size must be multiple of 0x%" PRIx64, align); return 0; diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index ecfd10a29a..8213659602 100644 --- a/hw/misc/ivshmem.c +++ b/hw/misc/ivshmem.c @@ -1280,7 +1280,7 @@ static void desugar_shm(IVShmemState *s) object_property_add_child(OBJECT(s), "internal-shm-backend", obj, &error_abort); object_unref(obj); - user_creatable_complete(obj, &error_abort); + user_creatable_complete(USER_CREATABLE(obj), &error_abort); s->hostmem = MEMORY_BACKEND(obj); } diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 7afd1a175b..55be0f56cb 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -3939,16 +3939,10 @@ static const TypeInfo spapr_machine_info = { mc->is_default = 1; \ } \ } \ - static void spapr_machine_##suffix##_instance_init(Object *obj) \ - { \ - MachineState *machine = MACHINE(obj); \ - spapr_machine_##suffix##_instance_options(machine); \ - } \ static const TypeInfo spapr_machine_##suffix##_info = { \ .name = MACHINE_TYPE_NAME("pseries-" verstr), \ .parent = TYPE_SPAPR_MACHINE, \ .class_init = spapr_machine_##suffix##_class_init, \ - .instance_init = spapr_machine_##suffix##_instance_init, \ }; \ static void spapr_machine_register_##suffix(void) \ { \ @@ -3956,19 +3950,29 @@ static const TypeInfo spapr_machine_info = { } \ type_init(spapr_machine_register_##suffix) - /* - * pseries-3.1 +/* + * pseries-4.0 */ -static void spapr_machine_3_1_instance_options(MachineState *machine) +static void spapr_machine_4_0_class_options(MachineClass *mc) { + /* Defaults for the latest behaviour inherited from the base class */ } +DEFINE_SPAPR_MACHINE(4_0, "4.0", true); + +/* + * pseries-3.1 + */ +#define SPAPR_COMPAT_3_1 \ + HW_COMPAT_3_1 + static void spapr_machine_3_1_class_options(MachineClass *mc) { - /* Defaults for the latest behaviour inherited from the base class */ + spapr_machine_4_0_class_options(mc); + SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_3_1); } -DEFINE_SPAPR_MACHINE(3_1, "3.1", true); +DEFINE_SPAPR_MACHINE(3_1, "3.1", false); /* * pseries-3.0 @@ -3976,11 +3980,6 @@ DEFINE_SPAPR_MACHINE(3_1, "3.1", true); #define SPAPR_COMPAT_3_0 \ HW_COMPAT_3_0 -static void spapr_machine_3_0_instance_options(MachineState *machine) -{ - spapr_machine_3_1_instance_options(machine); -} - static void spapr_machine_3_0_class_options(MachineClass *mc) { sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc); @@ -4010,11 +4009,6 @@ DEFINE_SPAPR_MACHINE(3_0, "3.0", false); .value = "on", \ }, -static void spapr_machine_2_12_instance_options(MachineState *machine) -{ - spapr_machine_3_0_instance_options(machine); -} - static void spapr_machine_2_12_class_options(MachineClass *mc) { sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc); @@ -4032,11 +4026,6 @@ static void spapr_machine_2_12_class_options(MachineClass *mc) DEFINE_SPAPR_MACHINE(2_12, "2.12", false); -static void spapr_machine_2_12_sxxm_instance_options(MachineState *machine) -{ - spapr_machine_2_12_instance_options(machine); -} - static void spapr_machine_2_12_sxxm_class_options(MachineClass *mc) { sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc); @@ -4055,11 +4044,6 @@ DEFINE_SPAPR_MACHINE(2_12_sxxm, "2.12-sxxm", false); #define SPAPR_COMPAT_2_11 \ HW_COMPAT_2_11 -static void spapr_machine_2_11_instance_options(MachineState *machine) -{ - spapr_machine_2_12_instance_options(machine); -} - static void spapr_machine_2_11_class_options(MachineClass *mc) { sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc); @@ -4077,11 +4061,6 @@ DEFINE_SPAPR_MACHINE(2_11, "2.11", false); #define SPAPR_COMPAT_2_10 \ HW_COMPAT_2_10 -static void spapr_machine_2_10_instance_options(MachineState *machine) -{ - spapr_machine_2_11_instance_options(machine); -} - static void spapr_machine_2_10_class_options(MachineClass *mc) { spapr_machine_2_11_class_options(mc); @@ -4101,11 +4080,6 @@ DEFINE_SPAPR_MACHINE(2_10, "2.10", false); .value = "on", \ }, \ -static void spapr_machine_2_9_instance_options(MachineState *machine) -{ - spapr_machine_2_10_instance_options(machine); -} - static void spapr_machine_2_9_class_options(MachineClass *mc) { sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc); @@ -4130,11 +4104,6 @@ DEFINE_SPAPR_MACHINE(2_9, "2.9", false); .value = "off", \ }, -static void spapr_machine_2_8_instance_options(MachineState *machine) -{ - spapr_machine_2_9_instance_options(machine); -} - static void spapr_machine_2_8_class_options(MachineClass *mc) { spapr_machine_2_9_class_options(mc); @@ -4219,20 +4188,13 @@ static void phb_placement_2_7(sPAPRMachineState *spapr, uint32_t index, */ } -static void spapr_machine_2_7_instance_options(MachineState *machine) -{ - sPAPRMachineState *spapr = SPAPR_MACHINE(machine); - - spapr_machine_2_8_instance_options(machine); - spapr->use_hotplug_event_source = false; -} - static void spapr_machine_2_7_class_options(MachineClass *mc) { sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc); spapr_machine_2_8_class_options(mc); mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("power7_v2.3"); + mc->default_machine_opts = "modern-hotplug-events=off"; SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_7); smc->phb_placement = phb_placement_2_7; } @@ -4250,11 +4212,6 @@ DEFINE_SPAPR_MACHINE(2_7, "2.7", false); .value = stringify(off),\ }, -static void spapr_machine_2_6_instance_options(MachineState *machine) -{ - spapr_machine_2_7_instance_options(machine); -} - static void spapr_machine_2_6_class_options(MachineClass *mc) { spapr_machine_2_7_class_options(mc); @@ -4275,11 +4232,6 @@ DEFINE_SPAPR_MACHINE(2_6, "2.6", false); .value = "off", \ }, -static void spapr_machine_2_5_instance_options(MachineState *machine) -{ - spapr_machine_2_6_instance_options(machine); -} - static void spapr_machine_2_5_class_options(MachineClass *mc) { sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc); @@ -4297,11 +4249,6 @@ DEFINE_SPAPR_MACHINE(2_5, "2.5", false); #define SPAPR_COMPAT_2_4 \ HW_COMPAT_2_4 -static void spapr_machine_2_4_instance_options(MachineState *machine) -{ - spapr_machine_2_5_instance_options(machine); -} - static void spapr_machine_2_4_class_options(MachineClass *mc) { sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc); @@ -4324,11 +4271,6 @@ DEFINE_SPAPR_MACHINE(2_4, "2.4", false); .value = "off",\ }, -static void spapr_machine_2_3_instance_options(MachineState *machine) -{ - spapr_machine_2_4_instance_options(machine); -} - static void spapr_machine_2_3_class_options(MachineClass *mc) { spapr_machine_2_4_class_options(mc); @@ -4348,16 +4290,11 @@ DEFINE_SPAPR_MACHINE(2_3, "2.3", false); .value = "0x20000000",\ }, -static void spapr_machine_2_2_instance_options(MachineState *machine) -{ - spapr_machine_2_3_instance_options(machine); - machine->suppress_vmdesc = true; -} - static void spapr_machine_2_2_class_options(MachineClass *mc) { spapr_machine_2_3_class_options(mc); SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_2); + mc->default_machine_opts = "modern-hotplug-events=off,suppress-vmdesc=on"; } DEFINE_SPAPR_MACHINE(2_2, "2.2", false); @@ -4367,11 +4304,6 @@ DEFINE_SPAPR_MACHINE(2_2, "2.2", false); #define SPAPR_COMPAT_2_1 \ HW_COMPAT_2_1 -static void spapr_machine_2_1_instance_options(MachineState *machine) -{ - spapr_machine_2_2_instance_options(machine); -} - static void spapr_machine_2_1_class_options(MachineClass *mc) { spapr_machine_2_2_class_options(mc); diff --git a/hw/timer/sun4v-rtc.c b/hw/timer/sun4v-rtc.c index 4e7f6a1eff..b93cbd6a81 100644 --- a/hw/timer/sun4v-rtc.c +++ b/hw/timer/sun4v-rtc.c @@ -41,7 +41,7 @@ static uint64_t sun4v_rtc_read(void *opaque, hwaddr addr, static void sun4v_rtc_write(void *opaque, hwaddr addr, uint64_t val, unsigned size) { - trace_sun4v_rtc_read(addr, val); + trace_sun4v_rtc_write(addr, val); } static const MemoryRegionOps sun4v_rtc_ops = { diff --git a/hw/virtio/virtio-rng.c b/hw/virtio/virtio-rng.c index 855f1b41d1..30493a2586 100644 --- a/hw/virtio/virtio-rng.c +++ b/hw/virtio/virtio-rng.c @@ -191,7 +191,7 @@ static void virtio_rng_device_realize(DeviceState *dev, Error **errp) if (vrng->conf.rng == NULL) { vrng->conf.default_backend = RNG_RANDOM(object_new(TYPE_RNG_RANDOM)); - user_creatable_complete(OBJECT(vrng->conf.default_backend), + user_creatable_complete(USER_CREATABLE(vrng->conf.default_backend), &local_err); if (local_err) { error_propagate(errp, local_err); |