Skip to contentSkip to conversation

migration/multifd: multifd_load_cleanup() always return 0

PATCH In review Wei Yang 2 participants 3 messages Jul 22, 2019 – Jul 24, 2019

lore
Share & tools
lore

Wei Yang

author
#0 lore raw

PATCH 1/1 migration/multifd: multifd_load_cleanup() always return 0

multifd_load_cleanup() always return 0 and never use the errp, just cleanup a little.

---
 migration/migration.c | 9 ++-------
 migration/ram.c       | 7 +++----
 migration/ram.h       | 2 +-
 3 files changed, 6 insertions(+), 12 deletions(-)
migration/migration.c +2 -7
index 27ca10122f..38d2fdfa73 100644
@@ -399,10 +399,7 @@ static void process_incoming_migration_bh(void *opaque)
      */
     qemu_announce_self(&mis->announce_timer, migrate_announce_params());
 
-    if (multifd_load_cleanup(&local_err) != 0) {
-        error_report_err(local_err);
-        autostart = false;
-    }
+    multifd_load_cleanup();
     /* If global state section was not received or we are in running
        state, we need to obey autostart. Any other state is set with
        runstate_set. */
@@ -506,9 +503,7 @@ fail:
     migrate_set_state(&mis->state, MIGRATION_STATUS_ACTIVE,
                       MIGRATION_STATUS_FAILED);
     qemu_fclose(mis->from_src_file);
-    if (multifd_load_cleanup(&local_err) != 0) {
-        error_report_err(local_err);
-    }
+    multifd_load_cleanup();
     exit(EXIT_FAILURE);
 }
 
migration/ram.c +3 -4
index 66792568e2..7d30f8484c 100644
@@ -1243,13 +1243,12 @@ static void multifd_recv_terminate_threads(Error *err)
     }
 }
 
-int multifd_load_cleanup(Error **errp)
+void multifd_load_cleanup(void)
 {
     int i;
-    int ret = 0;
 
     if (!migrate_use_multifd()) {
-        return 0;
+        return;
     }
     multifd_recv_terminate_threads(NULL);
     for (i = 0; i < migrate_multifd_channels(); i++) {
@@ -1276,7 +1275,7 @@ int multifd_load_cleanup(Error **errp)
     g_free(multifd_recv_state);
     multifd_recv_state = NULL;
 
-    return ret;
+    return;
 }
 
 static void multifd_recv_sync_main(void)
migration/ram.h +1 -1
index e0a499b956..6fdd449899 100644
@@ -44,7 +44,7 @@ uint64_t ram_bytes_total(void);
 int multifd_save_setup(void);
 void multifd_save_cleanup(void);
 int multifd_load_setup(void);
-int multifd_load_cleanup(Error **errp);
+void multifd_load_cleanup(void);
 bool multifd_recv_all_channels_created(void);
 bool multifd_recv_new_channel(QIOChannel *ioc, Error **errp);
 
Signature · 1 line
2.17.1
#1 lore raw
Quoted 4 lines · * Wei Yang ([email protected]) wrote:

multifd_load_cleanup() always return 0 and never use the errp, just cleanup a little.

I'd rather leave this; it wouldn't be that odd for us to add an error check there later.

Dave

Quoted 78 lines
---
 migration/migration.c | 9 ++-------
 migration/ram.c       | 7 +++----
 migration/ram.h       | 2 +-
 3 files changed, 6 insertions(+), 12 deletions(-)
migration/migration.c +2 -7
index 27ca10122f..38d2fdfa73 100644
@@ -399,10 +399,7 @@ static void process_incoming_migration_bh(void *opaque)
      */
     qemu_announce_self(&mis->announce_timer, migrate_announce_params());
 
-    if (multifd_load_cleanup(&local_err) != 0) {
-        error_report_err(local_err);
-        autostart = false;
-    }
+    multifd_load_cleanup();
     /* If global state section was not received or we are in running
        state, we need to obey autostart. Any other state is set with
        runstate_set. */
@@ -506,9 +503,7 @@ fail:
     migrate_set_state(&mis->state, MIGRATION_STATUS_ACTIVE,
                       MIGRATION_STATUS_FAILED);
     qemu_fclose(mis->from_src_file);
-    if (multifd_load_cleanup(&local_err) != 0) {
-        error_report_err(local_err);
-    }
+    multifd_load_cleanup();
     exit(EXIT_FAILURE);
 }
 
migration/ram.c +3 -4
index 66792568e2..7d30f8484c 100644
@@ -1243,13 +1243,12 @@ static void multifd_recv_terminate_threads(Error *err)
     }
 }
 
-int multifd_load_cleanup(Error **errp)
+void multifd_load_cleanup(void)
 {
     int i;
-    int ret = 0;
 
     if (!migrate_use_multifd()) {
-        return 0;
+        return;
     }
     multifd_recv_terminate_threads(NULL);
     for (i = 0; i < migrate_multifd_channels(); i++) {
@@ -1276,7 +1275,7 @@ int multifd_load_cleanup(Error **errp)
     g_free(multifd_recv_state);
     multifd_recv_state = NULL;
 
-    return ret;
+    return;
 }
 
 static void multifd_recv_sync_main(void)
migration/ram.h +1 -1
index e0a499b956..6fdd449899 100644
@@ -44,7 +44,7 @@ uint64_t ram_bytes_total(void);
 int multifd_save_setup(void);
 void multifd_save_cleanup(void);
 int multifd_load_setup(void);
-int multifd_load_cleanup(Error **errp);
+void multifd_load_cleanup(void);
 bool multifd_recv_all_channels_created(void);
 bool multifd_recv_new_channel(QIOChannel *ioc, Error **errp);
 
Signature · 1 line
2.17.1

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK

author
#2 lore raw
Quoted 9 lines · Dr. David Alan Gilbert
Quoted 4 lines · * Wei Yang ([email protected]) wrote:

multifd_load_cleanup() always return 0 and never use the errp, just cleanup a little.

I'd rather leave this; it wouldn't be that odd for us to add an error check there later.

Sounds reasonable :-)

Quoted 1 line

Dave

Signature · 2 lines
Wei Yang
Help you, Help me