qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2 0/3] Some minor fixes for migration states
@ 2022-01-27  1:49 Zhang Chen
  2022-01-27  1:49 ` [PATCH V2 1/3] migration/migration.c: Add missed default error handler for migration state Zhang Chen
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Zhang Chen @ 2022-01-27  1:49 UTC (permalink / raw)
  To: Dr. David Alan Gilbert, Juan Quintela, qemu-dev; +Cc: Zhang Chen

This series solved some fixme and comments in code.
Please see the details in each patch commit message.

 --V2:
       -Fix typo.


Zhang Chen (3):
  migration/migration.c: Add missed default error handler for migration
    state
  migration/migration.c: Avoid COLO boot in postcopy migration
  migration/migration.c: Remove the MIGRATION_STATUS_ACTIVE when
    migration finished

 migration/migration.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

-- 
2.25.1



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH V2 1/3] migration/migration.c: Add missed default error handler for migration state
  2022-01-27  1:49 [PATCH V2 0/3] Some minor fixes for migration states Zhang Chen
@ 2022-01-27  1:49 ` Zhang Chen
  2022-01-27  1:49 ` [PATCH V2 2/3] migration/migration.c: Avoid COLO boot in postcopy migration Zhang Chen
  2022-01-27  1:49 ` [PATCH V2 3/3] migration/migration.c: Remove the MIGRATION_STATUS_ACTIVE when migration finished Zhang Chen
  2 siblings, 0 replies; 4+ messages in thread
From: Zhang Chen @ 2022-01-27  1:49 UTC (permalink / raw)
  To: Dr. David Alan Gilbert, Juan Quintela, qemu-dev; +Cc: Zhang Chen

In the migration_completion() no other status is expected, for
example MIGRATION_STATUS_CANCELLING, MIGRATION_STATUS_CANCELLED, etc.

Signed-off-by: Zhang Chen <chen.zhang@intel.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

---
 migration/migration.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/migration/migration.c b/migration/migration.c
index 0652165610..2afa77da03 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -3205,7 +3205,7 @@ static void migration_completion(MigrationState *s)
         qemu_mutex_unlock_iothread();
 
         trace_migration_completion_postcopy_end_after_complete();
-    } else if (s->state == MIGRATION_STATUS_CANCELLING) {
+    } else {
         goto fail;
     }
 
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH V2 2/3] migration/migration.c: Avoid COLO boot in postcopy migration
  2022-01-27  1:49 [PATCH V2 0/3] Some minor fixes for migration states Zhang Chen
  2022-01-27  1:49 ` [PATCH V2 1/3] migration/migration.c: Add missed default error handler for migration state Zhang Chen
@ 2022-01-27  1:49 ` Zhang Chen
  2022-01-27  1:49 ` [PATCH V2 3/3] migration/migration.c: Remove the MIGRATION_STATUS_ACTIVE when migration finished Zhang Chen
  2 siblings, 0 replies; 4+ messages in thread
From: Zhang Chen @ 2022-01-27  1:49 UTC (permalink / raw)
  To: Dr. David Alan Gilbert, Juan Quintela, qemu-dev; +Cc: Zhang Chen

COLO does not support postcopy migration and remove the Fixme.

Signed-off-by: Zhang Chen <chen.zhang@intel.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>

---
 migration/migration.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/migration/migration.c b/migration/migration.c
index 2afa77da03..3fac9c67ca 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -3230,7 +3230,11 @@ static void migration_completion(MigrationState *s)
         goto fail_invalidate;
     }
 
-    if (!migrate_colo_enabled()) {
+    if (migrate_colo_enabled() && s->state == MIGRATION_STATUS_ACTIVE) {
+        /* COLO dose not support postcopy */
+        migrate_set_state(&s->state, MIGRATION_STATUS_ACTIVE,
+                          MIGRATION_STATUS_COLO);
+    } else {
         migrate_set_state(&s->state, current_active_state,
                           MIGRATION_STATUS_COMPLETED);
     }
@@ -3621,10 +3625,6 @@ static void migration_iteration_finish(MigrationState *s)
                          "COLO enabled", __func__);
         }
         migrate_start_colo_process(s);
-        /*
-         * Fixme: we will run VM in COLO no matter its old running state.
-         * After exited COLO, we will keep running.
-         */
          /* Fallthrough */
     case MIGRATION_STATUS_ACTIVE:
         /*
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH V2 3/3] migration/migration.c: Remove the MIGRATION_STATUS_ACTIVE when migration finished
  2022-01-27  1:49 [PATCH V2 0/3] Some minor fixes for migration states Zhang Chen
  2022-01-27  1:49 ` [PATCH V2 1/3] migration/migration.c: Add missed default error handler for migration state Zhang Chen
  2022-01-27  1:49 ` [PATCH V2 2/3] migration/migration.c: Avoid COLO boot in postcopy migration Zhang Chen
@ 2022-01-27  1:49 ` Zhang Chen
  2 siblings, 0 replies; 4+ messages in thread
From: Zhang Chen @ 2022-01-27  1:49 UTC (permalink / raw)
  To: Dr. David Alan Gilbert, Juan Quintela, qemu-dev; +Cc: Zhang Chen

The MIGRATION_STATUS_ACTIVE indicates that migration is running.
Remove it to be handled by the default operation,
It should be part of the unknown ending states.

Signed-off-by: Zhang Chen <chen.zhang@intel.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>

---
 migration/migration.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/migration/migration.c b/migration/migration.c
index 3fac9c67ca..21e1498f46 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -3625,12 +3625,6 @@ static void migration_iteration_finish(MigrationState *s)
                          "COLO enabled", __func__);
         }
         migrate_start_colo_process(s);
-         /* Fallthrough */
-    case MIGRATION_STATUS_ACTIVE:
-        /*
-         * We should really assert here, but since it's during
-         * migration, let's try to reduce the usage of assertions.
-         */
         s->vm_was_running = true;
         /* Fallthrough */
     case MIGRATION_STATUS_FAILED:
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-01-27  2:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-27  1:49 [PATCH V2 0/3] Some minor fixes for migration states Zhang Chen
2022-01-27  1:49 ` [PATCH V2 1/3] migration/migration.c: Add missed default error handler for migration state Zhang Chen
2022-01-27  1:49 ` [PATCH V2 2/3] migration/migration.c: Avoid COLO boot in postcopy migration Zhang Chen
2022-01-27  1:49 ` [PATCH V2 3/3] migration/migration.c: Remove the MIGRATION_STATUS_ACTIVE when migration finished Zhang Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).