Hi Peter, On 07/07/2017 11:42 AM, Peter Maydell wrote:
This patchset changes the memory region functions - memory_region_init_ram() - memory_region_init_rom() - memory_region_init_rom_device() to all automatically register the backing memory they allocate for migration using vmstate_register_ram(). Renamed functions - memory_region_init_ram_nomigrate() - memory_region_init_rom_nomigrate() - memory_region_init_rom_device_nomigrate() are provided which only do the MR init, for the oddball cases which want to manage migration of the backing memory themselves (and to avoid behavioural changes for callers which weren't managing correctly migration themselves...)
[...]
I'm seeing memleaks using the malta machine, they come from the smbus_eeprom_init() in hw/i2c/smbus_eeprom.c which does:
uint8_t *eeprom_buf = g_malloc0(8 * 256); /* XXX: make this persistent */
Question for 2.11: is this device a candidate to use one of the function you enumerated? My guess is memory_region_init_rom_device()
Question for 2.10: does that mean than the malta machine is not migratable? Thanks! Phil.