From patchwork Tue Mar 1 07:08:09 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshiaki Tamura X-Patchwork-Id: 84908 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 E1369B70E8 for ; Tue, 1 Mar 2011 18:12:14 +1100 (EST) Received: from localhost ([127.0.0.1]:33981 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PuJkh-0002Kf-Ui for incoming@patchwork.ozlabs.org; Tue, 01 Mar 2011 02:12:12 -0500 Received: from [140.186.70.92] (port=38639 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PuJhZ-00016o-EP for qemu-devel@nongnu.org; Tue, 01 Mar 2011 02:08:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PuJhY-000885-BL for qemu-devel@nongnu.org; Tue, 01 Mar 2011 02:08:57 -0500 Received: from sh.osrg.net ([192.16.179.4]:45609) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PuJhX-00086n-T2 for qemu-devel@nongnu.org; Tue, 01 Mar 2011 02:08:56 -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 p2178kKX016911; Tue, 1 Mar 2011 16:08:47 +0900 Received: from localhost (hype-nh0.osrg.net [10.72.1.48]) by fs.osrg.net (Postfix) with ESMTP id AD6853E00BE; Tue, 1 Mar 2011 16:08:46 +0900 (JST) From: Yoshiaki Tamura To: qemu-devel@nongnu.org Date: Tue, 1 Mar 2011 16:08:09 +0900 Message-Id: <1298963289-16034-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: 50 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (sh.osrg.net [192.16.179.4]); Tue, 01 Mar 2011 16:08:48 +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 v2] 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 This patch checks s->state == MIG_STATE_CANCEL instead of s->state != MIG_STATE_ACTIVE. With this patch the message above would be: Migration status: cancelled Please note that the following patches are prerequisite. http://www.mail-archive.com/qemu-devel@nongnu.org/msg56448.html http://www.mail-archive.com/qemu-devel@nongnu.org/msg56446.html Signed-off-by: Yoshiaki Tamura --- migration.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/migration.c b/migration.c index 14a125f..0e551e2 100644 --- a/migration.c +++ b/migration.c @@ -406,16 +406,19 @@ void migrate_fd_cancel(MigrationState *mig_state) { FdMigrationState *s = migrate_to_fms(mig_state); - if (s->state != MIG_STATE_ACTIVE) + if (s->state == MIG_STATE_CANCELLED) { return; + } DPRINTF("cancelling migration\n"); s->state = MIG_STATE_CANCELLED; notifier_list_notify(&migration_state_notifiers); - qemu_savevm_state_cancel(s->mon, s->file); - migrate_fd_cleanup(s); + if (s->file) { + qemu_savevm_state_cancel(s->mon, s->file); + migrate_fd_cleanup(s); + } } void migrate_fd_release(MigrationState *mig_state)