[Qemu-devel] [PATCH v4 07/14] spapr: route all memory devices through the machine hotplug handler

David Hildenbrand posted 14 patches 7 years, 5 months ago
[Qemu-devel] [PATCH v4 07/14] spapr: route all memory devices through the machine hotplug handler
Posted by David Hildenbrand 7 years, 5 months ago
Necessary to hotplug them cleanly later.

Signed-off-by: David Hildenbrand <david@redhat.com>
---
 hw/ppc/spapr.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index b7c5c95f7a..2f315f963b 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -3666,6 +3666,7 @@ static HotplugHandler *spapr_get_hotplug_handler(MachineState *machine,
                                                  DeviceState *dev)
 {
     if (object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM) ||
+        object_dynamic_cast(OBJECT(dev), TYPE_MEMORY_DEVICE) ||
         object_dynamic_cast(OBJECT(dev), TYPE_SPAPR_CPU_CORE)) {
         return HOTPLUG_HANDLER(machine);
     }
-- 
2.14.3


Re: [Qemu-devel] [PATCH v4 07/14] spapr: route all memory devices through the machine hotplug handler
Posted by David Gibson 7 years, 4 months ago
On Thu, May 17, 2018 at 10:15:20AM +0200, David Hildenbrand wrote:
> Necessary to hotplug them cleanly later.
> 
> Signed-off-by: David Hildenbrand <david@redhat.com>

As for PC, I think it would be nicer to drop the explicit check
against PC_DIMM, since it is covered by MEMORY_DEVICE.

> ---
>  hw/ppc/spapr.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index b7c5c95f7a..2f315f963b 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -3666,6 +3666,7 @@ static HotplugHandler *spapr_get_hotplug_handler(MachineState *machine,
>                                                   DeviceState *dev)
>  {
>      if (object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM) ||
> +        object_dynamic_cast(OBJECT(dev), TYPE_MEMORY_DEVICE) ||
>          object_dynamic_cast(OBJECT(dev), TYPE_SPAPR_CPU_CORE)) {
>          return HOTPLUG_HANDLER(machine);
>      }

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
Re: [Qemu-devel] [PATCH v4 07/14] spapr: route all memory devices through the machine hotplug handler
Posted by David Hildenbrand 7 years, 4 months ago
On 05.06.2018 03:09, David Gibson wrote:
> On Thu, May 17, 2018 at 10:15:20AM +0200, David Hildenbrand wrote:
>> Necessary to hotplug them cleanly later.
>>
>> Signed-off-by: David Hildenbrand <david@redhat.com>
> 
> As for PC, I think it would be nicer to drop the explicit check
> against PC_DIMM, since it is covered by MEMORY_DEVICE.

Indeed, already did that.

> 
>> ---
>>  hw/ppc/spapr.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
>> index b7c5c95f7a..2f315f963b 100644
>> --- a/hw/ppc/spapr.c
>> +++ b/hw/ppc/spapr.c
>> @@ -3666,6 +3666,7 @@ static HotplugHandler *spapr_get_hotplug_handler(MachineState *machine,
>>                                                   DeviceState *dev)
>>  {
>>      if (object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM) ||
>> +        object_dynamic_cast(OBJECT(dev), TYPE_MEMORY_DEVICE) ||
>>          object_dynamic_cast(OBJECT(dev), TYPE_SPAPR_CPU_CORE)) {
>>          return HOTPLUG_HANDLER(machine);
>>      }
> 


-- 

Thanks,

David / dhildenb