qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [Qemu-arm] [PATCH v3 5/5] make sure that we aren't over


From: Philippe Mathieu-Daudé
Subject: Re: [Qemu-devel] [Qemu-arm] [PATCH v3 5/5] make sure that we aren't overwriting mc->get_hotplug_handler by accident
Date: Tue, 1 May 2018 21:45:01 -0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

On 05/01/2018 09:08 AM, Igor Mammedov wrote:
> Suggested-by: Eduardo Habkost <address@hidden>
> Signed-off-by: Igor Mammedov <address@hidden>

Reviewed-by: Philippe Mathieu-Daudé <address@hidden>

> ---
>  hw/arm/virt.c              | 1 +
>  hw/i386/pc.c               | 1 +
>  hw/ppc/e500plat.c          | 1 +
>  hw/ppc/spapr.c             | 1 +
>  hw/s390x/s390-virtio-ccw.c | 1 +
>  5 files changed, 5 insertions(+)
> 
> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
> index 71661c6..9b0a931 100644
> --- a/hw/arm/virt.c
> +++ b/hw/arm/virt.c
> @@ -1578,6 +1578,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;
>  }
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index 018fd8d..019be25 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
> @@ -2355,6 +2355,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;
> diff --git a/hw/ppc/e500plat.c b/hw/ppc/e500plat.c
> index 1a469ba..d8e3f20 100644
> --- a/hw/ppc/e500plat.c
> +++ b/hw/ppc/e500plat.c
> @@ -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;
>  
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index b35aff5..5b2b00a 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -3995,6 +3995,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;
> diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
> index 435f7c9..905583a 100644
> --- a/hw/s390x/s390-virtio-ccw.c
> +++ b/hw/s390x/s390-virtio-ccw.c
> @@ -476,6 +476,7 @@ static void ccw_machine_class_init(ObjectClass *oc, void 
> *data)
>      mc->use_sclp = 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;
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]