migration: Postcopy recover with preempt enabled
commit60bb3c5871a7f7b7cfff5d0a30a035e30cce8e42
authorPeter Xu <peterx@redhat.com>
Thu, 7 Jul 2022 18:55:06 +0000 (7 14:55 -0400)
committerDr. David Alan Gilbert <dgilbert@redhat.com>
Wed, 20 Jul 2022 11:15:08 +0000 (20 12:15 +0100)
treece2a2d6915b9ddb44bd1c2a976fa6e57f1a091bb
parentc01b16edf6a22f28c2a943652c82d18fccc527b7
migration: Postcopy recover with preempt enabled

To allow postcopy recovery, the ram fast load (preempt-only) dest QEMU thread
needs similar handling on fault tolerance.  When ram_load_postcopy() fails,
instead of stopping the thread it halts with a semaphore, preparing to be
kicked again when recovery is detected.

A mutex is introduced to make sure there's no concurrent operation upon the
socket.  To make it simple, the fast ram load thread will take the mutex during
its whole procedure, and only release it if it's paused.  The fast-path socket
will be properly released by the main loading thread safely when there's
network failures during postcopy with that mutex held.

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20220707185506.27257-1-peterx@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
migration/migration.c
migration/migration.h
migration/postcopy-ram.c
migration/qemu-file.c
migration/qemu-file.h
migration/savevm.c
migration/trace-events