migration: Fix block_bitmap_mapping migration
It is valid that params->has_block_bitmap_mapping is true and
params->block_bitmap_mapping is NULL. So we can't use the trick of
having a single function.
Move to two functions one for each value and the tests are fixed.
Fixes: b804b35b1c8a0edfd127ac20819c234be55ac7fc
migration: Create migrate_block_bitmap_mapping() function
Reported-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Message-Id: <20230503181036.14890-1-quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
diff --git a/migration/options.c b/migration/options.c
index 53b7fc5..7395787 100644
--- a/migration/options.c
+++ b/migration/options.c
@@ -626,6 +626,13 @@
return s->parameters.block_bitmap_mapping;
}
+bool migrate_has_block_bitmap_mapping(void)
+{
+ MigrationState *s = migrate_get_current();
+
+ return s->parameters.has_block_bitmap_mapping;
+}
+
bool migrate_block_incremental(void)
{
MigrationState *s = migrate_get_current();