qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 15/33] migration: make loadvm_postcopy_handle_resume() void


From: Daniel P . Berrangé
Subject: [PATCH 15/33] migration: make loadvm_postcopy_handle_resume() void
Date: Thu, 4 Feb 2021 17:18:49 +0000

This is an incremental step in converting vmstate loading code to report
via Error objects instead of printing directly to the console/monitor.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 migration/savevm.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/migration/savevm.c b/migration/savevm.c
index 2216c61c6f..041175162a 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -2067,12 +2067,12 @@ static void 
migrate_send_rp_req_pages_pending(MigrationIncomingState *mis)
     }
 }
 
-static int loadvm_postcopy_handle_resume(MigrationIncomingState *mis)
+static void loadvm_postcopy_handle_resume(MigrationIncomingState *mis)
 {
     if (mis->state != MIGRATION_STATUS_POSTCOPY_RECOVER) {
         error_report("%s: illegal resume received", __func__);
         /* Don't fail the load, only for this. */
-        return 0;
+        return;
     }
 
     /*
@@ -2113,8 +2113,6 @@ static int 
loadvm_postcopy_handle_resume(MigrationIncomingState *mis)
      * migrate_send_rp_message_req_pages() is not thread safe, yet.
      */
     qemu_sem_post(&mis->postcopy_pause_sem_fault);
-
-    return 0;
 }
 
 /**
@@ -2302,12 +2300,8 @@ static int loadvm_process_command(QEMUFile *f, Error 
**errp)
         return loadvm_postcopy_ram_handle_discard(mis, len, errp);
 
     case MIG_CMD_POSTCOPY_RESUME:
-        ret = loadvm_postcopy_handle_resume(mis);
-        if (ret < 0) {
-            error_setg(errp, "Failed to load device state command: %d", ret);
-            return -1;
-        }
-        return ret;
+        loadvm_postcopy_handle_resume(mis);
+        return 0;
 
     case MIG_CMD_RECV_BITMAP:
         ret = loadvm_handle_recv_bitmap(mis, len);
-- 
2.29.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]