diff options
author | Peter Maydell | 2016-06-16 16:22:56 +0200 |
---|---|---|
committer | Peter Maydell | 2016-06-16 16:22:56 +0200 |
commit | dc278c58fa02e5fb796dbacf02c8dde32f697015 (patch) | |
tree | 0f9d28aba34318ee06c89a7ee1f4d54a8cc9f1ed /util/hbitmap.c | |
parent | Merge remote-tracking branch 'remotes/amit-migration/tags/migration-for-2.7-4... (diff) | |
parent | Merge remote-tracking branch 'mreitz/tags/pull-block-for-kevin-2016-06-16' in... (diff) | |
download | qemu-dc278c58fa02e5fb796dbacf02c8dde32f697015.tar.gz qemu-dc278c58fa02e5fb796dbacf02c8dde32f697015.tar.xz qemu-dc278c58fa02e5fb796dbacf02c8dde32f697015.zip |
Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
Block layer patches
# gpg: Signature made Thu 16 Jun 2016 15:01:27 BST
# gpg: using RSA key 0x7F09B272C88F2FD6
# gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>"
# Primary key fingerprint: DC3D EB15 9A9A F95D 3D74 56FE 7F09 B272 C88F 2FD6
* remotes/kevin/tags/for-upstream: (39 commits)
hbitmap: add 'pos < size' asserts
iotests: Add test for oVirt-like storage migration
iotests: Add test for post-mirror backing chains
block/null: Implement bdrv_refresh_filename()
block/mirror: Fix target backing BDS
block: Allow replacement of a BDS by its overlay
rbd:change error_setg() to error_setg_errno()
iotests: 095: Clean up QEMU before showing image info
block: Create the commit block job before reopening any image
block: Prevent sleeping jobs from resuming if they have been paused
block: use the block job list in qmp_query_block_jobs()
block: use the block job list in bdrv_drain_all()
block: Fix snapshot=on with aio=native
block: Remove bs->zero_beyond_eof
qcow2: Let vmstate call qcow2_co_preadv/pwrite directly
block: Make bdrv_load/save_vmstate coroutine_fns
block: Allow .bdrv_load/save_vmstate() to return 0/-errno
block: Make .bdrv_load_vmstate() vectored
block: Introduce bdrv_preadv()
doc: Fix mailing list address in tests/qemu-iotests/README
...
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'util/hbitmap.c')
-rw-r--r-- | util/hbitmap.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/util/hbitmap.c b/util/hbitmap.c index 7121b11c01..99fd2ba37b 100644 --- a/util/hbitmap.c +++ b/util/hbitmap.c @@ -269,6 +269,7 @@ void hbitmap_set(HBitmap *hb, uint64_t start, uint64_t count) start >>= hb->granularity; last >>= hb->granularity; count = last - start + 1; + assert(last < hb->size); hb->count += count - hb_count_between(hb, start, last); hb_set_between(hb, HBITMAP_LEVELS - 1, start, last); @@ -348,6 +349,7 @@ void hbitmap_reset(HBitmap *hb, uint64_t start, uint64_t count) start >>= hb->granularity; last >>= hb->granularity; + assert(last < hb->size); hb->count -= hb_count_between(hb, start, last); hb_reset_between(hb, HBITMAP_LEVELS - 1, start, last); @@ -371,6 +373,7 @@ bool hbitmap_get(const HBitmap *hb, uint64_t item) /* Compute position and bit in the last layer. */ uint64_t pos = item >> hb->granularity; unsigned long bit = 1UL << (pos & (BITS_PER_LONG - 1)); + assert(pos < hb->size); return (hb->levels[HBITMAP_LEVELS - 1][pos >> BITS_PER_LEVEL] & bit) != 0; } |