@@ -763,7 +763,6 @@ static void pflash_cfi01_realize(DeviceState *dev, Error **errp)
if (pfl->blk) {
if (!blk_check_size_and_read_all(pfl->blk, pfl->storage, total_len,
errp)) {
- vmstate_unregister_ram(&pfl->mem, DEVICE(pfl));
return;
}
}
@@ -810,7 +810,6 @@ static void pflash_cfi02_realize(DeviceState *dev, Error **errp)
if (pfl->blk) {
if (!blk_check_size_and_read_all(pfl->blk, pfl->storage,
pfl->chip_len, errp)) {
- vmstate_unregister_ram(&pfl->orig_mem, DEVICE(pfl));
return;
}
}
@@ -76,12 +76,7 @@ void pc_dimm_plug(PCDIMMDevice *dimm, MachineState *machine, Error **errp)
void pc_dimm_unplug(PCDIMMDevice *dimm, MachineState *machine)
{
- PCDIMMDeviceClass *ddc = PC_DIMM_GET_CLASS(dimm);
- MemoryRegion *vmstate_mr = ddc->get_vmstate_memory_region(dimm,
- &error_abort);
-
memory_device_unplug(MEMORY_DEVICE(dimm), machine);
- vmstate_unregister_ram(vmstate_mr, DEVICE(dimm));
}
static int pc_dimm_slot2bitmap(Object *obj, void *opaque)
@@ -973,8 +973,6 @@ static void ivshmem_exit(PCIDevice *dev)
fd = memory_region_get_fd(s->ivshmem_bar2);
close(fd);
}
-
- vmstate_unregister_ram(s->ivshmem_bar2, DEVICE(dev));
}
if (s->hostmem) {
@@ -2371,7 +2371,6 @@ static void pci_del_option_rom(PCIDevice *pdev)
if (!pdev->has_rom)
return;
- vmstate_unregister_ram(&pdev->rom, &pdev->qdev);
pdev->has_rom = false;
}
@@ -1176,7 +1176,6 @@ void vmstate_unregister(DeviceState *dev, const VMStateDescription *vmsd,
struct MemoryRegion;
void vmstate_register_ram(struct MemoryRegion *memory, DeviceState *dev);
-void vmstate_unregister_ram(struct MemoryRegion *memory, DeviceState *dev);
void vmstate_register_ram_global(struct MemoryRegion *memory);
bool vmstate_check_only_migratable(const VMStateDescription *vmsd);
@@ -2915,12 +2915,6 @@ void vmstate_register_ram(MemoryRegion *mr, DeviceState *dev)
qemu_ram_set_migratable(mr->ram_block);
}
-void vmstate_unregister_ram(MemoryRegion *mr, DeviceState *dev)
-{
- qemu_ram_unset_idstr(mr->ram_block);
- qemu_ram_unset_migratable(mr->ram_block);
-}
-
void vmstate_register_ram_global(MemoryRegion *mr)
{
vmstate_register_ram(mr, NULL);
Disclaimer: This is just an RFC. It's more an illustration-patch than real patch. And I didn't verify the possible side effects! Currently, it's possible to call this function during migration. And so, to have a race condition between migration thread and main thread. It seems that all calls of this function are just before MemoryRegion deletion. Thus, there is no effect of this function actually. Signed-off-by: Yury Kotov <yury-kotov@yandex-team.ru> --- hw/block/pflash_cfi01.c | 1 - hw/block/pflash_cfi02.c | 1 - hw/mem/pc-dimm.c | 5 ----- hw/misc/ivshmem.c | 2 -- hw/pci/pci.c | 1 - include/migration/vmstate.h | 1 - migration/savevm.c | 6 ------ 7 files changed, 17 deletions(-)