From patchwork Mon Jan 6 22:03:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 307461 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 9440B2C00CF for ; Tue, 7 Jan 2014 09:09:56 +1100 (EST) Received: from localhost ([::1]:37833 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0IMs-0006ZO-D9 for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2014 17:09:54 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51807) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0IGp-00005y-WC for qemu-devel@nongnu.org; Mon, 06 Jan 2014 17:03:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W0IGk-00013G-1K for qemu-devel@nongnu.org; Mon, 06 Jan 2014 17:03:39 -0500 Received: from mx1.redhat.com ([209.132.183.28]:21406) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0IGj-00012s-OZ for qemu-devel@nongnu.org; Mon, 06 Jan 2014 17:03:33 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s06M3Uir016624 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 6 Jan 2014 17:03:31 -0500 Received: from localhost (ovpn-113-124.phx2.redhat.com [10.3.113.124]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id s06M3Uex030678; Mon, 6 Jan 2014 17:03:30 -0500 From: Luiz Capitulino To: anthony@codemonkey.ws Date: Mon, 6 Jan 2014 17:03:15 -0500 Message-Id: <1389045795-18706-15-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1389045795-18706-1-git-send-email-lcapitulino@redhat.com> References: <1389045795-18706-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: qemu-devel@nongnu.org Subject: [Qemu-devel] [PULL 14/14] migration: qmp_migrate(): keep working after syntax error X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org If a user or QMP client enter a bad syntax for the migrate command in QMP/HMP, then the migrate command will never succeed from that point on. For example, if you enter: (qemu) migrate tcp;0:4444 migrate: Parameter 'uri' expects a valid migration protocol Then the migrate command will always fail from now on: (qemu) migrate tcp:0:4444 migrate: There's a migration process in progress The problem is that qmp_migrate() sets the migration status to MIG_STATE_SETUP and doesn't reset it on syntax error. This bug was introduced by commit 29ae8a4133082e16970c9d4be09f4b6a15034617. Reviewed-by: Michael R. Hines Signed-off-by: Luiz Capitulino --- migration.c | 1 + 1 file changed, 1 insertion(+) diff --git a/migration.c b/migration.c index 2b1ab20..557195a 100644 --- a/migration.c +++ b/migration.c @@ -437,6 +437,7 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk, #endif } else { error_set(errp, QERR_INVALID_PARAMETER_VALUE, "uri", "a valid migration protocol"); + s->state = MIG_STATE_ERROR; return; }