mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-15 14:13:31 -06:00
multifd: Protect multifd_send_sync_main() calls
We only need to do that on the ram_save_iterate() call on sending and on destination when we get a RAM_SAVE_FLAG_EOS. In setup() and complete() we need to synch in both new and old cases, so don't add a check there. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Acked-by: Peter Xu <peterx@redhat.com> --- Remove the wrappers that we take out on patch 5.
This commit is contained in:
parent
77c259a4cb
commit
b05292c237
1 changed files with 11 additions and 5 deletions
|
@ -3394,9 +3394,11 @@ static int ram_save_iterate(QEMUFile *f, void *opaque)
|
||||||
out:
|
out:
|
||||||
if (ret >= 0
|
if (ret >= 0
|
||||||
&& migration_is_setup_or_active(migrate_get_current()->state)) {
|
&& migration_is_setup_or_active(migrate_get_current()->state)) {
|
||||||
ret = multifd_send_sync_main(rs->pss[RAM_CHANNEL_PRECOPY].pss_channel);
|
if (migrate_multifd_flush_after_each_section()) {
|
||||||
if (ret < 0) {
|
ret = multifd_send_sync_main(rs->pss[RAM_CHANNEL_PRECOPY].pss_channel);
|
||||||
return ret;
|
if (ret < 0) {
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
qemu_put_be64(f, RAM_SAVE_FLAG_EOS);
|
qemu_put_be64(f, RAM_SAVE_FLAG_EOS);
|
||||||
|
@ -4153,7 +4155,9 @@ int ram_load_postcopy(QEMUFile *f, int channel)
|
||||||
|
|
||||||
case RAM_SAVE_FLAG_EOS:
|
case RAM_SAVE_FLAG_EOS:
|
||||||
/* normal exit */
|
/* normal exit */
|
||||||
multifd_recv_sync_main();
|
if (migrate_multifd_flush_after_each_section()) {
|
||||||
|
multifd_recv_sync_main();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
error_report("Unknown combination of migration flags: 0x%x"
|
error_report("Unknown combination of migration flags: 0x%x"
|
||||||
|
@ -4424,7 +4428,9 @@ static int ram_load_precopy(QEMUFile *f)
|
||||||
break;
|
break;
|
||||||
case RAM_SAVE_FLAG_EOS:
|
case RAM_SAVE_FLAG_EOS:
|
||||||
/* normal exit */
|
/* normal exit */
|
||||||
multifd_recv_sync_main();
|
if (migrate_multifd_flush_after_each_section()) {
|
||||||
|
multifd_recv_sync_main();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (flags & RAM_SAVE_FLAG_HOOK) {
|
if (flags & RAM_SAVE_FLAG_HOOK) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue