aboutsummaryrefslogtreecommitdiff
path: root/hw/mem/pc-dimm.c
diff options
context:
space:
mode:
authorShivaprasad G Bhat <sbhat@linux.ibm.com>2022-02-18 08:34:13 +0100
committerCédric Le Goater <clg@kaod.org>2022-02-18 08:34:13 +0100
commit3e35960bf130f759c1b6d72f6a8c08039c08ec16 (patch)
tree7067fee7e1e0888e88f5808bc0e71e27c90b81c1 /hw/mem/pc-dimm.c
parentc13b8e9973635f34f3ce4356af27a311c993729c (diff)
nvdimm: Add realize, unrealize callbacks to NVDIMMDevice class
A new subclass inheriting NVDIMMDevice is going to be introduced in subsequent patches. The new subclass uses the realize and unrealize callbacks. Add them on NVDIMMClass to appropriately call them as part of plug-unplug. Signed-off-by: Shivaprasad G Bhat <sbhat@linux.ibm.com> Acked-by: Daniel Henrique Barboza <danielhb413@gmail.com> Message-Id: <164396253158.109112.1926755104259023743.stgit@ltczzess4.aus.stglabs.ibm.com> Signed-off-by: Cédric Le Goater <clg@kaod.org>
Diffstat (limited to 'hw/mem/pc-dimm.c')
-rw-r--r--hw/mem/pc-dimm.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c
index 48b913aba6..03bd0dd60e 100644
--- a/hw/mem/pc-dimm.c
+++ b/hw/mem/pc-dimm.c
@@ -216,6 +216,11 @@ static void pc_dimm_realize(DeviceState *dev, Error **errp)
static void pc_dimm_unrealize(DeviceState *dev)
{
PCDIMMDevice *dimm = PC_DIMM(dev);
+ PCDIMMDeviceClass *ddc = PC_DIMM_GET_CLASS(dimm);
+
+ if (ddc->unrealize) {
+ ddc->unrealize(dimm);
+ }
host_memory_backend_set_mapped(dimm->hostmem, false);
}