qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PULL 07/13] migrate_incoming: Cleanup/clarify error messag


From: Juan Quintela
Subject: [Qemu-devel] [PULL 07/13] migrate_incoming: Cleanup/clarify error messages
Date: Tue, 17 Mar 2015 16:30:29 +0100

From: "Dr. David Alan Gilbert" <address@hidden>

Create a separate error for the case where migrate_incoming is
used after a succesful migrate_incoming.

Reword the error in the case where '-incoming defer' is missing
to omit the command name so it's right for both hmp and qmp.

Signed-off-by: Dr. David Alan Gilbert <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Amit Shah <address@hidden>
Signed-off-by: Juan Quintela <address@hidden>
---
 migration/migration.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/migration/migration.c b/migration/migration.c
index 60da9fe..1e44d9b 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -434,11 +434,15 @@ void migrate_del_blocker(Error *reason)
 void qmp_migrate_incoming(const char *uri, Error **errp)
 {
     Error *local_err = NULL;
+    static bool once = true;

     if (!deferred_incoming) {
-        error_setg(errp, "'-incoming defer' is required for migrate_incoming");
+        error_setg(errp, "For use with '-incoming defer'");
         return;
     }
+    if (!once) {
+        error_setg(errp, "The incoming migration has already been started");
+    }

     qemu_start_incoming_migration(uri, &local_err);

@@ -447,7 +451,7 @@ void qmp_migrate_incoming(const char *uri, Error **errp)
         return;
     }

-    deferred_incoming = false;
+    once = false;
 }

 void qmp_migrate(const char *uri, bool has_blk, bool blk,
-- 
2.1.0




reply via email to

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