mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-26 20:03:54 -06:00
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>
This commit is contained in:
parent
c01b16edf6
commit
60bb3c5871
7 changed files with 119 additions and 8 deletions
|
@ -160,6 +160,33 @@ int qemu_file_get_error_obj(QEMUFile *f, Error **errp)
|
|||
return f->last_error;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get last error for either stream f1 or f2 with optional Error*.
|
||||
* The error returned (non-zero) can be either from f1 or f2.
|
||||
*
|
||||
* If any of the qemufile* is NULL, then skip the check on that file.
|
||||
*
|
||||
* When there is no error on both qemufile, zero is returned.
|
||||
*/
|
||||
int qemu_file_get_error_obj_any(QEMUFile *f1, QEMUFile *f2, Error **errp)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (f1) {
|
||||
ret = qemu_file_get_error_obj(f1, errp);
|
||||
/* If there's already error detected, return */
|
||||
if (ret) {
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
if (f2) {
|
||||
ret = qemu_file_get_error_obj(f2, errp);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set the last error for stream f with optional Error*
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue