From b605c47b57b58e61a901a50a0762dccf43d94783 Mon Sep 17 00:00:00 2001 From: Peter Xu Date: Wed, 5 Jul 2017 16:21:20 +0800 Subject: [PATCH] migration: fix handling for --only-migratable MigrateState object is not ready at that time, so we'll get an assertion. Use qemu_global_option() instead. Reported-by: Eduardo Habkost Suggested-by: Eduardo Habkost Reviewed-by: Eduardo Habkost Reviewed-by: Juan Quintela Fixes: 3df663e ("migration: move only_migratable to MigrationState") Signed-off-by: Peter Xu Message-Id: <1499242883-2184-2-git-send-email-peterx@redhat.com> Signed-off-by: Dr. David Alan Gilbert --- include/migration/misc.h | 1 - migration/migration.c | 5 ----- vl.c | 2 +- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/include/migration/misc.h b/include/migration/misc.h index 22551216bb..c079b7771b 100644 --- a/include/migration/misc.h +++ b/include/migration/misc.h @@ -53,7 +53,6 @@ bool migration_has_finished(MigrationState *); bool migration_has_failed(MigrationState *); /* ...and after the device transmission */ bool migration_in_postcopy_after_devices(MigrationState *); -void migration_only_migratable_set(void); void migration_global_dump(Monitor *mon); #endif diff --git a/migration/migration.c b/migration/migration.c index 51ccd1a4c5..dbdc121838 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -128,11 +128,6 @@ MigrationState *migrate_get_current(void) return current_migration; } -void migration_only_migratable_set(void) -{ - migrate_get_current()->only_migratable = true; -} - MigrationIncomingState *migration_incoming_get_current(void) { static bool once; diff --git a/vl.c b/vl.c index d17c863409..7a015eccc6 100644 --- a/vl.c +++ b/vl.c @@ -3962,7 +3962,7 @@ int main(int argc, char **argv, char **envp) * * "-global migration.only-migratable=true" */ - migration_only_migratable_set(); + qemu_global_option("migration.only-migratable=true"); break; case QEMU_OPTION_nodefaults: has_defaults = 0;