BdrvDirtyBitmap *bitmap;
bool before_vm_start_handled; /* set in dirty_bitmap_mig_before_vm_start */
+ BitmapMigrationBitmapAlias *bmap_inner;
/*
* cancelled
}
FOR_EACH_DIRTY_BITMAP(bs, bitmap) {
+ BitmapMigrationBitmapAliasTransform *bitmap_transform = NULL;
bitmap_name = bdrv_dirty_bitmap_name(bitmap);
if (!bitmap_name) {
continue;
}
bitmap_alias = bmap_inner->alias;
+ if (bmap_inner->has_transform) {
+ bitmap_transform = bmap_inner->transform;
+ }
} else {
if (strlen(bitmap_name) > UINT8_MAX) {
error_report("Cannot migrate bitmap '%s' on node '%s': "
if (bdrv_dirty_bitmap_enabled(bitmap)) {
dbms->flags |= DIRTY_BITMAP_MIG_START_FLAG_ENABLED;
}
- if (bdrv_dirty_bitmap_get_persistence(bitmap)) {
- dbms->flags |= DIRTY_BITMAP_MIG_START_FLAG_PERSISTENT;
+ if (bitmap_transform &&
+ bitmap_transform->has_persistent) {
+ if (bitmap_transform->persistent) {
+ dbms->flags |= DIRTY_BITMAP_MIG_START_FLAG_PERSISTENT;
+ }
+ } else {
+ if (bdrv_dirty_bitmap_get_persistence(bitmap)) {
+ dbms->flags |= DIRTY_BITMAP_MIG_START_FLAG_PERSISTENT;
+ }
}
QSIMPLEQ_INSERT_TAIL(&s->dbms_list, dbms, entry);
uint32_t granularity = qemu_get_be32(f);
uint8_t flags = qemu_get_byte(f);
LoadBitmapState *b;
+ bool persistent;
if (s->cancelled) {
return 0;
return -EINVAL;
}
- if (flags & DIRTY_BITMAP_MIG_START_FLAG_PERSISTENT) {
+ if (s->bmap_inner &&
+ s->bmap_inner->has_transform &&
+ s->bmap_inner->transform->has_persistent) {
+ persistent = s->bmap_inner->transform->persistent;
+ } else {
+ persistent = flags & DIRTY_BITMAP_MIG_START_FLAG_PERSISTENT;
+ }
+
+ if (persistent) {
bdrv_dirty_bitmap_set_persistence(s->bitmap, true);
}
} else {
bitmap_name = bmap_inner->name;
}
+
+ s->bmap_inner = bmap_inner;
}
if (!s->cancelled) {
'data': [ 'none', 'zlib',
{ 'name': 'zstd', 'if': 'defined(CONFIG_ZSTD)' } ] }
+##
+# @BitmapMigrationBitmapAliasTransform:
+#
+# @persistent: If present, the bitmap will be made persistent
+# or transient depending on this parameter.
+#
+# Since: 6.0
+##
+{ 'struct': 'BitmapMigrationBitmapAliasTransform',
+ 'data': {
+ '*persistent': 'bool'
+ } }
+
##
# @BitmapMigrationBitmapAlias:
#
# @alias: An alias name for migration (for example the bitmap name on
# the opposite site).
#
+# @transform: Allows the modification of the migrated bitmap.
+# (since 6.0)
+#
# Since: 5.2
##
{ 'struct': 'BitmapMigrationBitmapAlias',
'data': {
'name': 'str',
- 'alias': 'str'
+ 'alias': 'str',
+ '*transform': 'BitmapMigrationBitmapAliasTransform'
} }
##