On 6 July 2017 at 18:47, Peter Maydell <peter.mayd...@linaro.org> wrote: > On 6 July 2017 at 18:26, Paolo Bonzini <pbonz...@redhat.com> wrote: >> Maybe, for memory_region_init_ram only, the owner argument can be made a >> DeviceState (or NULL)? > > Something that might influence things here -- of the twelve > callers of vmstate_register_ram(), only 6 use an 'owner' > pointer that's the same as the one they use for initializing > the memory region (and 3 of those are using _init_rom or > _init_rom_device rather than init_ram directly).
Conversely there are 14 or so places that init a RAM MR with a non-NULL owner but then use vmstate_register_ram_global rather than vmstate_register_ram, and so which would be stuck using the old _nomigrate() function if we make it use the owner pointer. I guess we should think about the long term and design the API to encourage the behaviour we want for new code, rather than to catch as much of possible of existing usage, though? thanks -- PMM