mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
virtio-mem: Migrate immutable properties early
The bitmap and the size are immutable while migration is active: see virtio_mem_is_busy(). We can migrate this information early, before migrating any actual RAM content. Further, all information we need for sanity checks is immutable as well. Having this information in place early will, for example, allow for properly preallocating memory before touching these memory locations during RAM migration: this way, we can make sure that all memory was actually preallocated and that any user errors (e.g., insufficient hugetlb pages) can be handled gracefully. In contrast, usable_region_size and requested_size can theoretically still be modified on the source while the VM is running. Keep migrating these properties the usual, late, way. Use a new device property to keep behavior of compat machines unmodified. Reviewed-by: Peter Xu <peterx@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com>S Signed-off-by: David Hildenbrand <david@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
This commit is contained in:
parent
ce1761f0f9
commit
3b95a71b22
3 changed files with 60 additions and 3 deletions
|
@ -31,6 +31,7 @@ OBJECT_DECLARE_TYPE(VirtIOMEM, VirtIOMEMClass,
|
|||
#define VIRTIO_MEM_BLOCK_SIZE_PROP "block-size"
|
||||
#define VIRTIO_MEM_ADDR_PROP "memaddr"
|
||||
#define VIRTIO_MEM_UNPLUGGED_INACCESSIBLE_PROP "unplugged-inaccessible"
|
||||
#define VIRTIO_MEM_EARLY_MIGRATION_PROP "x-early-migration"
|
||||
#define VIRTIO_MEM_PREALLOC_PROP "prealloc"
|
||||
|
||||
struct VirtIOMEM {
|
||||
|
@ -74,6 +75,13 @@ struct VirtIOMEM {
|
|||
/* whether to prealloc memory when plugging new blocks */
|
||||
bool prealloc;
|
||||
|
||||
/*
|
||||
* Whether we migrate properties that are immutable while migration is
|
||||
* active early, before state of other devices and especially, before
|
||||
* migrating any RAM content.
|
||||
*/
|
||||
bool early_migration;
|
||||
|
||||
/* notifiers to notify when "size" changes */
|
||||
NotifierList size_change_notifiers;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue