qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Avihai Horon <avihaih@nvidia.com>
To: <qemu-devel@nongnu.org>
Cc: Juan Quintela <quintela@redhat.com>, Peter Xu <peterx@redhat.com>,
	"Fabiano Rosas" <farosas@suse.de>,
	Leonardo Bras <leobras@redhat.com>,
	Li Zhijian <lizhijian@fujitsu.com>,
	Avihai Horon <avihaih@nvidia.com>
Subject: [PATCH 03/11] migration: Refactor migration_incoming_setup()
Date: Sun, 31 Dec 2023 11:30:08 +0200	[thread overview]
Message-ID: <20231231093016.14204-4-avihaih@nvidia.com> (raw)
In-Reply-To: <20231231093016.14204-1-avihaih@nvidia.com>

Commit 6720c2b32725 ("migration: check magic value for deciding the
mapping of channels") extracted the only code that could fail in
migration_incoming_setup().

Now migration_incoming_setup() can't fail, so refactor it to return void
and remove errp parameter.

Signed-off-by: Avihai Horon <avihaih@nvidia.com>
---
 migration/migration.c | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/migration/migration.c b/migration/migration.c
index 1e25d7966f..55d77572d8 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -724,11 +724,8 @@ fail:
 /**
  * migration_incoming_setup: Setup incoming migration
  * @f: file for main migration channel
- * @errp: where to put errors
- *
- * Returns: %true on success, %false on error.
  */
-static bool migration_incoming_setup(QEMUFile *f, Error **errp)
+static void migration_incoming_setup(QEMUFile *f)
 {
     MigrationIncomingState *mis = migration_incoming_get_current();
 
@@ -736,7 +733,6 @@ static bool migration_incoming_setup(QEMUFile *f, Error **errp)
         mis->from_src_file = f;
     }
     qemu_file_set_blocking(f, false);
-    return true;
 }
 
 void migration_incoming_process(void)
@@ -780,9 +776,7 @@ static bool postcopy_try_recover(void)
 
 void migration_fd_process_incoming(QEMUFile *f, Error **errp)
 {
-    if (!migration_incoming_setup(f, errp)) {
-        return;
-    }
+    migration_incoming_setup(f);
     if (postcopy_try_recover()) {
         return;
     }
@@ -855,10 +849,7 @@ void migration_ioc_process_incoming(QIOChannel *ioc, Error **errp)
 
     if (default_channel) {
         f = qemu_file_new_input(ioc);
-
-        if (!migration_incoming_setup(f, errp)) {
-            return;
-        }
+        migration_incoming_setup(f);
     } else {
         /* Multiple connections */
         assert(migration_needs_multiple_sockets());
-- 
2.26.3



  parent reply	other threads:[~2023-12-31  9:32 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-31  9:30 [PATCH 00/11] migration: Misc cleanups and fixes Avihai Horon
2023-12-31  9:30 ` [PATCH 01/11] migration: Remove migrate_max_downtime() declaration Avihai Horon
2024-01-02 17:27   ` Fabiano Rosas
2023-12-31  9:30 ` [PATCH 02/11] migration: Remove nulling of hostname in migrate_init() Avihai Horon
2024-01-02 18:43   ` Fabiano Rosas
2023-12-31  9:30 ` Avihai Horon [this message]
2024-01-02 10:02   ` [PATCH 03/11] migration: Refactor migration_incoming_setup() Philippe Mathieu-Daudé
2024-01-02 18:53   ` Fabiano Rosas
2023-12-31  9:30 ` [PATCH 04/11] migration: Remove errp parameter in migration_fd_process_incoming() Avihai Horon
2024-01-02 18:57   ` Fabiano Rosas
2023-12-31  9:30 ` [PATCH 05/11] migration/multifd: Fix error message in multifd_recv_initial_packet() Avihai Horon
2024-01-02 19:05   ` Fabiano Rosas
2023-12-31  9:30 ` [PATCH 06/11] migration/multifd: Simplify multifd_channel_connect() if else statement Avihai Horon
2024-01-02 10:03   ` Philippe Mathieu-Daudé
2023-12-31  9:30 ` [PATCH 07/11] migration/multifd: Fix leaking of Error in TLS error flow Avihai Horon
2024-01-02 19:32   ` Fabiano Rosas
2023-12-31  9:30 ` [PATCH 08/11] migration/multifd: Remove error_setg() in migration_ioc_process_incoming() Avihai Horon
2024-01-02 19:33   ` Fabiano Rosas
2023-12-31  9:30 ` [PATCH 09/11] migration: Fix migration_channel_read_peek() error path Avihai Horon
2024-01-02 10:05   ` Philippe Mathieu-Daudé
2024-01-08 12:34     ` Markus Armbruster
2024-01-02 19:39   ` Fabiano Rosas
2023-12-31  9:30 ` [PATCH 10/11] migration: Remove unnecessary usage of local Error Avihai Horon
2024-01-02 19:42   ` Fabiano Rosas
2023-12-31  9:30 ` [PATCH 11/11] migration/multifd: " Avihai Horon
2024-01-02 10:07   ` Philippe Mathieu-Daudé
2024-01-04  4:38 ` [PATCH 00/11] migration: Misc cleanups and fixes Peter Xu

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=20231231093016.14204-4-avihaih@nvidia.com \
    --to=avihaih@nvidia.com \
    --cc=farosas@suse.de \
    --cc=leobras@redhat.com \
    --cc=lizhijian@fujitsu.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /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).