]> git.proxmox.com Git - mirror_qemu.git/commitdiff
migrate_incoming: Cleanup/clarify error messages
authorDr. David Alan Gilbert <dgilbert@redhat.com>
Thu, 26 Feb 2015 14:54:41 +0000 (14:54 +0000)
committerJuan Quintela <quintela@redhat.com>
Tue, 17 Mar 2015 14:20:37 +0000 (15:20 +0100)
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 <dgilbert@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
migration/migration.c

index 60da9fef3c6ecefb33ad7ca4ca21e3f48ed0cae4..1e44d9bb83d7171ade1cade5ce27f58ead0cbf9e 100644 (file)
@@ -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,