From patchwork Thu Feb 24 09:53:50 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshiaki Tamura X-Patchwork-Id: 84374 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 7BD53B7118 for ; Thu, 24 Feb 2011 20:55:04 +1100 (EST) Received: from localhost ([127.0.0.1]:54964 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PsXuX-0008OX-Ey for incoming@patchwork.ozlabs.org; Thu, 24 Feb 2011 04:55:01 -0500 Received: from [140.186.70.92] (port=43603 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PsXtz-00080C-Ul for qemu-devel@nongnu.org; Thu, 24 Feb 2011 04:54:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PsXty-0003AM-7e for qemu-devel@nongnu.org; Thu, 24 Feb 2011 04:54:27 -0500 Received: from sh.osrg.net ([192.16.179.4]:49066) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PsXtx-0003A2-Nt for qemu-devel@nongnu.org; Thu, 24 Feb 2011 04:54:26 -0500 Received: from fs.osrg.net (postfix@fs.osrg.net [10.0.0.12]) by sh.osrg.net (8.14.3/8.14.3/OSRG-NET) with ESMTP id p1O9sI8d031901; Thu, 24 Feb 2011 18:54:19 +0900 Received: from localhost (hype-nh0.osrg.net [10.72.1.48]) by fs.osrg.net (Postfix) with ESMTP id 231963E0246; Thu, 24 Feb 2011 18:54:18 +0900 (JST) From: Yoshiaki Tamura To: qemu-devel@nongnu.org Date: Thu, 24 Feb 2011 18:53:50 +0900 Message-Id: <1298541230-28832-1-git-send-email-tamura.yoshiaki@lab.ntt.co.jp> X-Mailer: git-send-email 1.7.1.2 X-Dispatcher: imput version 20070423(IM149) Lines: 44 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (sh.osrg.net [192.16.179.4]); Thu, 24 Feb 2011 18:54:19 +0900 (JST) X-Virus-Scanned: clamav-milter 0.96.5 at sh X-Virus-Status: Clean X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 192.16.179.4 Cc: pbonzini@redhat.com, Yoshiaki Tamura , quintela@redhat.com Subject: [Qemu-devel] [PATCH] migration: allow setting MIG_STATE_CANCEL even if s->state != MIG_STATE_ACTIVE. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org After migration failure, even a user commands migrate_cancel, it keeps saying: Migration status: failed Move checking s->state is MIG_STATE_ACTIVE, to allow setting MIG_STATE_CANCEL even if s->state != MIG_STATE_ACTIVE. With this patch the message above would be: Migration status: cancelled Signed-off-by: Yoshiaki Tamura --- migration.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/migration.c b/migration.c index af3a1f2..098885f 100644 --- a/migration.c +++ b/migration.c @@ -409,15 +409,16 @@ void migrate_fd_cancel(MigrationState *mig_state) { FdMigrationState *s = migrate_to_fms(mig_state); - if (s->state != MIG_STATE_ACTIVE) - return; - DPRINTF("cancelling migration\n"); s->state = MIG_STATE_CANCELLED; notifier_list_notify(&migration_state_notifiers); - qemu_savevm_state_cancel(s->mon, s->file); + if (s->state != MIG_STATE_ACTIVE) { + return; + } + + qemu_savevm_state_cancel(s->mon, s->file); migrate_fd_cleanup(s); }