aboutsummaryrefslogtreecommitdiff
path: root/hw/ppc
diff options
context:
space:
mode:
authorDavid Hildenbrand <david@redhat.com>2018-04-23 18:51:18 +0200
committerEduardo Habkost <ehabkost@redhat.com>2018-05-07 10:00:02 -0300
commitacc7fa17e6fe96bd68ad9af04fde5091383ef25e (patch)
tree47e3dd50c4d2c2cbb48645ac2a18d0bdcd3f32da /hw/ppc
parentb0c14ec4efe912ae6f14a4802574f7b6b6db0648 (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/ppc')
-rw-r--r--hw/ppc/spapr.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 30d634a8a3..d4917e89c6 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -3153,7 +3153,7 @@ static void spapr_memory_plug(HotplugHandler *hotplug_dev, DeviceState *dev,
align = memory_region_get_alignment(mr);
size = memory_region_size(mr);
- pc_dimm_memory_plug(dev, MACHINE(ms)->device_memory, mr, align, &local_err);
+ pc_dimm_memory_plug(dev, MACHINE(ms)->device_memory, align, &local_err);
if (local_err) {
goto out;
}
@@ -3174,7 +3174,7 @@ static void spapr_memory_plug(HotplugHandler *hotplug_dev, DeviceState *dev,
return;
out_unplug:
- pc_dimm_memory_unplug(dev, MACHINE(ms)->device_memory, mr);
+ pc_dimm_memory_unplug(dev, MACHINE(ms)->device_memory);
out:
error_propagate(errp, local_err);
}
@@ -3292,9 +3292,6 @@ static sPAPRDIMMState *spapr_recover_pending_dimm_state(sPAPRMachineState *ms,
void spapr_lmb_release(DeviceState *dev)
{
sPAPRMachineState *spapr = SPAPR_MACHINE(qdev_get_hotplug_handler(dev));
- PCDIMMDevice *dimm = PC_DIMM(dev);
- PCDIMMDeviceClass *ddc = PC_DIMM_GET_CLASS(dimm);
- MemoryRegion *mr = ddc->get_memory_region(dimm, &error_abort);
sPAPRDIMMState *ds = spapr_pending_dimm_unplugs_find(spapr, PC_DIMM(dev));
/* This information will get lost if a migration occurs
@@ -3314,7 +3311,7 @@ void spapr_lmb_release(DeviceState *dev)
* Now that all the LMBs have been removed by the guest, call the
* pc-dimm unplug handler to cleanup up the pc-dimm device.
*/
- pc_dimm_memory_unplug(dev, MACHINE(spapr)->device_memory, mr);
+ pc_dimm_memory_unplug(dev, MACHINE(spapr)->device_memory);
object_unparent(OBJECT(dev));
spapr_pending_dimm_unplugs_remove(spapr, ds);
}