Skip to contentSkip to conversation

migration: fix the Unknown ending state error log

PATCH In review Lidong Chen 4 participants 6 messages Jul 24, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 migration: fix the Unknown ending state error log

When cancelling migration, the state is MIGRATION_STATUS_CANCELLING. The state change to MIGRATION_STATUS_CANCELLED when cleanup_bh is scheduled. So when migration_iteration_finish is invoked, the state should be MIGRATION_STATUS_CANCELLING.

---
 migration/migration.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
migration/migration.c +1 -1
index 8d56d56..ff05422 100644
@@ -2876,7 +2876,7 @@ static void migration_iteration_finish(MigrationState *s)
         s->vm_was_running = true;
         /* Fallthrough */
     case MIGRATION_STATUS_FAILED:
-    case MIGRATION_STATUS_CANCELLED:
+    case MIGRATION_STATUS_CANCELLING:
         if (s->vm_was_running) {
             vm_start();
         } else {
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 2/2 migration: fix duplicate initialization for expected_downtime and cleanup_bh

migrate_fd_connect duplicate initialize expected_downtime and cleanup_bh.

---
 migration/migration.c | 2 --
 1 file changed, 2 deletions(-)
migration/migration.c +0 -2
index ff05422..b8c4fec 100644
@@ -3032,8 +3032,6 @@ void migrate_fd_connect(MigrationState *s, Error *error_in)
     } else {
         /* This is a fresh new migration */
         rate_limit = s->parameters.max_bandwidth / XFER_LIMIT_RATIO;
-        s->expected_downtime = s->parameters.downtime_limit;
-        s->cleanup_bh = qemu_bh_new(migrate_fd_cleanup, s);
 
         /* Notify before starting migration thread */
         notifier_list_notify(&migration_state_notifiers, s);
Signature · 1 line
1.8.3.1
#5 lore raw
In reply to Lidong Chen
Quoted 6 lines · Lidong Chen

When cancelling migration, the state is MIGRATION_STATUS_CANCELLING. The state change to MIGRATION_STATUS_CANCELLED when cleanup_bh is scheduled. So when migration_iteration_finish is invoked, the state should be MIGRATION_STATUS_CANCELLING.

Thanks, Lidong. Dave just posted the same patch some days ago:

[PATCH] migrate: Fix cancelling state warning

Quoted 21 lines
---
 migration/migration.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
migration/migration.c +1 -1
index 8d56d56..ff05422 100644
@@ -2876,7 +2876,7 @@ static void migration_iteration_finish(MigrationState *s)
         s->vm_was_running = true;
         /* Fallthrough */
     case MIGRATION_STATUS_FAILED:
-    case MIGRATION_STATUS_CANCELLED:
+    case MIGRATION_STATUS_CANCELLING:
         if (s->vm_was_running) {
             vm_start();
         } else {
Signature · 1 line
1.8.3.1

Regards,

Signature · 1 line
Peter Xu
Reviewed-by on v1 2/2
#2 lore raw

Re: [Qemu-devel] [PATCH 2/2] migration: fix duplicate initialization for expected_downtime and cleanup_bh

In reply to Lidong Chen
Quoted 3 lines · Lidong Chen

migrate_fd_connect duplicate initialize expected_downtime and cleanup_bh.

This seems correct to me.

Quoted 21 lines
---
 migration/migration.c | 2 --
 1 file changed, 2 deletions(-)
migration/migration.c +0 -2
index ff05422..b8c4fec 100644
@@ -3032,8 +3032,6 @@ void migrate_fd_connect(MigrationState *s, Error *error_in)
     } else {
         /* This is a fresh new migration */
         rate_limit = s->parameters.max_bandwidth / XFER_LIMIT_RATIO;
-        s->expected_downtime = s->parameters.downtime_limit;
-        s->cleanup_bh = qemu_bh_new(migrate_fd_cleanup, s);
 
         /* Notify before starting migration thread */
         notifier_list_notify(&migration_state_notifiers, s);
Signature · 1 line
1.8.3.1

Regards,

Signature · 1 line
Peter Xu
Reviewed-by on v1 2/2
#3 lore raw

Re: [Qemu-devel] [PATCH 2/2] migration: fix duplicate initialization for expected_downtime and cleanup_bh

In reply to Lidong Chen
Quoted 3 lines · Lidong Chen

migrate_fd_connect duplicate initialize expected_downtime and cleanup_bh.

Good catch.

Inserted here.

commit d3e35b8f6248eab2c3d412198a487ae49706b214

Author: Peter Xu <[email protected]>
Date:   Wed May 2 18:47:24 2018 +0800
Quoted 17 lines
---
 migration/migration.c | 2 --
 1 file changed, 2 deletions(-)
migration/migration.c +0 -2
index ff05422..b8c4fec 100644
@@ -3032,8 +3032,6 @@ void migrate_fd_connect(MigrationState *s, Error *error_in)
     } else {
         /* This is a fresh new migration */
         rate_limit = s->parameters.max_bandwidth / XFER_LIMIT_RATIO;
-        s->expected_downtime = s->parameters.downtime_limit;
-        s->cleanup_bh = qemu_bh_new(migrate_fd_cleanup, s);
 
         /* Notify before starting migration thread */
         notifier_list_notify(&migration_state_notifiers, s);
#4 lore raw

Re: [Qemu-devel] [PATCH 2/2] migration: fix duplicate initialization for expected_downtime and cleanup_bh

In reply to Lidong Chen
Quoted 1 line · * Lidong Chen ([email protected]) wrote:

migrate_fd_connect duplicate initialize expected_downtime and cleanup_bh.

Queued (just 2/2)

Quoted 22 lines
---
 migration/migration.c | 2 --
 1 file changed, 2 deletions(-)
migration/migration.c +0 -2
index ff05422..b8c4fec 100644
@@ -3032,8 +3032,6 @@ void migrate_fd_connect(MigrationState *s, Error *error_in)
     } else {
         /* This is a fresh new migration */
         rate_limit = s->parameters.max_bandwidth / XFER_LIMIT_RATIO;
-        s->expected_downtime = s->parameters.downtime_limit;
-        s->cleanup_bh = qemu_bh_new(migrate_fd_cleanup, s);
 
         /* Notify before starting migration thread */
         notifier_list_notify(&migration_state_notifiers, s);
Signature · 1 line
1.8.3.1

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK