qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 2/4] migration: fix spice migration


From: Michael R. Hines
Subject: Re: [Qemu-devel] [PATCH v3 2/4] migration: fix spice migration
Date: Mon, 29 Jul 2013 10:46:50 -0400
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130329 Thunderbird/17.0.5

On 07/29/2013 09:01 AM, Stefan Hajnoczi wrote:
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 <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
  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);

Do we really have to replace this function? Can we just add a new function?

- Michael




reply via email to

[Prev in Thread] Current Thread [Next in Thread]