memory: Document that the RAM MR initializers do not handle migration

The various functions for initializing RAM MemoryRegions do not do
anything to cause the data in the MemoryRegion to be migrated.
Note in their documentation comments that this is the responsibility
of the caller.

(We will shortly add a new function that *does* do this for you.)

Backports commit a5c0234bb2754f5248e67929a34c843dbe039da5 from qemu
This commit is contained in:
Peter Maydell 2018-03-03 22:20:28 -05:00 committed by Lioncash
parent 3c2d3d8363
commit 152c56f6a9
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -354,6 +354,9 @@ void memory_region_init_io(struct uc_struct *uc,
* @size: size of the region.
* @perms: permissions on the region (UC_PROT_READ, UC_PROT_WRITE, UC_PROT_EXEC).
* @errp: pointer to Error*, to store an error if it happens.
*
* Note that this function does not do anything to cause the data in the
* RAM memory region to be migrated; that is the responsibility of the caller.
*/
void memory_region_init_ram(struct uc_struct *uc,
MemoryRegion *mr,
@ -374,6 +377,9 @@ void memory_region_init_ram(struct uc_struct *uc,
* must be unique within any device
* @size: size of the region.
* @ptr: memory to be mapped; must contain at least @size bytes.
*
* Note that this function does not do anything to cause the data in the
* RAM memory region to be migrated; that is the responsibility of the caller.
*/
void memory_region_init_ram_ptr(struct uc_struct *uc,
MemoryRegion *mr,
@ -400,6 +406,10 @@ void memory_region_init_ram_ptr(struct uc_struct *uc,
* must be unique within any device
* @size: size of the region.
* @ptr: memory to be mapped; must contain at least @size bytes.
*
* Note that this function does not do anything to cause the data in the
* RAM memory region to be migrated; that is the responsibility of the caller.
* (For RAM device memory regions, migrating the contents rarely makes sense.)
*/
void memory_region_init_ram_device_ptr(struct uc_struct *uc,
MemoryRegion *mr,
@ -485,6 +495,9 @@ void memory_region_init_rom_device(struct uc_struct *uc,
* @max_size: max size of the region.
* @resized: callback to notify owner about used size change.
* @errp: pointer to Error*, to store an error if it happens.
*
* Note that this function does not do anything to cause the data in the
* RAM memory region to be migrated; that is the responsibility of the caller.
*/
void memory_region_init_resizeable_ram(struct uc_struct *uc,
MemoryRegion *mr,