qemu-ppc
[Top][All Lists]
Advanced

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

Re: [Qemu-ppc] [PATCH v3 22/22] pc: support for virtio-pmem


From: Dr. David Alan Gilbert
Subject: Re: [Qemu-ppc] [PATCH v3 22/22] pc: support for virtio-pmem
Date: Fri, 21 Sep 2018 17:00:31 +0100
User-agent: Mutt/1.10.1 (2018-07-13)

* David Hildenbrand (address@hidden) wrote:
> Compile virtio-pmem for x86 and properly hotplug virtio-pmem devices
> (memory-device part) from our pc machine hotplug handler.
> 
> Signed-off-by: David Hildenbrand <address@hidden>

I see a few other places in the pc subdir that have checks for
TYPE_NVDIMM; can you just explain why they are untouched:
  i386/pc.c: pc_memory_unplug_request
  acpi/ich9.c: ich9_pm_device_plug_cb
  acpi/piix4.c:piix4_device_plug_cb

(Not that I understand the detail of those paths, but I just
followed where the existing nvdimm code goes)

Dave

> ---
>  default-configs/i386-softmmu.mak |  1 +
>  hw/i386/pc.c                     | 10 +++++++++-
>  2 files changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/default-configs/i386-softmmu.mak 
> b/default-configs/i386-softmmu.mak
> index 4c1637338b..dfb1e6d63a 100644
> --- a/default-configs/i386-softmmu.mak
> +++ b/default-configs/i386-softmmu.mak
> @@ -51,6 +51,7 @@ CONFIG_APIC=y
>  CONFIG_IOAPIC=y
>  CONFIG_PVPANIC=y
>  CONFIG_MEM_DEVICE=y
> +CONFIG_VIRTIO_PMEM=y
>  CONFIG_DIMM=y
>  CONFIG_NVDIMM=y
>  CONFIG_ACPI_NVDIMM=y
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index 03148450c8..bea043fe23 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
> @@ -74,6 +74,7 @@
>  #include "hw/nmi.h"
>  #include "hw/i386/intel_iommu.h"
>  #include "hw/net/ne2000-isa.h"
> +#include "hw/virtio/virtio-pmem.h"
>  
>  /* debug PC/ISA interrupts */
>  //#define DEBUG_IRQ
> @@ -2013,6 +2014,8 @@ static void 
> pc_machine_device_pre_plug_cb(HotplugHandler *hotplug_dev,
>          pc_memory_pre_plug(hotplug_dev, dev, errp);
>      } else if (object_dynamic_cast(OBJECT(dev), TYPE_CPU)) {
>          pc_cpu_pre_plug(hotplug_dev, dev, errp);
> +    } else if (object_dynamic_cast(OBJECT(dev), TYPE_VIRTIO_PMEM)) {
> +        virtio_pmem_pre_plug(VIRTIO_PMEM(dev), MACHINE(hotplug_dev), errp);
>      }
>  }
>  
> @@ -2023,6 +2026,8 @@ static void pc_machine_device_plug_cb(HotplugHandler 
> *hotplug_dev,
>          pc_memory_plug(hotplug_dev, dev, errp);
>      } else if (object_dynamic_cast(OBJECT(dev), TYPE_CPU)) {
>          pc_cpu_plug(hotplug_dev, dev, errp);
> +    } else if (object_dynamic_cast(OBJECT(dev), TYPE_VIRTIO_PMEM)) {
> +        virtio_pmem_plug(VIRTIO_PMEM(dev), MACHINE(hotplug_dev), errp);
>      }
>  }
>  
> @@ -2046,6 +2051,8 @@ static void pc_machine_device_unplug_cb(HotplugHandler 
> *hotplug_dev,
>          pc_memory_unplug(hotplug_dev, dev, errp);
>      } else if (object_dynamic_cast(OBJECT(dev), TYPE_CPU)) {
>          pc_cpu_unplug_cb(hotplug_dev, dev, errp);
> +    } else if (object_dynamic_cast(OBJECT(dev), TYPE_VIRTIO_PMEM)) {
> +        virtio_pmem_unplug(VIRTIO_PMEM(dev), MACHINE(hotplug_dev), errp);
>      } else {
>          error_setg(errp, "acpi: device unplug for not supported device"
>                     " type: %s", object_get_typename(OBJECT(dev)));
> @@ -2056,7 +2063,8 @@ static HotplugHandler 
> *pc_get_hotpug_handler(MachineState *machine,
>                                               DeviceState *dev)
>  {
>      if (object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM) ||
> -        object_dynamic_cast(OBJECT(dev), TYPE_CPU)) {
> +        object_dynamic_cast(OBJECT(dev), TYPE_CPU) ||
> +        object_dynamic_cast(OBJECT(dev), TYPE_VIRTIO_PMEM)) {
>          return HOTPLUG_HANDLER(machine);
>      }
>  
> -- 
> 2.17.1
> 
--
Dr. David Alan Gilbert / address@hidden / Manchester, UK



reply via email to

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