From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52301) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXtSK-0002sW-0u for qemu-devel@nongnu.org; Tue, 17 Mar 2015 11:30:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YXtSD-0003tF-Nw for qemu-devel@nongnu.org; Tue, 17 Mar 2015 11:30:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33802) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXtSD-0003t8-AR for qemu-devel@nongnu.org; Tue, 17 Mar 2015 11:30:49 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t2HFUlbu029180 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Tue, 17 Mar 2015 11:30:48 -0400 From: Juan Quintela Date: Tue, 17 Mar 2015 16:30:29 +0100 Message-Id: <1426606235-7238-8-git-send-email-quintela@redhat.com> In-Reply-To: <1426606235-7238-1-git-send-email-quintela@redhat.com> References: <1426606235-7238-1-git-send-email-quintela@redhat.com> Subject: [Qemu-devel] [PULL 07/13] migrate_incoming: Cleanup/clarify error messages List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" From: "Dr. David Alan Gilbert" 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 Reviewed-by: Markus Armbruster Reviewed-by: Eric Blake Reviewed-by: Amit Shah Signed-off-by: Juan Quintela --- 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