On Fri, Aug 11, 2023 at 12:08:29PM -0300, Fabiano Rosas wrote: > diff --git a/migration/migration.c b/migration/migration.c > index 0067c927fa..85c171f32c 100644 > --- a/migration/migration.c > +++ b/migration/migration.c > @@ -2057,11 +2057,10 @@ static int > await_return_path_close_on_source(MigrationState *ms) > * need to cause it to exit. shutdown(2), if we have it, will > * cause it to unblock if it's stuck waiting for the destination. > */ > - if (qemu_file_get_error(ms->to_dst_file)) { > - WITH_QEMU_LOCK_GUARD(&ms->qemu_file_lock) { > - if (ms->rp_state.from_dst_file) { > - qemu_file_shutdown(ms->rp_state.from_dst_file); > - } > + WITH_QEMU_LOCK_GUARD(&ms->qemu_file_lock) { > + if (ms->to_dst_file && ms->rp_state.from_dst_file && > + qemu_file_get_error(ms->to_dst_file)) { > + qemu_file_shutdown(ms->rp_state.from_dst_file); > } > }
Squash into previous one? -- Peter Xu