Skip to contentSkip to conversation

migration/postcopy: start_postcopy could be true only when migrate_postcopy() return true

PATCH In review Wei Yang 2 participants 3 messages Jul 18, 2019 – Aug 7, 2019

lore
Share & tools
lore

Wei Yang

author
#0 lore raw

PATCH 1/1 migration/postcopy: start_postcopy could be true only when migrate_postcopy() return true

There is only one place to set start_postcopy to true, qmp_migrate_start_postcopy(), which make sure start_postcopy could be set to true when migrate_postcopy() return true.

So start_postcopy is true implies the other one.

---
 migration/migration.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
migration/migration.c +1 -2
index 719d125041..27ca10122f 100644
@@ -3101,8 +3101,7 @@ static MigIterateState migration_iteration_run(MigrationState *s)
 
     if (pending_size && pending_size >= s->threshold_size) {
         /* Still a significant amount to transfer */
-        if (migrate_postcopy() && !in_postcopy &&
-            pend_pre <= s->threshold_size &&
+        if (!in_postcopy && pend_pre <= s->threshold_size &&
             atomic_read(&s->start_postcopy)) {
             if (postcopy_start(s)) {
                 error_report("%s: postcopy failed to start", __func__);
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · * Wei Yang ([email protected]) wrote:

There is only one place to set start_postcopy to true, qmp_migrate_start_postcopy(), which make sure start_postcopy could be set to true when migrate_postcopy() return true.

So start_postcopy is true implies the other one.

Quoted 21 lines
---
 migration/migration.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
migration/migration.c +1 -2
index 719d125041..27ca10122f 100644
@@ -3101,8 +3101,7 @@ static MigIterateState migration_iteration_run(MigrationState *s)
 
     if (pending_size && pending_size >= s->threshold_size) {
         /* Still a significant amount to transfer */
-        if (migrate_postcopy() && !in_postcopy &&
-            pend_pre <= s->threshold_size &&
+        if (!in_postcopy && pend_pre <= s->threshold_size &&
             atomic_read(&s->start_postcopy)) {
             if (postcopy_start(s)) {
                 error_report("%s: postcopy failed to start", __func__);
Signature · 1 line
2.17.1

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

#2 lore raw
In reply to Wei Yang
Quoted 7 lines · * Wei Yang ([email protected]) wrote:

There is only one place to set start_postcopy to true, qmp_migrate_start_postcopy(), which make sure start_postcopy could be set to true when migrate_postcopy() return true.

So start_postcopy is true implies the other one.

Queued

Quoted 22 lines
---
 migration/migration.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
migration/migration.c +1 -2
index 719d125041..27ca10122f 100644
@@ -3101,8 +3101,7 @@ static MigIterateState migration_iteration_run(MigrationState *s)
 
     if (pending_size && pending_size >= s->threshold_size) {
         /* Still a significant amount to transfer */
-        if (migrate_postcopy() && !in_postcopy &&
-            pend_pre <= s->threshold_size &&
+        if (!in_postcopy && pend_pre <= s->threshold_size &&
             atomic_read(&s->start_postcopy)) {
             if (postcopy_start(s)) {
                 error_report("%s: postcopy failed to start", __func__);
Signature · 1 line
2.17.1

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