diff mbox series

[02/17] migration: Move local_err check in migration_ioc_process_incoming()

Message ID 20240125162528.7552-3-avihaih@nvidia.com (mailing list archive)
State New, archived
Headers show
Series migration: Add new migration channel connect and TLS upgrade APIs | expand

Commit Message

Avihai Horon Jan. 25, 2024, 4:25 p.m. UTC
local_err in migration_ioc_process_incoming() is used only in the
multifd if branch. Move the local_err check under the multifd branch,
where it is actually used.

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

Comments

Peter Xu Jan. 26, 2024, 3:10 a.m. UTC | #1
On Thu, Jan 25, 2024 at 06:25:13PM +0200, Avihai Horon wrote:
> local_err in migration_ioc_process_incoming() is used only in the
> multifd if branch. Move the local_err check under the multifd branch,
> where it is actually used.
> 
> Signed-off-by: Avihai Horon <avihaih@nvidia.com>

Reviewed-by: Peter Xu <peterx@redhat.com>
diff mbox series

Patch

diff --git a/migration/migration.c b/migration/migration.c
index 6fc544711a..ccd497ca21 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -863,15 +863,15 @@  void migration_ioc_process_incoming(QIOChannel *ioc, Error **errp)
         assert(migration_needs_multiple_sockets());
         if (migrate_multifd()) {
             multifd_recv_new_channel(ioc, &local_err);
+            if (local_err) {
+                error_propagate(errp, local_err);
+                return;
+            }
         } else {
             assert(migrate_postcopy_preempt());
             f = qemu_file_new_input(ioc);
             postcopy_preempt_new_channel(mis, f);
         }
-        if (local_err) {
-            error_propagate(errp, local_err);
-            return;
-        }
     }
 
     if (migration_should_start_incoming(default_channel)) {