migration: Create migrate_block_bitmap_mapping() function
Notice that we changed the test of ->has_block_bitmap_mapping for the test that block_bitmap_mapping is not NULL. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> --- Make it return const (vladimir)
This commit is contained in:
parent
1f2f366c32
commit
b804b35b1c
@ -605,11 +605,12 @@ static int init_dirty_bitmap_migration(DBMSaveState *s)
|
|||||||
SaveBitmapState *dbms;
|
SaveBitmapState *dbms;
|
||||||
GHashTable *handled_by_blk = g_hash_table_new(NULL, NULL);
|
GHashTable *handled_by_blk = g_hash_table_new(NULL, NULL);
|
||||||
BlockBackend *blk;
|
BlockBackend *blk;
|
||||||
const MigrationParameters *mig_params = &migrate_get_current()->parameters;
|
|
||||||
GHashTable *alias_map = NULL;
|
GHashTable *alias_map = NULL;
|
||||||
|
const BitmapMigrationNodeAliasList *block_bitmap_mapping =
|
||||||
|
migrate_block_bitmap_mapping();
|
||||||
|
|
||||||
if (mig_params->has_block_bitmap_mapping) {
|
if (block_bitmap_mapping) {
|
||||||
alias_map = construct_alias_map(mig_params->block_bitmap_mapping, true,
|
alias_map = construct_alias_map(block_bitmap_mapping, true,
|
||||||
&error_abort);
|
&error_abort);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1158,7 +1159,8 @@ static int dirty_bitmap_load_header(QEMUFile *f, DBMLoadState *s,
|
|||||||
static int dirty_bitmap_load(QEMUFile *f, void *opaque, int version_id)
|
static int dirty_bitmap_load(QEMUFile *f, void *opaque, int version_id)
|
||||||
{
|
{
|
||||||
GHashTable *alias_map = NULL;
|
GHashTable *alias_map = NULL;
|
||||||
const MigrationParameters *mig_params = &migrate_get_current()->parameters;
|
const BitmapMigrationNodeAliasList *block_bitmap_mapping =
|
||||||
|
migrate_block_bitmap_mapping();
|
||||||
DBMLoadState *s = &((DBMState *)opaque)->load;
|
DBMLoadState *s = &((DBMState *)opaque)->load;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
@ -1170,8 +1172,8 @@ static int dirty_bitmap_load(QEMUFile *f, void *opaque, int version_id)
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mig_params->has_block_bitmap_mapping) {
|
if (block_bitmap_mapping) {
|
||||||
alias_map = construct_alias_map(mig_params->block_bitmap_mapping,
|
alias_map = construct_alias_map(block_bitmap_mapping,
|
||||||
false, &error_abort);
|
false, &error_abort);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -455,6 +455,13 @@ void qmp_migrate_set_capabilities(MigrationCapabilityStatusList *params,
|
|||||||
|
|
||||||
/* parameters */
|
/* parameters */
|
||||||
|
|
||||||
|
const BitmapMigrationNodeAliasList *migrate_block_bitmap_mapping(void)
|
||||||
|
{
|
||||||
|
MigrationState *s = migrate_get_current();
|
||||||
|
|
||||||
|
return s->parameters.block_bitmap_mapping;
|
||||||
|
}
|
||||||
|
|
||||||
bool migrate_block_incremental(void)
|
bool migrate_block_incremental(void)
|
||||||
{
|
{
|
||||||
MigrationState *s = migrate_get_current();
|
MigrationState *s = migrate_get_current();
|
||||||
|
@ -62,6 +62,7 @@ bool migrate_cap_set(int cap, bool value, Error **errp);
|
|||||||
|
|
||||||
/* parameters */
|
/* parameters */
|
||||||
|
|
||||||
|
const BitmapMigrationNodeAliasList *migrate_block_bitmap_mapping(void);
|
||||||
bool migrate_block_incremental(void);
|
bool migrate_block_incremental(void);
|
||||||
uint32_t migrate_checkpoint_delay(void);
|
uint32_t migrate_checkpoint_delay(void);
|
||||||
int migrate_compress_level(void);
|
int migrate_compress_level(void);
|
||||||
|
Loading…
Reference in New Issue
Block a user