@@ -426,6 +426,7 @@ static void dimm_init(Object *obj)
static void dimm_realize(DeviceState *dev, Error **errp)
{
DIMMDevice *dimm = DIMM(dev);
+ DIMMDeviceClass *ddc = DIMM_GET_CLASS(dimm);
if (!dimm->hostmem) {
error_setg(errp, "'" DIMM_MEMDEV_PROP "' property is not set");
@@ -438,6 +439,10 @@ static void dimm_realize(DeviceState *dev, Error **errp)
dimm->node, nb_numa_nodes ? nb_numa_nodes : 1);
return;
}
+
+ if (ddc->realize) {
+ ddc->realize(dimm, errp);
+ }
}
static void dimm_class_init(ObjectClass *oc, void *data)
@@ -65,6 +65,7 @@ typedef struct DIMMDeviceClass {
DeviceClass parent_class;
/* public */
+ void (*realize)(DIMMDevice *dimm, Error **errp);
MemoryRegion *(*get_memory_region)(DIMMDevice *dimm);
} DIMMDeviceClass;