On 06/07/2017 18:26, Peter Maydell wrote: > > I think that to avoid getting tangled up in trying to fix > or deal with these handful of oddball cases at the same time > as doing a global change to the easy cases, we should: > > * globally rename memory_region_init_ram to memory_region_init_ram_nomigrate > (and document that it is the caller's job to arrange to migrate the RAM) > * add new memory_region_init_ram which does memory_region_init_ram_nomigrate > + vmstate_register_ram > * coccinelle patch to switch to using that new function where possible > * get that lot committed, because it touches so many files and > is a recipe for conflicts > * look at the remaining handful of _nomigrate calls and perhaps > switch them where that would be a bug fix > > Q: should we have _nomigrate versions of any of the other > memory_region_init_ram* functions? I think it makes sense > for only the basic _init_ram to do the migration for you, > because that's the only case where the memory system is > creating the backing storage for the caller, rather than the > caller passing in the backing storage.
memory_region_init_ram_from_file theoretically would also fit this description, but all of its callers would use the _nomigrate version. Paolo > "Be consistent for > the full set of functions" would be the other obvious approach; > I don't think I care too much either way.