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

Avihai Horon posted 17 patches 10 months ago
Maintainers: Peter Xu <peterx@redhat.com>, Fabiano Rosas <farosas@suse.de>
[PATCH 02/17] migration: Move local_err check in migration_ioc_process_incoming()
Posted by Avihai Horon 10 months ago
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(-)

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)) {
-- 
2.26.3
Re: [PATCH 02/17] migration: Move local_err check in migration_ioc_process_incoming()
Posted by Peter Xu 10 months ago
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>

-- 
Peter Xu