Skip to content

Commit

Permalink
memory: Rename memory_region_init_ram() to memory_region_init_ram_nom…
Browse files Browse the repository at this point in the history
…igrate()

Rename memory_region_init_ram() to memory_region_init_ram_nomigrate().
This leaves the way clear for us to provide a memory_region_init_ram()
which does handle migration.

Signed-off-by: Peter Maydell <[email protected]>
Reviewed-by: Paolo Bonzini <[email protected]>
Message-id: [email protected]
  • Loading branch information
pm215 committed Jul 14, 2017
1 parent a5c0234 commit 1cfe48c
Show file tree
Hide file tree
Showing 72 changed files with 121 additions and 120 deletions.
2 changes: 1 addition & 1 deletion backends/hostmem-ram.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ ram_backend_memory_alloc(HostMemoryBackend *backend, Error **errp)
}

path = object_get_canonical_path_component(OBJECT(backend));
memory_region_init_ram(&backend->mr, OBJECT(backend), path,
memory_region_init_ram_nomigrate(&backend->mr, OBJECT(backend), path,
backend->size, errp);
g_free(path);
}
Expand Down
2 changes: 1 addition & 1 deletion hw/arm/aspeed_soc.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp)
}

/* SRAM */
memory_region_init_ram(&s->sram, OBJECT(dev), "aspeed.sram",
memory_region_init_ram_nomigrate(&s->sram, OBJECT(dev), "aspeed.sram",
sc->info->sram_size, &err);
if (err) {
error_propagate(errp, err);
Expand Down
4 changes: 2 additions & 2 deletions hw/arm/exynos4210.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ Exynos4210State *exynos4210_init(MemoryRegion *system_mem)
&s->chipid_mem);

/* Internal ROM */
memory_region_init_ram(&s->irom_mem, NULL, "exynos4210.irom",
memory_region_init_ram_nomigrate(&s->irom_mem, NULL, "exynos4210.irom",
EXYNOS4210_IROM_SIZE, &error_fatal);
vmstate_register_ram_global(&s->irom_mem);
memory_region_set_readonly(&s->irom_mem, true);
Expand All @@ -295,7 +295,7 @@ Exynos4210State *exynos4210_init(MemoryRegion *system_mem)
&s->irom_alias_mem);

/* Internal RAM */
memory_region_init_ram(&s->iram_mem, NULL, "exynos4210.iram",
memory_region_init_ram_nomigrate(&s->iram_mem, NULL, "exynos4210.iram",
EXYNOS4210_IRAM_SIZE, &error_fatal);
vmstate_register_ram_global(&s->iram_mem);
memory_region_add_subregion(system_mem, EXYNOS4210_IRAM_BASE_ADDR,
Expand Down
4 changes: 2 additions & 2 deletions hw/arm/exynos4_boards.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ static void exynos4_boards_init_ram(Exynos4BoardState *s,
unsigned long mem_size = ram_size;

if (mem_size > EXYNOS4210_DRAM_MAX_SIZE) {
memory_region_init_ram(&s->dram1_mem, NULL, "exynos4210.dram1",
memory_region_init_ram_nomigrate(&s->dram1_mem, NULL, "exynos4210.dram1",
mem_size - EXYNOS4210_DRAM_MAX_SIZE,
&error_fatal);
vmstate_register_ram_global(&s->dram1_mem);
Expand All @@ -119,7 +119,7 @@ static void exynos4_boards_init_ram(Exynos4BoardState *s,
mem_size = EXYNOS4210_DRAM_MAX_SIZE;
}

memory_region_init_ram(&s->dram0_mem, NULL, "exynos4210.dram0", mem_size,
memory_region_init_ram_nomigrate(&s->dram0_mem, NULL, "exynos4210.dram0", mem_size,
&error_fatal);
vmstate_register_ram_global(&s->dram0_mem);
memory_region_add_subregion(system_mem, EXYNOS4210_DRAM0_BASE_ADDR,
Expand Down
2 changes: 1 addition & 1 deletion hw/arm/fsl-imx25.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp)
&s->rom[1]);

/* initialize internal RAM (128 KB) */
memory_region_init_ram(&s->iram, NULL, "imx25.iram", FSL_IMX25_IRAM_SIZE,
memory_region_init_ram_nomigrate(&s->iram, NULL, "imx25.iram", FSL_IMX25_IRAM_SIZE,
&err);
if (err) {
error_propagate(errp, err);
Expand Down
2 changes: 1 addition & 1 deletion hw/arm/fsl-imx31.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ static void fsl_imx31_realize(DeviceState *dev, Error **errp)
&s->rom);

/* initialize internal RAM (16 KB) */
memory_region_init_ram(&s->iram, NULL, "imx31.iram", FSL_IMX31_IRAM_SIZE,
memory_region_init_ram_nomigrate(&s->iram, NULL, "imx31.iram", FSL_IMX31_IRAM_SIZE,
&err);
if (err) {
error_propagate(errp, err);
Expand Down
2 changes: 1 addition & 1 deletion hw/arm/fsl-imx6.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
&s->caam);

/* OCRAM memory */
memory_region_init_ram(&s->ocram, NULL, "imx6.ocram", FSL_IMX6_OCRAM_SIZE,
memory_region_init_ram_nomigrate(&s->ocram, NULL, "imx6.ocram", FSL_IMX6_OCRAM_SIZE,
&err);
if (err) {
error_propagate(errp, err);
Expand Down
2 changes: 1 addition & 1 deletion hw/arm/highbank.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ static void calxeda_init(MachineState *machine, enum cxmachines machine_id)
memory_region_add_subregion(sysmem, 0, dram);

sysram = g_new(MemoryRegion, 1);
memory_region_init_ram(sysram, NULL, "highbank.sysram", 0x8000,
memory_region_init_ram_nomigrate(sysram, NULL, "highbank.sysram", 0x8000,
&error_fatal);
memory_region_add_subregion(sysmem, 0xfff88000, sysram);
if (bios_name != NULL) {
Expand Down
2 changes: 1 addition & 1 deletion hw/arm/integratorcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ static void integratorcm_init(Object *obj)
s->cm_init = 0x00000112;
s->cm_refcnt_offset = muldiv64(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL), 24,
1000);
memory_region_init_ram(&s->flash, obj, "integrator.flash", 0x100000,
memory_region_init_ram_nomigrate(&s->flash, obj, "integrator.flash", 0x100000,
&error_fatal);
vmstate_register_ram_global(&s->flash);

Expand Down
2 changes: 1 addition & 1 deletion hw/arm/mainstone.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ static void mainstone_common_init(MemoryRegion *address_space_mem,

/* Setup CPU & memory */
mpu = pxa270_init(address_space_mem, mainstone_binfo.ram_size, cpu_model);
memory_region_init_ram(rom, NULL, "mainstone.rom", MAINSTONE_ROM,
memory_region_init_ram_nomigrate(rom, NULL, "mainstone.rom", MAINSTONE_ROM,
&error_fatal);
vmstate_register_ram_global(rom);
memory_region_set_readonly(rom, true);
Expand Down
2 changes: 1 addition & 1 deletion hw/arm/musicpal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1604,7 +1604,7 @@ static void musicpal_init(MachineState *machine)
MP_RAM_DEFAULT_SIZE);
memory_region_add_subregion(address_space_mem, 0, ram);

memory_region_init_ram(sram, NULL, "musicpal.sram", MP_SRAM_SIZE,
memory_region_init_ram_nomigrate(sram, NULL, "musicpal.sram", MP_SRAM_SIZE,
&error_fatal);
vmstate_register_ram_global(sram);
memory_region_add_subregion(address_space_mem, MP_SRAM_BASE, sram);
Expand Down
2 changes: 1 addition & 1 deletion hw/arm/omap1.c
Original file line number Diff line number Diff line change
Expand Up @@ -3880,7 +3880,7 @@ struct omap_mpu_state_s *omap310_mpu_init(MemoryRegion *system_memory,
memory_region_allocate_system_memory(&s->emiff_ram, NULL, "omap1.dram",
s->sdram_size);
memory_region_add_subregion(system_memory, OMAP_EMIFF_BASE, &s->emiff_ram);
memory_region_init_ram(&s->imif_ram, NULL, "omap1.sram", s->sram_size,
memory_region_init_ram_nomigrate(&s->imif_ram, NULL, "omap1.sram", s->sram_size,
&error_fatal);
vmstate_register_ram_global(&s->imif_ram);
memory_region_add_subregion(system_memory, OMAP_IMIF_BASE, &s->imif_ram);
Expand Down
2 changes: 1 addition & 1 deletion hw/arm/omap2.c
Original file line number Diff line number Diff line change
Expand Up @@ -2278,7 +2278,7 @@ struct omap_mpu_state_s *omap2420_mpu_init(MemoryRegion *sysmem,
memory_region_allocate_system_memory(&s->sdram, NULL, "omap2.dram",
s->sdram_size);
memory_region_add_subregion(sysmem, OMAP2_Q2_BASE, &s->sdram);
memory_region_init_ram(&s->sram, NULL, "omap2.sram", s->sram_size,
memory_region_init_ram_nomigrate(&s->sram, NULL, "omap2.sram", s->sram_size,
&error_fatal);
vmstate_register_ram_global(&s->sram);
memory_region_add_subregion(sysmem, OMAP2_SRAM_BASE, &s->sram);
Expand Down
4 changes: 2 additions & 2 deletions hw/arm/omap_sx1.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ static void sx1_init(MachineState *machine, const int version)
machine->cpu_model);

/* External Flash (EMIFS) */
memory_region_init_ram(flash, NULL, "omap_sx1.flash0-0", flash_size,
memory_region_init_ram_nomigrate(flash, NULL, "omap_sx1.flash0-0", flash_size,
&error_fatal);
vmstate_register_ram_global(flash);
memory_region_set_readonly(flash, true);
Expand Down Expand Up @@ -167,7 +167,7 @@ static void sx1_init(MachineState *machine, const int version)
if ((version == 1) &&
(dinfo = drive_get(IF_PFLASH, 0, fl_idx)) != NULL) {
MemoryRegion *flash_1 = g_new(MemoryRegion, 1);
memory_region_init_ram(flash_1, NULL, "omap_sx1.flash1-0", flash1_size,
memory_region_init_ram_nomigrate(flash_1, NULL, "omap_sx1.flash1-0", flash1_size,
&error_fatal);
vmstate_register_ram_global(flash_1);
memory_region_set_readonly(flash_1, true);
Expand Down
2 changes: 1 addition & 1 deletion hw/arm/palm.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ static void palmte_init(MachineState *machine)
mpu = omap310_mpu_init(address_space_mem, sdram_size, cpu_model);

/* External Flash (EMIFS) */
memory_region_init_ram(flash, NULL, "palmte.flash", flash_size,
memory_region_init_ram_nomigrate(flash, NULL, "palmte.flash", flash_size,
&error_fatal);
vmstate_register_ram_global(flash);
memory_region_set_readonly(flash, true);
Expand Down
8 changes: 4 additions & 4 deletions hw/arm/pxa2xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -2074,11 +2074,11 @@ PXA2xxState *pxa270_init(MemoryRegion *address_space,
s->reset = qemu_allocate_irq(pxa2xx_reset, s, 0);

/* SDRAM & Internal Memory Storage */
memory_region_init_ram(&s->sdram, NULL, "pxa270.sdram", sdram_size,
memory_region_init_ram_nomigrate(&s->sdram, NULL, "pxa270.sdram", sdram_size,
&error_fatal);
vmstate_register_ram_global(&s->sdram);
memory_region_add_subregion(address_space, PXA2XX_SDRAM_BASE, &s->sdram);
memory_region_init_ram(&s->internal, NULL, "pxa270.internal", 0x40000,
memory_region_init_ram_nomigrate(&s->internal, NULL, "pxa270.internal", 0x40000,
&error_fatal);
vmstate_register_ram_global(&s->internal);
memory_region_add_subregion(address_space, PXA2XX_INTERNAL_BASE,
Expand Down Expand Up @@ -2206,11 +2206,11 @@ PXA2xxState *pxa255_init(MemoryRegion *address_space, unsigned int sdram_size)
s->reset = qemu_allocate_irq(pxa2xx_reset, s, 0);

/* SDRAM & Internal Memory Storage */
memory_region_init_ram(&s->sdram, NULL, "pxa255.sdram", sdram_size,
memory_region_init_ram_nomigrate(&s->sdram, NULL, "pxa255.sdram", sdram_size,
&error_fatal);
vmstate_register_ram_global(&s->sdram);
memory_region_add_subregion(address_space, PXA2XX_SDRAM_BASE, &s->sdram);
memory_region_init_ram(&s->internal, NULL, "pxa255.internal",
memory_region_init_ram_nomigrate(&s->internal, NULL, "pxa255.internal",
PXA2XX_INTERNAL_SIZE, &error_fatal);
vmstate_register_ram_global(&s->internal);
memory_region_add_subregion(address_space, PXA2XX_INTERNAL_BASE,
Expand Down
6 changes: 3 additions & 3 deletions hw/arm/realview.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,13 @@ static void realview_init(MachineState *machine,
ram_lo = g_new(MemoryRegion, 1);
low_ram_size = ram_size - 0x20000000;
ram_size = 0x20000000;
memory_region_init_ram(ram_lo, NULL, "realview.lowmem", low_ram_size,
memory_region_init_ram_nomigrate(ram_lo, NULL, "realview.lowmem", low_ram_size,
&error_fatal);
vmstate_register_ram_global(ram_lo);
memory_region_add_subregion(sysmem, 0x20000000, ram_lo);
}

memory_region_init_ram(ram_hi, NULL, "realview.highmem", ram_size,
memory_region_init_ram_nomigrate(ram_hi, NULL, "realview.highmem", ram_size,
&error_fatal);
vmstate_register_ram_global(ram_hi);
low_ram_size = ram_size;
Expand Down Expand Up @@ -345,7 +345,7 @@ static void realview_init(MachineState *machine,
startup code. I guess this works on real hardware because the
BootROM happens to be in ROM/flash or in memory that isn't clobbered
until after Linux boots the secondary CPUs. */
memory_region_init_ram(ram_hack, NULL, "realview.hack", 0x1000,
memory_region_init_ram_nomigrate(ram_hack, NULL, "realview.hack", 0x1000,
&error_fatal);
vmstate_register_ram_global(ram_hack);
memory_region_add_subregion(sysmem, SMP_BOOT_ADDR, ram_hack);
Expand Down
2 changes: 1 addition & 1 deletion hw/arm/spitz.c
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ static void spitz_common_init(MachineState *machine,

sl_flash_register(mpu, (model == spitz) ? FLASH_128M : FLASH_1024M);

memory_region_init_ram(rom, NULL, "spitz.rom", SPITZ_ROM, &error_fatal);
memory_region_init_ram_nomigrate(rom, NULL, "spitz.rom", SPITZ_ROM, &error_fatal);
vmstate_register_ram_global(rom);
memory_region_set_readonly(rom, true);
memory_region_add_subregion(address_space_mem, 0, rom);
Expand Down
4 changes: 2 additions & 2 deletions hw/arm/stellaris.c
Original file line number Diff line number Diff line change
Expand Up @@ -1288,13 +1288,13 @@ static void stellaris_init(const char *kernel_filename, const char *cpu_model,
sram_size = ((board->dc0 >> 18) + 1) * 1024;

/* Flash programming is done via the SCU, so pretend it is ROM. */
memory_region_init_ram(flash, NULL, "stellaris.flash", flash_size,
memory_region_init_ram_nomigrate(flash, NULL, "stellaris.flash", flash_size,
&error_fatal);
vmstate_register_ram_global(flash);
memory_region_set_readonly(flash, true);
memory_region_add_subregion(system_memory, 0, flash);

memory_region_init_ram(sram, NULL, "stellaris.sram", sram_size,
memory_region_init_ram_nomigrate(sram, NULL, "stellaris.sram", sram_size,
&error_fatal);
vmstate_register_ram_global(sram);
memory_region_add_subregion(system_memory, 0x20000000, sram);
Expand Down
4 changes: 2 additions & 2 deletions hw/arm/stm32f205_soc.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ static void stm32f205_soc_realize(DeviceState *dev_soc, Error **errp)
MemoryRegion *flash = g_new(MemoryRegion, 1);
MemoryRegion *flash_alias = g_new(MemoryRegion, 1);

memory_region_init_ram(flash, NULL, "STM32F205.flash", FLASH_SIZE,
memory_region_init_ram_nomigrate(flash, NULL, "STM32F205.flash", FLASH_SIZE,
&error_fatal);
memory_region_init_alias(flash_alias, NULL, "STM32F205.flash.alias",
flash, 0, FLASH_SIZE);
Expand All @@ -108,7 +108,7 @@ static void stm32f205_soc_realize(DeviceState *dev_soc, Error **errp)
memory_region_add_subregion(system_memory, FLASH_BASE_ADDRESS, flash);
memory_region_add_subregion(system_memory, 0, flash_alias);

memory_region_init_ram(sram, NULL, "STM32F205.sram", SRAM_SIZE,
memory_region_init_ram_nomigrate(sram, NULL, "STM32F205.sram", SRAM_SIZE,
&error_fatal);
vmstate_register_ram_global(sram);
memory_region_add_subregion(system_memory, SRAM_BASE_ADDRESS, sram);
Expand Down
2 changes: 1 addition & 1 deletion hw/arm/tosa.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ static void tosa_init(MachineState *machine)

mpu = pxa255_init(address_space_mem, tosa_binfo.ram_size);

memory_region_init_ram(rom, NULL, "tosa.rom", TOSA_ROM, &error_fatal);
memory_region_init_ram_nomigrate(rom, NULL, "tosa.rom", TOSA_ROM, &error_fatal);
vmstate_register_ram_global(rom);
memory_region_set_readonly(rom, true);
memory_region_add_subregion(address_space_mem, 0, rom);
Expand Down
6 changes: 3 additions & 3 deletions hw/arm/vexpress.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ static void a15_daughterboard_init(const VexpressMachineState *vms,
/* 0x2b060000: SP805 watchdog: not modelled */
/* 0x2b0a0000: PL341 dynamic memory controller: not modelled */
/* 0x2e000000: system SRAM */
memory_region_init_ram(sram, NULL, "vexpress.a15sram", 0x10000,
memory_region_init_ram_nomigrate(sram, NULL, "vexpress.a15sram", 0x10000,
&error_fatal);
vmstate_register_ram_global(sram);
memory_region_add_subregion(sysmem, 0x2e000000, sram);
Expand Down Expand Up @@ -673,13 +673,13 @@ static void vexpress_common_init(MachineState *machine)
}

sram_size = 0x2000000;
memory_region_init_ram(sram, NULL, "vexpress.sram", sram_size,
memory_region_init_ram_nomigrate(sram, NULL, "vexpress.sram", sram_size,
&error_fatal);
vmstate_register_ram_global(sram);
memory_region_add_subregion(sysmem, map[VE_SRAM], sram);

vram_size = 0x800000;
memory_region_init_ram(vram, NULL, "vexpress.vram", vram_size,
memory_region_init_ram_nomigrate(vram, NULL, "vexpress.vram", vram_size,
&error_fatal);
vmstate_register_ram_global(vram);
memory_region_add_subregion(sysmem, map[VE_VIDEORAM], vram);
Expand Down
2 changes: 1 addition & 1 deletion hw/arm/virt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1155,7 +1155,7 @@ static void create_secure_ram(VirtMachineState *vms,
hwaddr base = vms->memmap[VIRT_SECURE_MEM].base;
hwaddr size = vms->memmap[VIRT_SECURE_MEM].size;

memory_region_init_ram(secram, NULL, "virt.secure-ram", size, &error_fatal);
memory_region_init_ram_nomigrate(secram, NULL, "virt.secure-ram", size, &error_fatal);
vmstate_register_ram_global(secram);
memory_region_add_subregion(secure_sysmem, base, secram);

Expand Down
2 changes: 1 addition & 1 deletion hw/arm/xilinx_zynq.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ static void zynq_init(MachineState *machine)
memory_region_add_subregion(address_space_mem, 0, ext_ram);

/* 256K of on-chip memory */
memory_region_init_ram(ocm_ram, NULL, "zynq.ocm_ram", 256 << 10,
memory_region_init_ram_nomigrate(ocm_ram, NULL, "zynq.ocm_ram", 256 << 10,
&error_fatal);
vmstate_register_ram_global(ocm_ram);
memory_region_add_subregion(address_space_mem, 0xFFFC0000, ocm_ram);
Expand Down
2 changes: 1 addition & 1 deletion hw/arm/xlnx-zynqmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
for (i = 0; i < XLNX_ZYNQMP_NUM_OCM_BANKS; i++) {
char *ocm_name = g_strdup_printf("zynqmp.ocm_ram_bank_%d", i);

memory_region_init_ram(&s->ocm_ram[i], NULL, ocm_name,
memory_region_init_ram_nomigrate(&s->ocm_ram[i], NULL, ocm_name,
XLNX_ZYNQMP_OCM_RAM_SIZE, &error_fatal);
vmstate_register_ram_global(&s->ocm_ram[i]);
memory_region_add_subregion(get_system_memory(),
Expand Down
2 changes: 1 addition & 1 deletion hw/block/onenand.c
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ static int onenand_initfn(SysBusDevice *sbd)
}
s->otp = memset(g_malloc((64 + 2) << PAGE_SHIFT),
0xff, (64 + 2) << PAGE_SHIFT);
memory_region_init_ram(&s->ram, OBJECT(s), "onenand.ram",
memory_region_init_ram_nomigrate(&s->ram, OBJECT(s), "onenand.ram",
0xc000 << s->shift, &error_fatal);
vmstate_register_ram_global(&s->ram);
ram = memory_region_get_ram_ptr(&s->ram);
Expand Down
2 changes: 1 addition & 1 deletion hw/cris/axis_dev88.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ void axisdev88_init(MachineState *machine)

/* The ETRAX-FS has 128Kb on chip ram, the docs refer to it as the
internal memory. */
memory_region_init_ram(phys_intmem, NULL, "axisdev88.chipram", INTMEM_SIZE,
memory_region_init_ram_nomigrate(phys_intmem, NULL, "axisdev88.chipram", INTMEM_SIZE,
&error_fatal);
vmstate_register_ram_global(phys_intmem);
memory_region_add_subregion(address_space_mem, 0x38000000, phys_intmem);
Expand Down
4 changes: 2 additions & 2 deletions hw/display/cg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ static void cg3_initfn(Object *obj)
SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
CG3State *s = CG3(obj);

memory_region_init_ram(&s->rom, obj, "cg3.prom", FCODE_MAX_ROM_SIZE,
memory_region_init_ram_nomigrate(&s->rom, obj, "cg3.prom", FCODE_MAX_ROM_SIZE,
&error_fatal);
memory_region_set_readonly(&s->rom, true);
sysbus_init_mmio(sbd, &s->rom);
Expand Down Expand Up @@ -311,7 +311,7 @@ static void cg3_realizefn(DeviceState *dev, Error **errp)
}
}

memory_region_init_ram(&s->vram_mem, NULL, "cg3.vram", s->vram_size,
memory_region_init_ram_nomigrate(&s->vram_mem, NULL, "cg3.vram", s->vram_size,
&error_fatal);
memory_region_set_log(&s->vram_mem, true, DIRTY_MEMORY_VGA);
vmstate_register_ram_global(&s->vram_mem);
Expand Down
6 changes: 3 additions & 3 deletions hw/display/qxl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2089,14 +2089,14 @@ static void qxl_realize_common(PCIQXLDevice *qxl, Error **errp)
pci_set_byte(&config[PCI_INTERRUPT_PIN], 1);

qxl->rom_size = qxl_rom_size();
memory_region_init_ram(&qxl->rom_bar, OBJECT(qxl), "qxl.vrom",
memory_region_init_ram_nomigrate(&qxl->rom_bar, OBJECT(qxl), "qxl.vrom",
qxl->rom_size, &error_fatal);
vmstate_register_ram(&qxl->rom_bar, &qxl->pci.qdev);
init_qxl_rom(qxl);
init_qxl_ram(qxl);

qxl->guest_surfaces.cmds = g_new0(QXLPHYSICAL, qxl->ssd.num_surfaces);
memory_region_init_ram(&qxl->vram_bar, OBJECT(qxl), "qxl.vram",
memory_region_init_ram_nomigrate(&qxl->vram_bar, OBJECT(qxl), "qxl.vram",
qxl->vram_size, &error_fatal);
vmstate_register_ram(&qxl->vram_bar, &qxl->pci.qdev);
memory_region_init_alias(&qxl->vram32_bar, OBJECT(qxl), "qxl.vram32",
Expand Down Expand Up @@ -2198,7 +2198,7 @@ static void qxl_realize_secondary(PCIDevice *dev, Error **errp)

qxl->id = device_id++;
qxl_init_ramsize(qxl);
memory_region_init_ram(&qxl->vga.vram, OBJECT(dev), "qxl.vgavram",
memory_region_init_ram_nomigrate(&qxl->vga.vram, OBJECT(dev), "qxl.vgavram",
qxl->vga.vram_size, &error_fatal);
vmstate_register_ram(&qxl->vga.vram, &qxl->pci.qdev);
qxl->vga.vram_ptr = memory_region_get_ram_ptr(&qxl->vga.vram);
Expand Down
Loading

0 comments on commit 1cfe48c

Please sign in to comment.