diff options
author | David Hildenbrand <david@redhat.com> | 2018-04-23 18:51:18 +0200 |
---|---|---|
committer | Eduardo Habkost <ehabkost@redhat.com> | 2018-05-07 10:00:02 -0300 |
commit | acc7fa17e6fe96bd68ad9af04fde5091383ef25e (patch) | |
tree | 47e3dd50c4d2c2cbb48645ac2a18d0bdcd3f32da /hw/i386 | |
parent | b0c14ec4efe912ae6f14a4802574f7b6b6db0648 (diff) |
pc-dimm: no need to pass the memory region
We can just query it ourselves. When unplugging, we should always be
able to the region (as it was previously plugged). E.g. PPC already
assumed that and used &error_abort.
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20180423165126.15441-4-david@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'hw/i386')
-rw-r--r-- | hw/i386/pc.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 0aa7885798..e337c6552d 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1715,8 +1715,7 @@ static void pc_dimm_plug(HotplugHandler *hotplug_dev, goto out; } - pc_dimm_memory_plug(dev, MACHINE(pcms)->device_memory, mr, align, - &local_err); + pc_dimm_memory_plug(dev, MACHINE(pcms)->device_memory, align, &local_err); if (local_err) { goto out; } @@ -1766,17 +1765,9 @@ static void pc_dimm_unplug(HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { PCMachineState *pcms = PC_MACHINE(hotplug_dev); - PCDIMMDevice *dimm = PC_DIMM(dev); - PCDIMMDeviceClass *ddc = PC_DIMM_GET_CLASS(dimm); - MemoryRegion *mr; HotplugHandlerClass *hhc; Error *local_err = NULL; - mr = ddc->get_memory_region(dimm, &local_err); - if (local_err) { - goto out; - } - hhc = HOTPLUG_HANDLER_GET_CLASS(pcms->acpi_dev); hhc->unplug(HOTPLUG_HANDLER(pcms->acpi_dev), dev, &local_err); @@ -1784,7 +1775,7 @@ static void pc_dimm_unplug(HotplugHandler *hotplug_dev, goto out; } - pc_dimm_memory_unplug(dev, MACHINE(pcms)->device_memory, mr); + pc_dimm_memory_unplug(dev, MACHINE(pcms)->device_memory); object_unparent(OBJECT(dev)); out: |