Skip to content
  • David Hildenbrand's avatar
    c7c0e724
    migration/ram: Handle RAM block resizes during precopy · c7c0e724
    David Hildenbrand authored
    
    
    Resizing while migrating is dangerous and does not work as expected.
    The whole migration code works on the usable_length of ram blocks and does
    not expect this to change at random points in time.
    
    In the case of precopy, the ram block size must not change on the source,
    after syncing the RAM block list in ram_save_setup(), so as long as the
    guest is still running on the source.
    
    Resizing can be trigger *after* (but not during) a reset in
    ACPI code by the guest
    - hw/arm/virt-acpi-build.c:acpi_ram_update()
    - hw/i386/acpi-build.c:acpi_ram_update()
    
    Use the ram block notifier to get notified about resizes. Let's simply
    cancel migration and indicate the reason. We'll continue running on the
    source. No harm done.
    
    Update the documentation. Postcopy will be handled separately.
    
    Reviewed-by: default avatarPeter Xu <peterx@redhat.com>
    Signed-off-by: default avatarDavid Hildenbrand <david@redhat.com>
    Message-Id: <20210429112708.12291-5-david@redhat.com>
    Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Manual merge
    c7c0e724
    migration/ram: Handle RAM block resizes during precopy
    David Hildenbrand authored
    
    
    Resizing while migrating is dangerous and does not work as expected.
    The whole migration code works on the usable_length of ram blocks and does
    not expect this to change at random points in time.
    
    In the case of precopy, the ram block size must not change on the source,
    after syncing the RAM block list in ram_save_setup(), so as long as the
    guest is still running on the source.
    
    Resizing can be trigger *after* (but not during) a reset in
    ACPI code by the guest
    - hw/arm/virt-acpi-build.c:acpi_ram_update()
    - hw/i386/acpi-build.c:acpi_ram_update()
    
    Use the ram block notifier to get notified about resizes. Let's simply
    cancel migration and indicate the reason. We'll continue running on the
    source. No harm done.
    
    Update the documentation. Postcopy will be handled separately.
    
    Reviewed-by: default avatarPeter Xu <peterx@redhat.com>
    Signed-off-by: default avatarDavid Hildenbrand <david@redhat.com>
    Message-Id: <20210429112708.12291-5-david@redhat.com>
    Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Manual merge
Loading