diff options
author | John Snow <jsnow@redhat.com> | 2019-07-29 16:35:54 -0400 |
---|---|---|
committer | John Snow <jsnow@redhat.com> | 2019-08-16 16:28:03 -0400 |
commit | c4e4b0fa598ddc9cee6ba7a06899ce0a8dae6c61 (patch) | |
tree | e4933e88c426301e79333980d7d4c24965d1f6c2 /block/dirty-bitmap.c | |
parent | 2899f41eef2806cf8eb119811c9d6fcf15ce80f6 (diff) |
qapi: implement block-dirty-bitmap-remove transaction action
It is used to do transactional movement of the bitmap (which is
possible in conjunction with merge command). Transactional bitmap
movement is needed in scenarios with external snapshot, when we don't
want to leave copy of the bitmap in the base image.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 20190708220502.12977-3-jsnow@redhat.com
[Edited "since" version to 4.2 --js]
Signed-off-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'block/dirty-bitmap.c')
-rw-r--r-- | block/dirty-bitmap.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c index 75a5daf116..134e0c9a0c 100644 --- a/block/dirty-bitmap.c +++ b/block/dirty-bitmap.c @@ -48,10 +48,9 @@ struct BdrvDirtyBitmap { bool inconsistent; /* bitmap is persistent, but inconsistent. It cannot be used at all in any way, except a QMP user can remove it. */ - bool migration; /* Bitmap is selected for migration, it should - not be stored on the next inactivation - (persistent flag doesn't matter until next - invalidation).*/ + bool skip_store; /* We are either migrating or deleting this + * bitmap; it should not be stored on the next + * inactivation. */ QLIST_ENTRY(BdrvDirtyBitmap) list; }; @@ -762,16 +761,16 @@ void bdrv_dirty_bitmap_set_inconsistent(BdrvDirtyBitmap *bitmap) } /* Called with BQL taken. */ -void bdrv_dirty_bitmap_set_migration(BdrvDirtyBitmap *bitmap, bool migration) +void bdrv_dirty_bitmap_skip_store(BdrvDirtyBitmap *bitmap, bool skip) { qemu_mutex_lock(bitmap->mutex); - bitmap->migration = migration; + bitmap->skip_store = skip; qemu_mutex_unlock(bitmap->mutex); } bool bdrv_dirty_bitmap_get_persistence(BdrvDirtyBitmap *bitmap) { - return bitmap->persistent && !bitmap->migration; + return bitmap->persistent && !bitmap->skip_store; } bool bdrv_dirty_bitmap_inconsistent(const BdrvDirtyBitmap *bitmap) @@ -783,7 +782,7 @@ bool bdrv_has_changed_persistent_bitmaps(BlockDriverState *bs) { BdrvDirtyBitmap *bm; QLIST_FOREACH(bm, &bs->dirty_bitmaps, list) { - if (bm->persistent && !bm->readonly && !bm->migration) { + if (bm->persistent && !bm->readonly && !bm->skip_store) { return true; } } |