Skip to content

Commit 660819b

Browse files
xzpeterJuan Quintela
authored andcommitted
migration: shut src return path unconditionally
We were do the shutting off only for postcopy. Now we do this as long as the source return path is there. Moving the cleanup of from_src_file there too. Signed-off-by: Peter Xu <[email protected]> Reviewed-by: Juan Quintela <[email protected]> Signed-off-by: Juan Quintela <[email protected]>
1 parent 3482655 commit 660819b

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

migration/migration.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,17 @@ void migration_incoming_state_destroy(void)
134134
struct MigrationIncomingState *mis = migration_incoming_get_current();
135135

136136
if (mis->to_src_file) {
137+
/* Tell source that we are done */
138+
migrate_send_rp_shut(mis, qemu_file_get_error(mis->from_src_file) != 0);
137139
qemu_fclose(mis->to_src_file);
138140
mis->to_src_file = NULL;
139141
}
140142

143+
if (mis->from_src_file) {
144+
qemu_fclose(mis->from_src_file);
145+
mis->from_src_file = NULL;
146+
}
147+
141148
qemu_event_destroy(&mis->main_thread_load_event);
142149
}
143150

@@ -435,7 +442,6 @@ static void process_incoming_migration_co(void *opaque)
435442
exit(EXIT_FAILURE);
436443
}
437444

438-
qemu_fclose(f);
439445
free_xbzrle_decoded_buf();
440446

441447
mis->bh = qemu_bh_new(process_incoming_migration_bh, mis);

migration/postcopy-ram.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,6 @@ int postcopy_ram_incoming_cleanup(MigrationIncomingState *mis)
333333
}
334334

335335
postcopy_state_set(POSTCOPY_INCOMING_END);
336-
migrate_send_rp_shut(mis, qemu_file_get_error(mis->from_src_file) != 0);
337336

338337
if (mis->postcopy_tmp_page) {
339338
munmap(mis->postcopy_tmp_page, mis->largest_page_size);

0 commit comments

Comments
 (0)