migration/postcopy: cleanup multifd after postcopy finish
diff mbox series

Message ID 20190724013208.5893-1-richardw.yang@linux.intel.com
State New
Headers show
Series
  • migration/postcopy: cleanup multifd after postcopy finish
Related show

Commit Message

Wei Yang July 24, 2019, 1:32 a.m. UTC
In case we enable multifd, not forget to cleanup it.

Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
---
 migration/savevm.c | 4 ++++
 1 file changed, 4 insertions(+)

Patch
diff mbox series

diff --git a/migration/savevm.c b/migration/savevm.c
index 0105068579..27eef72c9d 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -1738,6 +1738,7 @@  static void *postcopy_ram_listen_thread(void *opaque)
 {
     MigrationIncomingState *mis = migration_incoming_get_current();
     QEMUFile *f = mis->from_src_file;
+    Error *local_err = NULL;
     int load_res;
 
     migrate_set_state(&mis->state, MIGRATION_STATUS_ACTIVE,
@@ -1800,6 +1801,9 @@  static void *postcopy_ram_listen_thread(void *opaque)
      */
     migration_incoming_state_destroy();
     qemu_loadvm_state_cleanup();
+    if (multifd_load_cleanup(&local_err) != 0) {
+        error_report_err(local_err);
+    }
 
     rcu_unregister_thread();
     postcopy_state_set(POSTCOPY_INCOMING_END, NULL);