On Tue, 3 Mar 2026, Peter Maydell wrote:
On Sun, 1 Mar 2026 at 21:03, BALATON Zoltan <[email protected]> wrote:

This is rarely needed and we can use
memory_region_init_ram_flags_nomigrate() instead which is now the only
nomigrate variant left.

Signed-off-by: BALATON Zoltan <[email protected]>

I don't think this one is worth doing. We might as well
wait until we can get rid of the VGA case.

There are two more uses that pass non-0 flags so even with the vga we can't completely remove memory_region_init_ram_flags_nomigrate(), the vga and xtensa are the ones that can use memory_region_init_ram_flags_nomigrate with flags=0 then we don't need memory_region_init_ram_nomigrate. But if everybody is so attached to this function for only these two uses that are to be removed soon I can drop this patch and keep memory_region_init_ram_nomigrate for now but I don't see why.

diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.c
index d427d68e50..b025cc53a8 100644
--- a/hw/xtensa/xtfpga.c
+++ b/hw/xtensa/xtfpga.c
@@ -163,8 +163,8 @@ static void xtfpga_net_init(MemoryRegion *address_space,
             sysbus_mmio_get_region(s, 1));

     ram = g_malloc(sizeof(*ram));
-    memory_region_init_ram_nomigrate(ram, OBJECT(s), "open_eth.ram", 16 * KiB,
-                           &error_fatal);
+    memory_region_init_ram_flags_nomigrate(ram, OBJECT(s), "open_eth.ram",
+                                           16 * KiB, 0, &error_fatal);
     vmstate_register_ram_global(ram);
     memory_region_add_subregion(address_space, buffers, ram);
 }

We should change this to memory_region_init_ram(), taking
the compat break (which is fine for xtensa).

There's a patch in the follow up series that will convert this:

https://patchew.org/QEMU/[email protected]/d2407882ecc62a51781dec51791c91d331802fa3.1770753117.git.bala...@eik.bme.hu/

so until then I chose to just preserve this for now as this is the simplest change here and we still have a similar one in vga but if we finally can get over this series and can discuss the follow ups then this should eventually be converted during that. So I don't think it matters when we take the migration break for this device and this way it's simpler. If we could remove the vga one now then it might worth to do the same here but since that's still there I think this is OK too.

Regards,
BALATON Zoltan

Reply via email to