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/qemu/hbitmap.h | |
| parent | e8b38d737144579b291d4e3ef737be33e7798161 (diff) | |
| parent | 3e6d88f280a53b5b399e73b1f80efe4c3db306f1 (diff) | |
| download | focaccia-qemu-3f3285491dd52014852a56135c90e428c8b507ea.tar.gz focaccia-qemu-3f3285491dd52014852a56135c90e428c8b507ea.zip | |
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/qemu/hbitmap.h')
| -rw-r--r-- | include/qemu/hbitmap.h | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/include/qemu/hbitmap.h b/include/qemu/hbitmap.h index ddca52c48e..a7cb780592 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: |