[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 03/10] migration: Fix possible race when checking to_dst_f
From: |
Peter Xu |
Subject: |
Re: [PATCH v3 03/10] migration: Fix possible race when checking to_dst_file for errors |
Date: |
Tue, 15 Aug 2023 17:49:05 -0400 |
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
- [PATCH v3 01/10] migration: Fix possible race when setting rp_state.error, (continued)
- [PATCH v3 01/10] migration: Fix possible race when setting rp_state.error, Fabiano Rosas, 2023/08/11
- [PATCH v3 02/10] migration: Fix possible race when shutting return path, Fabiano Rosas, 2023/08/11
- [PATCH v3 08/10] migration: Move return path cleanup to main migration thread, Fabiano Rosas, 2023/08/11
- [PATCH v3 04/10] migration: Fix possible race when shutting down to_dst_file, Fabiano Rosas, 2023/08/11
- [PATCH v3 07/10] migration: Replace the return path retry logic, Fabiano Rosas, 2023/08/11
- [PATCH v3 03/10] migration: Fix possible race when checking to_dst_file for errors, Fabiano Rosas, 2023/08/11
- Re: [PATCH v3 03/10] migration: Fix possible race when checking to_dst_file for errors,
Peter Xu <=
- [PATCH v3 05/10] migration: Remove redundant cleanup of postcopy_qemufile_src, Fabiano Rosas, 2023/08/11
- [PATCH v3 06/10] migration: Consolidate return path closing code, Fabiano Rosas, 2023/08/11
- [PATCH v3 09/10] migration: Be consistent about shutdown of source shared files, Fabiano Rosas, 2023/08/11
- [PATCH v3 10/10] migration: Add a wrapper to cleanup migration files, Fabiano Rosas, 2023/08/11