On Wed, Feb 20, 2019 at 02:26:16AM +0100, Philippe Mathieu-Daudé wrote: >On 2/20/19 1:51 AM, Wei Yang wrote: >> realize callback in introduced to check if the backend memory is large >> enough to contain label data and init its memory region, while this task >> is handled in pre_plug stage. >> >> Now it's time to remove it. > >Good cleanup! >
Glad you like it :-) >Michael, can you add: > >"This reverts commit 9f318f8f7e689b9653b42bac73047f9719a1f34e." > >Thanks, > >Phil. > >> >> Signed-off-by: Wei Yang <richardw.y...@linux.intel.com> > >Reviewed-by: Philippe Mathieu-Daudé <phi...@redhat.com> > >> --- >> hw/mem/pc-dimm.c | 5 ----- >> include/hw/mem/pc-dimm.h | 3 --- >> 2 files changed, 8 deletions(-) >> >> diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c >> index 152400b1fc..5832c0ba92 100644 >> --- a/hw/mem/pc-dimm.c >> +++ b/hw/mem/pc-dimm.c >> @@ -159,7 +159,6 @@ 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"); >> @@ -178,10 +177,6 @@ static void pc_dimm_realize(DeviceState *dev, Error >> **errp) >> return; >> } >> >> - if (ddc->realize) { >> - ddc->realize(dimm, errp); >> - } >> - >> host_memory_backend_set_mapped(dimm->hostmem, true); >> } >> >> diff --git a/include/hw/mem/pc-dimm.h b/include/hw/mem/pc-dimm.h >> index 01436b9f50..d18f8246b7 100644 >> --- a/include/hw/mem/pc-dimm.h >> +++ b/include/hw/mem/pc-dimm.h >> @@ -59,8 +59,6 @@ typedef struct PCDIMMDevice { >> >> /** >> * PCDIMMDeviceClass: >> - * @realize: called after common dimm is realized so that the dimm based >> - * devices get the chance to do specified operations. >> * @get_vmstate_memory_region: returns #MemoryRegion which indicates the >> * memory of @dimm should be kept during live migration. Will not fail >> * after the device was realized. >> @@ -70,7 +68,6 @@ typedef struct PCDIMMDeviceClass { >> DeviceClass parent_class; >> >> /* public */ >> - void (*realize)(PCDIMMDevice *dimm, Error **errp); >> MemoryRegion *(*get_vmstate_memory_region)(PCDIMMDevice *dimm, >> Error **errp); >> } PCDIMMDeviceClass; >> -- Wei Yang Help you, Help me