[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 42/43] migration: Create migrate_block_bitmap_mapping() function
From: |
Juan Quintela |
Subject: |
[PATCH 42/43] migration: Create migrate_block_bitmap_mapping() function |
Date: |
Thu, 2 Mar 2023 17:34:09 +0100 |
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>
---
migration/options.h | 1 +
migration/block-dirty-bitmap.c | 14 ++++++++------
migration/options.c | 7 +++++++
3 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/migration/options.h b/migration/options.h
index 3284f95312..698514cf76 100644
--- a/migration/options.h
+++ b/migration/options.h
@@ -64,6 +64,7 @@ bool migrate_cap_set(int cap, bool value, Error **errp);
/* parameters */
+BitmapMigrationNodeAliasList *migrate_block_bitmap_mapping(void);
bool migrate_block_incremental(void);
uint32_t migrate_checkpoint_delay(void);
int migrate_compress_level(void);
diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
index a6ffae0002..62b2352bbb 100644
--- a/migration/block-dirty-bitmap.c
+++ b/migration/block-dirty-bitmap.c
@@ -605,11 +605,12 @@ static int init_dirty_bitmap_migration(DBMSaveState *s)
SaveBitmapState *dbms;
GHashTable *handled_by_blk = g_hash_table_new(NULL, NULL);
BlockBackend *blk;
- const MigrationParameters *mig_params = &migrate_get_current()->parameters;
GHashTable *alias_map = NULL;
+ BitmapMigrationNodeAliasList *block_bitmap_mapping =
+ migrate_block_bitmap_mapping();
- if (mig_params->has_block_bitmap_mapping) {
- alias_map = construct_alias_map(mig_params->block_bitmap_mapping, true,
+ if (block_bitmap_mapping) {
+ alias_map = construct_alias_map(block_bitmap_mapping, true,
&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)
{
GHashTable *alias_map = NULL;
- const MigrationParameters *mig_params = &migrate_get_current()->parameters;
+ BitmapMigrationNodeAliasList *block_bitmap_mapping =
+ migrate_block_bitmap_mapping();
DBMLoadState *s = &((DBMState *)opaque)->load;
int ret = 0;
@@ -1170,8 +1172,8 @@ static int dirty_bitmap_load(QEMUFile *f, void *opaque,
int version_id)
return -EINVAL;
}
- if (mig_params->has_block_bitmap_mapping) {
- alias_map = construct_alias_map(mig_params->block_bitmap_mapping,
+ if (block_bitmap_mapping) {
+ alias_map = construct_alias_map(block_bitmap_mapping,
false, &error_abort);
}
diff --git a/migration/options.c b/migration/options.c
index 96d20a9cfc..e7f66cfc26 100644
--- a/migration/options.c
+++ b/migration/options.c
@@ -456,6 +456,13 @@ void
qmp_migrate_set_capabilities(MigrationCapabilityStatusList *params,
/* parameters */
+BitmapMigrationNodeAliasList *migrate_block_bitmap_mapping(void)
+{
+ MigrationState *s = migrate_get_current();
+
+ return s->parameters.block_bitmap_mapping;
+}
+
bool migrate_block_incremental(void)
{
MigrationState *s = migrate_get_current();
--
2.39.2
- [PATCH 30/43] migration: Create migrate_max_bandwidth() function, (continued)
- [PATCH 30/43] migration: Create migrate_max_bandwidth() function, Juan Quintela, 2023/03/02
- [PATCH 32/43] migration: Move qmp_migrate_set_parameters() to options.c, Juan Quintela, 2023/03/02
- [PATCH 34/43] migration: Make all functions check have the same format, Juan Quintela, 2023/03/02
- [PATCH 23/43] migration: Create migrate_max_cpu_throttle(), Juan Quintela, 2023/03/02
- [PATCH 31/43] migration: Move qmp_query_migrate_parameters() to options.c, Juan Quintela, 2023/03/02
- [PATCH 37/43] migration: Move block_cleanup_parameters() to options.c, Juan Quintela, 2023/03/02
- [PATCH 39/43] migration: Create migrate_tls_creds() function, Juan Quintela, 2023/03/02
- [PATCH 41/43] migration: Create migrate_tls_hostname() function, Juan Quintela, 2023/03/02
- [PATCH 38/43] migration: Remove MigrationState from block_cleanup_parameters(), Juan Quintela, 2023/03/02
- [PATCH 40/43] migration: Create migrate_tls_authz() function, Juan Quintela, 2023/03/02
- [PATCH 42/43] migration: Create migrate_block_bitmap_mapping() function,
Juan Quintela <=
- [PATCH 43/43] migration: Move migration_properties to options.c, Juan Quintela, 2023/03/02
- [PATCH 36/43] migration: Move migrate_set_block_incremental() to options.c, Juan Quintela, 2023/03/02
- Re: [PATCH 00/43] Migration: Create options.c for capabilities/params/properties, Vladimir Sementsov-Ogievskiy, 2023/03/06