From patchwork Tue Oct 11 10:00:23 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 118895 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 2EDF6B6F6F for ; Tue, 11 Oct 2011 21:02:29 +1100 (EST) Received: from localhost ([::1]:40090 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RDZAF-0000lV-NC for incoming@patchwork.ozlabs.org; Tue, 11 Oct 2011 06:02:23 -0400 Received: from eggs.gnu.org ([140.186.70.92]:35160) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RDZA2-0000JK-Bt for qemu-devel@nongnu.org; Tue, 11 Oct 2011 06:02:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RDZA0-00087y-Mh for qemu-devel@nongnu.org; Tue, 11 Oct 2011 06:02:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:9506) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RDZA0-00087l-DS for qemu-devel@nongnu.org; Tue, 11 Oct 2011 06:02:08 -0400 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 p9BA27nZ023125 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 11 Oct 2011 06:02:07 -0400 Received: from neno.neno (ovpn-116-17.ams2.redhat.com [10.36.116.17]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p9BA1lvk021320; Tue, 11 Oct 2011 06:02:06 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Tue, 11 Oct 2011 12:00:23 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 03/36] migration: Check that migration is active before cancel it 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 Signed-off-by: Juan Quintela Reviewed-by: Anthony Liguori --- migration.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/migration.c b/migration.c index 7fd6c23..71b8aad 100644 --- a/migration.c +++ b/migration.c @@ -133,9 +133,9 @@ int do_migrate_cancel(Monitor *mon, const QDict *qdict, QObject **ret_data) { MigrationState *s = current_migration; - if (s) + if (s && s->get_status(s) == MIG_STATE_ACTIVE) { s->cancel(s); - + } return 0; }