qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fei Li <fli@suse.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH RFC v2 4/5] migration: remove unused &local_err parameter in multifd_save_cleanup
Date: Thu, 29 Nov 2018 18:03:39 +0800	[thread overview]
Message-ID: <20181129100340.13823-5-fli@suse.com> (raw)
In-Reply-To: <20181129100340.13823-1-fli@suse.com>

Always call migrate_set_error() to set the error state without relying
on whether multifd_save_cleanup() succeeds.  As the passed &local_err
is never used in multifd_save_cleanup(), remove it. And make the
function be: void multifd_save_cleanup(void).

Signed-off-by: Fei Li <fli@suse.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
---
 migration/migration.c |  5 +----
 migration/ram.c       | 11 ++++-------
 migration/ram.h       |  2 +-
 3 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/migration/migration.c b/migration/migration.c
index 72106bddf0..0537fc0c26 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -1386,7 +1386,6 @@ static void migrate_fd_cleanup(void *opaque)
     qemu_savevm_state_cleanup();
 
     if (s->to_dst_file) {
-        Error *local_err = NULL;
         QEMUFile *tmp;
 
         trace_migrate_fd_cleanup();
@@ -1397,9 +1396,7 @@ static void migrate_fd_cleanup(void *opaque)
         }
         qemu_mutex_lock_iothread();
 
-        if (multifd_save_cleanup(&local_err) != 0) {
-            error_report_err(local_err);
-        }
+        multifd_save_cleanup();
         qemu_mutex_lock(&s->qemu_file_lock);
         tmp = s->to_dst_file;
         s->to_dst_file = NULL;
diff --git a/migration/ram.c b/migration/ram.c
index e13b9349d0..c44cb6f56d 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -917,13 +917,12 @@ static void multifd_send_terminate_threads(Error *err)
     }
 }
 
-int multifd_save_cleanup(Error **errp)
+void multifd_save_cleanup(void)
 {
     int i;
-    int ret = 0;
 
     if (!migrate_use_multifd()) {
-        return 0;
+        return;
     }
     multifd_send_terminate_threads(NULL);
     for (i = 0; i < migrate_multifd_channels(); i++) {
@@ -953,7 +952,6 @@ int multifd_save_cleanup(Error **errp)
     multifd_send_state->pages = NULL;
     g_free(multifd_send_state);
     multifd_send_state = NULL;
-    return ret;
 }
 
 static void multifd_send_sync_main(void)
@@ -1071,9 +1069,8 @@ static void multifd_new_send_channel_async(QIOTask *task, gpointer opaque)
     Error *local_err = NULL;
 
     if (qio_task_propagate_error(task, &local_err)) {
-        if (multifd_save_cleanup(&local_err) != 0) {
-            migrate_set_error(migrate_get_current(), local_err);
-        }
+        migrate_set_error(migrate_get_current(), local_err);
+        multifd_save_cleanup();
     } else {
         p->c = QIO_CHANNEL(sioc);
         qio_channel_set_delay(p->c, false);
diff --git a/migration/ram.h b/migration/ram.h
index 046d3074be..936177b3e9 100644
--- a/migration/ram.h
+++ b/migration/ram.h
@@ -43,7 +43,7 @@ uint64_t ram_bytes_remaining(void);
 uint64_t ram_bytes_total(void);
 
 int multifd_save_setup(void);
-int multifd_save_cleanup(Error **errp);
+void multifd_save_cleanup(void);
 int multifd_load_setup(void);
 int multifd_load_cleanup(Error **errp);
 bool multifd_recv_all_channels_created(void);
-- 
2.13.7

  parent reply	other threads:[~2018-11-29 10:04 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-29 10:03 [Qemu-devel] [PATCH RFC v2 0/5] fix some segmentation faults and migration issues Fei Li
2018-11-29 10:03 ` [Qemu-devel] [PATCH RFC v2 1/5] Fix segmentation fault when qemu_signal_init fails Fei Li
2018-11-29 12:49   ` Markus Armbruster
2018-11-30  3:29     ` Fei Li
2018-11-29 10:03 ` [Qemu-devel] [PATCH RFC v2 2/5] qemu_thread_join: fix segmentation fault Fei Li
2018-11-29 10:03 ` [Qemu-devel] [PATCH RFC v2 3/5] migration: fix the multifd code when receiving less channels Fei Li
2018-11-29 14:46   ` Philippe Mathieu-Daudé
2018-11-30  3:45     ` Fei Li
2018-12-06  6:31       ` Fei Li
2018-11-29 10:03 ` Fei Li [this message]
2018-11-29 14:50   ` [Qemu-devel] [PATCH RFC v2 4/5] migration: remove unused &local_err parameter in multifd_save_cleanup Philippe Mathieu-Daudé
2018-11-29 14:52     ` Philippe Mathieu-Daudé
2018-11-30  5:12     ` Fei Li
2018-11-29 10:03 ` [Qemu-devel] [PATCH RFC v2 5/5] migration: add more error handling for postcopy_ram_enable_notify Fei Li
2018-11-30  9:49   ` Dr. David Alan Gilbert
2018-11-29 14:20 ` [Qemu-devel] [PATCH for-3.1? RFC v2 0/5] fix some segmentation faults and migration issues Eric Blake
2018-11-30  6:15   ` Fei Li
2018-11-30 15:57     ` Eric Blake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181129100340.13823-5-fli@suse.com \
    --to=fli@suse.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).