aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--migration/options.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/migration/options.c b/migration/options.c
index 8d8ec73ad9..3e3e0b93b4 100644
--- a/migration/options.c
+++ b/migration/options.c
@@ -833,8 +833,10 @@ uint64_t migrate_max_postcopy_bandwidth(void)
MigMode migrate_mode(void)
{
MigrationState *s = migrate_get_current();
+ MigMode mode = s->parameters.mode;
- return s->parameters.mode;
+ assert(mode >= 0 && mode < MIG_MODE__MAX);
+ return mode;
}
int migrate_multifd_channels(void)