Skip to content
Snippets Groups Projects
  • Peter Xu's avatar
    cc48c587
    migration: Move yank outside qemu_start_incoming_migration() · cc48c587
    Peter Xu authored
    
    Starting from commit b5eea99e, qmp_migrate_recover() calls unregister
    before calling qemu_start_incoming_migration(). I believe it wanted to mitigate
    the next call to yank_register_instance(), but I think that's wrong.
    
    Firstly, if during recover, we should keep the yank instance there, not
    "quickly removing and adding it back".
    
    Meanwhile, calling qmp_migrate_recover() twice with b5eea99e will directly
    crash the dest qemu (right now it can't; but it'll start to work right after
    the next patch) because the 1st call of qmp_migrate_recover() will unregister
    permanently when the channel failed to establish, then the 2nd call of
    qmp_migrate_recover() crashes at yank_unregister_instance().
    
    This patch fixes it by moving yank ops out of qemu_start_incoming_migration()
    into qmp_migrate_incoming.  For qmp_migrate_recover(), drop the unregister of
    yank instance too since we keep it there during the recovery phase.
    
    Signed-off-by: default avatarPeter Xu <peterx@redhat.com>
    Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
    Message-Id: <20210629181356.217312-2-peterx@redhat.com>
    Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
    cc48c587
    History
    migration: Move yank outside qemu_start_incoming_migration()
    Peter Xu authored
    
    Starting from commit b5eea99e, qmp_migrate_recover() calls unregister
    before calling qemu_start_incoming_migration(). I believe it wanted to mitigate
    the next call to yank_register_instance(), but I think that's wrong.
    
    Firstly, if during recover, we should keep the yank instance there, not
    "quickly removing and adding it back".
    
    Meanwhile, calling qmp_migrate_recover() twice with b5eea99e will directly
    crash the dest qemu (right now it can't; but it'll start to work right after
    the next patch) because the 1st call of qmp_migrate_recover() will unregister
    permanently when the channel failed to establish, then the 2nd call of
    qmp_migrate_recover() crashes at yank_unregister_instance().
    
    This patch fixes it by moving yank ops out of qemu_start_incoming_migration()
    into qmp_migrate_incoming.  For qmp_migrate_recover(), drop the unregister of
    yank instance too since we keep it there during the recovery phase.
    
    Signed-off-by: default avatarPeter Xu <peterx@redhat.com>
    Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
    Message-Id: <20210629181356.217312-2-peterx@redhat.com>
    Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>