On Tue, Feb 01, 2022 at 03:29:03AM -0300, Leonardo Bras wrote: > -void multifd_send_sync_main(QEMUFile *f) > +int multifd_send_sync_main(QEMUFile *f) > { > int i; > + bool flush_zero_copy; > > if (!migrate_use_multifd()) { > - return; > + return 0; > } > if (multifd_send_state->pages->num) { > if (multifd_send_pages(f) < 0) { > error_report("%s: multifd_send_pages fail", __func__); > - return; > + return 0;
I've not checked how it used to do if multifd_send_pages() failed, but.. should it returns -1 rather than 0 when there will be a return code? > } > } > + > + /* > + * When using zero-copy, it's necessary to flush after each iteration to > + * make sure pages from earlier iterations don't end up replacing newer > + * pages. > + */ > + flush_zero_copy = migrate_use_zero_copy_send(); > + > for (i = 0; i < migrate_multifd_channels(); i++) { > MultiFDSendParams *p = &multifd_send_state->params[i]; > > @@ -591,7 +600,7 @@ void multifd_send_sync_main(QEMUFile *f) > if (p->quit) { > error_report("%s: channel %d has already quit", __func__, i); > qemu_mutex_unlock(&p->mutex); > - return; > + return 0; Same question here. > } The rest looks good. Thanks, -- Peter Xu