From patchwork Tue Sep 20 13:24:42 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 115532 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 186BAB6FA6 for ; Tue, 20 Sep 2011 23:25:27 +1000 (EST) Received: from localhost ([::1]:35445 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R60K2-0000n4-TS for incoming@patchwork.ozlabs.org; Tue, 20 Sep 2011 09:25:14 -0400 Received: from eggs.gnu.org ([140.186.70.92]:45102) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R60Jr-0000kF-HB for qemu-devel@nongnu.org; Tue, 20 Sep 2011 09:25:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R60Jm-00056S-0u for qemu-devel@nongnu.org; Tue, 20 Sep 2011 09:25:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45913) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R60Jl-00056O-Lc for qemu-devel@nongnu.org; Tue, 20 Sep 2011 09:24:57 -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 p8KDOvh0022862 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 20 Sep 2011 09:24:57 -0400 Received: from trasno.mitica (ovpn-113-56.phx2.redhat.com [10.3.113.56]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p8KDOpQj017005; Tue, 20 Sep 2011 09:24:56 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Tue, 20 Sep 2011 15:24:42 +0200 Message-Id: <7763b0c43dadb553b0310f99c079e5eea2c11272.1316524908.git.quintela@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 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 3/7] 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 --- migration.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/migration.c b/migration.c index 15d001e..c56d29c 100644 --- a/migration.c +++ b/migration.c @@ -132,9 +132,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; }