From patchwork Mon Jul 29 13:01:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 262757 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)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4CF0D2C0104 for ; Mon, 29 Jul 2013 23:02:59 +1000 (EST) Received: from localhost ([::1]:35765 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3n6H-0005jG-8j for incoming@patchwork.ozlabs.org; Mon, 29 Jul 2013 09:02:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39613) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3n5j-0005XK-AJ for qemu-devel@nongnu.org; Mon, 29 Jul 2013 09:02:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V3n5d-00012p-0A for qemu-devel@nongnu.org; Mon, 29 Jul 2013 09:02:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5334) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3n5c-00012k-Mg for qemu-devel@nongnu.org; Mon, 29 Jul 2013 09:02:16 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r6TD2Ff0025257 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 29 Jul 2013 09:02:16 -0400 Received: from localhost (ovpn-112-50.ams2.redhat.com [10.36.112.50]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r6TD2Efq006601; Mon, 29 Jul 2013 09:02:15 -0400 From: Stefan Hajnoczi To: Date: Mon, 29 Jul 2013 15:01:58 +0200 Message-Id: <1375102920-18817-3-git-send-email-stefanha@redhat.com> In-Reply-To: <1375102920-18817-1-git-send-email-stefanha@redhat.com> References: <1375102920-18817-1-git-send-email-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Kevin Wolf , "Michael R. Hines" , Stefan Hajnoczi , Juan Quintela Subject: [Qemu-devel] [PATCH v3 2/4] migration: fix spice migration 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 Commit 29ae8a4133082e16970c9d4be09f4b6a15034617 ("rdma: introduce MIG_STATE_NONE and change MIG_STATE_SETUP state transition") changed the state transitions during migration setup. Spice used to be notified with MIG_STATE_ACTIVE and it detected this using migration_is_active(). Spice is now notified with MIG_STATE_SETUP and migration_is_active() no longer works. Replace migration_is_active() with migration_in_setup() to fix spice migration. Cc: Michael R. Hines Signed-off-by: Stefan Hajnoczi --- include/migration/migration.h | 2 +- migration.c | 4 ++-- ui/spice-core.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/migration/migration.h b/include/migration/migration.h index 08c772d..140e6b4 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -90,7 +90,7 @@ int migrate_fd_close(MigrationState *s); void add_migration_state_change_notifier(Notifier *notify); void remove_migration_state_change_notifier(Notifier *notify); -bool migration_is_active(MigrationState *); +bool migration_in_setup(MigrationState *); bool migration_has_finished(MigrationState *); bool migration_has_failed(MigrationState *); MigrationState *migrate_get_current(void); diff --git a/migration.c b/migration.c index a5ed26b..9fc7294 100644 --- a/migration.c +++ b/migration.c @@ -338,9 +338,9 @@ void remove_migration_state_change_notifier(Notifier *notify) notifier_remove(notify); } -bool migration_is_active(MigrationState *s) +bool migration_in_setup(MigrationState *s) { - return s->state == MIG_STATE_ACTIVE; + return s->state == MIG_STATE_SETUP; } bool migration_has_finished(MigrationState *s) diff --git a/ui/spice-core.c b/ui/spice-core.c index f308fd9..033fd89 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -563,7 +563,7 @@ static void migration_state_notifier(Notifier *notifier, void *data) { MigrationState *s = data; - if (migration_is_active(s)) { + if (migration_in_setup(s)) { spice_server_migrate_start(spice_server); } else if (migration_has_finished(s)) { spice_server_migrate_end(spice_server, true);