]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
migration: Add cleanup hook for inwards migration
authorDr. David Alan Gilbert <dgilbert@redhat.com>
Wed, 21 Apr 2021 11:28:32 +0000 (12:28 +0100)
committerDr. David Alan Gilbert <dgilbert@redhat.com>
Tue, 8 Jun 2021 18:36:18 +0000 (19:36 +0100)
Add a cleanup hook for incoming migration that gets called
at the end as a way for a transport to allow cleanup.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20210421112834.107651-4-dgilbert@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
migration/migration.c
migration/migration.h

index 1885860d7b48accc0d2ffc911a883ee9c82bf966..393299e150677ad8d306286dae5ff4dfaf442a2e 100644 (file)
@@ -280,6 +280,9 @@ void migration_incoming_state_destroy(void)
         g_array_free(mis->postcopy_remote_fds, TRUE);
         mis->postcopy_remote_fds = NULL;
     }
+    if (mis->transport_cleanup) {
+        mis->transport_cleanup(mis->transport_data);
+    }
 
     qemu_event_reset(&mis->main_thread_load_event);
 
index b88bd8fe07dd8d0c8fec3b54a25401d2cd51c61b..2ebb740dfa0d41c162ed175046014a99b8b54c3d 100644 (file)
@@ -49,6 +49,10 @@ struct PostcopyBlocktimeContext;
 struct MigrationIncomingState {
     QEMUFile *from_src_file;
 
+    /* A hook to allow cleanup at the end of incoming migration */
+    void *transport_data;
+    void (*transport_cleanup)(void *data);
+
     /*
      * Free at the start of the main state load, set as the main thread finishes
      * loading state.