migration: current_migration is never NULL
PATCH 1/1 migration: current_migration is never NULL
migration_object_init() create and assign current_migration, which means it will never be null until migration_shutdown().
--- migration/migration.c | 4 ---- 1 file changed, 4 deletions(-)
migration/migration.c +0 -4
@@ -1667,10 +1667,6 @@ bool migration_is_idle(void) {MigrationState *s = current_migration; -if (!s) { -return true; - } -switch (s->state) {case MIGRATION_STATUS_NONE :case MIGRATION_STATUS_CANCELLED :
Signature · 1 line
2.19.1
Quoted 13 lines · * Wei Yang ([email protected]) wrote:
migration_object_init()create and assigncurrent_migration, which means it will never be null untilmigration_shutdown().Signed-off-by Wei Yang <[email protected]>--- migration/migration.c | 4 ---- 1 file changed, 4 deletions(-)migration/migration.c +0
-0
migration/migration.c bool migration_is_idle(void) · line 1673
Quoted 7 lines
migration/migration.c +0
-4@@ -1667,10 +1667,6 @@ bool migration_is_idle(void) {MigrationState *s = current_migration; -if (!s) { -return true; - } -
I'd prefer to keep that because it's used by migrate_add_blocker and without this check it means we'd only be able to add a blocker after the migration object init - which is probably fine but we would have to check all the cases and make sure no one breaks it in the future; where as this check makes it just work and we don't need to worry about the order.
Dave
Quoted 6 lines
migration/migration.c +0
-0switch (s->state) {case MIGRATION_STATUS_NONE :case MIGRATION_STATUS_CANCELLED :Signature · 1 line
2.19.1
--
Dr. David Alan Gilbert / [email protected] / Manchester, UK
Quoted 17 lines · Dr. David Alan Gilbert
Quoted 16 lines · * Wei Yang ([email protected]) wrote:
migration_object_init()create and assigncurrent_migration, which means it will never be null untilmigration_shutdown().Signed-off-by Wei Yang <[email protected]>--- migration/migration.c | 4 ---- 1 file changed, 4 deletions(-)migration/migration.c +0
-0@@ -1667,10 +1667,6 @@ bool migration_is_idle(void) {MigrationState *s = current_migration;
Quoted 12 lines
migration/migration.c bool migration_is_idle(void) · line 1673
Quoted 4 lines
migration/migration.c +0
-4-if (!s) { -return true; - } -I'd prefer to keep that because it's used by
migrate_add_blockerand without this check it means we'd only be able to add a blocker after the migration object init - which is probably fine but we would have to check all the cases and make sure no one breaks it in the future; where as this check makes it just work and we don't need to worry about the order.
Reasonable, Thanks :-)
Quoted 10 lines
Dave
Quoted 6 lines
migration/migration.c +0
-0switch (s->state) {case MIGRATION_STATUS_NONE :case MIGRATION_STATUS_CANCELLED :Signature · 1 line
2.19.1--
Dr. David Alan Gilbert / [email protected] / Manchester, UK
Signature · 2 lines
Wei Yang Help you, Help me