summaryrefslogtreecommitdiff
path: root/hw/mem/pc-dimm.c
diff options
context:
space:
mode:
authorXiao Guangrong <guangrong.xiao@linux.intel.com>2016-05-20 16:19:59 +0800
committerMichael S. Tsirkin <mst@redhat.com>2016-06-07 15:39:28 +0300
commit9f318f8f7e689b9653b42bac73047f9719a1f34e (patch)
tree324165d4e5668389bd2721699a7ce3180a8a8f89 /hw/mem/pc-dimm.c
parent3c3e88a814ef4eb8b2f8bf81863baec24838d998 (diff)
downloadqemu-9f318f8f7e689b9653b42bac73047f9719a1f34e.tar.gz
pc-dimm: introduce realize callback
nvdimm needs to check if the backend memory is large enough to contain label data and init its memory region when the device is realized, so introduce realize callback which is called after common dimm has been realize Signed-off-by: Xiao Guangrong <guangrong.xiao@linux.intel.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
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 70b9451654..6de2275986 100644
--- a/hw/mem/pc-dimm.c
+++ b/hw/mem/pc-dimm.c
@@ -400,6 +400,7 @@ static void pc_dimm_init(Object *obj)
static void pc_dimm_realize(DeviceState *dev, Error **errp)
{
PCDIMMDevice *dimm = PC_DIMM(dev);
+ PCDIMMDeviceClass *ddc = PC_DIMM_GET_CLASS(dimm);
if (!dimm->hostmem) {
error_setg(errp, "'" PC_DIMM_MEMDEV_PROP "' property is not set");
@@ -412,6 +413,10 @@ static void pc_dimm_realize(DeviceState *dev, Error **errp)
dimm->node, nb_numa_nodes ? nb_numa_nodes : 1);
return;
}
+
+ if (ddc->realize) {
+ ddc->realize(dimm, errp);
+ }
}
static MemoryRegion *pc_dimm_get_memory_region(PCDIMMDevice *dimm)