diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2018-10-30 14:09:25 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2018-10-30 14:09:25 +0000 |
commit | 3f3285491dd52014852a56135c90e428c8b507ea (patch) | |
tree | 1000bb84341a44bea09a3eeb920ede4e15a4c190 /include | |
parent | e8b38d737144579b291d4e3ef737be33e7798161 (diff) | |
parent | 3e6d88f280a53b5b399e73b1f80efe4c3db306f1 (diff) | |
download | qemu-3f3285491dd52014852a56135c90e428c8b507ea.zip qemu-3f3285491dd52014852a56135c90e428c8b507ea.tar.gz qemu-3f3285491dd52014852a56135c90e428c8b507ea.tar.bz2 |
Merge remote-tracking branch 'remotes/jnsnow/tags/bitmaps-pull-request' into staging
Pull request
# gpg: Signature made Mon 29 Oct 2018 21:24:08 GMT
# gpg: using RSA key 7DEF8106AAFC390E
# gpg: Good signature from "John Snow (John Huston) <jsnow@redhat.com>"
# Primary key fingerprint: FAEB 9711 A12C F475 812F 18F2 88A9 064D 1835 61EB
# Subkey fingerprint: F9B7 ABDB BCAC DF95 BE76 CBD0 7DEF 8106 AAFC 390E
* remotes/jnsnow/tags/bitmaps-pull-request:
iotests: 169: add cases for source vm resuming
iotests: improve 169
dirty-bitmaps: clean-up bitmaps loading and migration logic
bitmap: Update count after a merge
nbd: forbid use of frozen bitmaps
block/backup: prohibit backup from using in use bitmaps
block/dirty-bitmaps: prohibit enable/disable on locked/frozen bitmaps
block/dirty-bitmaps: allow clear on disabled bitmaps
block/dirty-bitmaps: fix merge permissions
block/dirty-bitmaps: add user_locked status checker
bloc/qcow2: drop dirty_bitmaps_loaded state variable
block/qcow2: improve error message in qcow2_inactivate
iotests: 169: drop deprecated 'autoload' parameter
qapi: add transaction support for x-block-dirty-bitmap-merge
blockdev: rename block-dirty-bitmap-clear transaction handlers
dirty-bitmap: make it possible to restore bitmap after merge
dirty-bitmap: rename bdrv_undo_clear_dirty_bitmap
dirty-bitmap: switch assert-fails to errors in bdrv_merge_dirty_bitmap
blockdev-backup: add bitmap argument
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/block/block_int.h | 2 | ||||
-rw-r--r-- | include/block/dirty-bitmap.h | 5 | ||||
-rw-r--r-- | include/qemu/hbitmap.h | 25 |
3 files changed, 20 insertions, 12 deletions
diff --git a/include/block/block_int.h b/include/block/block_int.h index 92ecbd8..f605622 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -1155,7 +1155,7 @@ bool blk_dev_is_medium_locked(BlockBackend *blk); void bdrv_set_dirty(BlockDriverState *bs, int64_t offset, int64_t bytes); void bdrv_clear_dirty_bitmap(BdrvDirtyBitmap *bitmap, HBitmap **out); -void bdrv_undo_clear_dirty_bitmap(BdrvDirtyBitmap *bitmap, HBitmap *in); +void bdrv_restore_dirty_bitmap(BdrvDirtyBitmap *bitmap, HBitmap *backup); void bdrv_inc_in_flight(BlockDriverState *bs); void bdrv_dec_in_flight(BlockDriverState *bs); diff --git a/include/block/dirty-bitmap.h b/include/block/dirty-bitmap.h index 259bd27..8f38a3d 100644 --- a/include/block/dirty-bitmap.h +++ b/include/block/dirty-bitmap.h @@ -26,7 +26,6 @@ BdrvDirtyBitmap *bdrv_find_dirty_bitmap(BlockDriverState *bs, const char *name); void bdrv_release_dirty_bitmap(BlockDriverState *bs, BdrvDirtyBitmap *bitmap); void bdrv_release_named_dirty_bitmaps(BlockDriverState *bs); -void bdrv_release_persistent_dirty_bitmaps(BlockDriverState *bs); void bdrv_remove_persistent_dirty_bitmap(BlockDriverState *bs, const char *name, Error **errp); @@ -71,7 +70,8 @@ void bdrv_dirty_bitmap_set_persistance(BdrvDirtyBitmap *bitmap, bool persistent); void bdrv_dirty_bitmap_set_qmp_locked(BdrvDirtyBitmap *bitmap, bool qmp_locked); void bdrv_merge_dirty_bitmap(BdrvDirtyBitmap *dest, const BdrvDirtyBitmap *src, - Error **errp); + HBitmap **backup, Error **errp); +void bdrv_dirty_bitmap_set_migration(BdrvDirtyBitmap *bitmap, bool migration); /* Functions that require manual locking. */ void bdrv_dirty_bitmap_lock(BdrvDirtyBitmap *bitmap); @@ -94,6 +94,7 @@ bool bdrv_has_readonly_bitmaps(BlockDriverState *bs); bool bdrv_dirty_bitmap_get_autoload(const BdrvDirtyBitmap *bitmap); bool bdrv_dirty_bitmap_get_persistance(BdrvDirtyBitmap *bitmap); bool bdrv_dirty_bitmap_qmp_locked(BdrvDirtyBitmap *bitmap); +bool bdrv_dirty_bitmap_user_locked(BdrvDirtyBitmap *bitmap); bool bdrv_has_changed_persistent_bitmaps(BlockDriverState *bs); BdrvDirtyBitmap *bdrv_dirty_bitmap_next(BlockDriverState *bs, BdrvDirtyBitmap *bitmap); diff --git a/include/qemu/hbitmap.h b/include/qemu/hbitmap.h index ddca52c..a7cb780 100644 --- a/include/qemu/hbitmap.h +++ b/include/qemu/hbitmap.h @@ -73,16 +73,23 @@ void hbitmap_truncate(HBitmap *hb, uint64_t size); /** * hbitmap_merge: - * @a: The bitmap to store the result in. - * @b: The bitmap to merge into @a. - * @return true if the merge was successful, - * false if it was not attempted. - * - * Merge two bitmaps together. - * A := A (BITOR) B. - * B is left unmodified. + * + * Store result of merging @a and @b into @result. + * @result is allowed to be equal to @a or @b. + * + * Return true if the merge was successful, + * false if it was not attempted. + */ +bool hbitmap_merge(const HBitmap *a, const HBitmap *b, HBitmap *result); + +/** + * hbitmap_can_merge: + * + * hbitmap_can_merge(a, b) && hbitmap_can_merge(a, result) is sufficient and + * necessary for hbitmap_merge will not fail. + * */ -bool hbitmap_merge(HBitmap *a, const HBitmap *b); +bool hbitmap_can_merge(const HBitmap *a, const HBitmap *b); /** * hbitmap_empty: |