make sure that we aren't overwriting mc->get_hotplug_handler by accident
authorIgor Mammedov <imammedo@redhat.com>
Thu, 10 May 2018 17:10:56 +0000 (18:10 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 10 May 2018 17:10:56 +0000 (18:10 +0100)
Suggested-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 1525691524-32265-5-git-send-email-imammedo@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/arm/virt.c
hw/i386/pc.c
hw/ppc/e500plat.c
hw/ppc/spapr.c
hw/s390x/s390-virtio-ccw.c

index 6710be226f4bf09356b45f378fa9246a9fe551b3..a3a28e20e8cb92d0c9a5127020d076eb3ae5ea37 100644 (file)
@@ -1669,6 +1669,7 @@ static void virt_machine_class_init(ObjectClass *oc, void *data)
     mc->cpu_index_to_instance_props = virt_cpu_index_to_props;
     mc->default_cpu_type = ARM_CPU_TYPE_NAME("cortex-a15");
     mc->get_default_cpu_node_id = virt_get_default_cpu_node_id;
+    assert(!mc->get_hotplug_handler);
     mc->get_hotplug_handler = virt_machine_get_hotplug_handler;
     hc->plug = virt_machine_device_plug_cb;
 }
index b2374febbbea58acdcc29ca99837179259367ff3..d768930d02d29bba31740393b7b70ad1ae9c8ada 100644 (file)
@@ -2350,6 +2350,7 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
     pcmc->acpi_data_size = 0x20000 + 0x8000;
     pcmc->save_tsc_khz = true;
     pcmc->linuxboot_dma_enabled = true;
+    assert(!mc->get_hotplug_handler);
     mc->get_hotplug_handler = pc_get_hotpug_handler;
     mc->cpu_index_to_instance_props = pc_cpu_index_to_props;
     mc->get_default_cpu_node_id = pc_get_default_cpu_node_id;
index 1a469ba69f5f01c3f03b6879b98a60d17d84fbae..d8e3f2066e7b4110c71cc503447b073ce40f84be 100644 (file)
@@ -74,6 +74,7 @@ static void e500plat_machine_class_init(ObjectClass *oc, void *data)
     HotplugHandlerClass *hc = HOTPLUG_HANDLER_CLASS(oc);
     MachineClass *mc = MACHINE_CLASS(oc);
 
+    assert(!mc->get_hotplug_handler);
     mc->get_hotplug_handler = e500plat_machine_get_hotpug_handler;
     hc->plug = e500plat_machine_device_plug_cb;
 
index a1abcba6ad31809c81becf0fbf437bbf00370f4f..ebf30dd60b0a09163ffd84ec6ff5af3de1c0bf1f 100644 (file)
@@ -3980,6 +3980,7 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data)
     mc->kvm_type = spapr_kvm_type;
     machine_class_allow_dynamic_sysbus_dev(mc, TYPE_SPAPR_PCI_HOST_BRIDGE);
     mc->pci_allow_0_address = true;
+    assert(!mc->get_hotplug_handler);
     mc->get_hotplug_handler = spapr_get_hotplug_handler;
     hc->pre_plug = spapr_machine_device_pre_plug;
     hc->plug = spapr_machine_device_plug;
index 100dfdc96d29d4396d5c3ba35463a68e71ab438b..5796e24bd81b715c67cf18749fa60ed900baafbd 100644 (file)
@@ -491,6 +491,7 @@ static void ccw_machine_class_init(ObjectClass *oc, void *data)
     mc->no_sdcard = 1;
     mc->max_cpus = S390_MAX_CPUS;
     mc->has_hotpluggable_cpus = true;
+    assert(!mc->get_hotplug_handler);
     mc->get_hotplug_handler = s390_get_hotplug_handler;
     mc->cpu_index_to_instance_props = s390_cpu_index_to_props;
     mc->possible_cpu_arch_ids = s390_possible_cpu_arch_ids;