[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH v5 06/10] block: add delayed bitmap successor cl
From: |
John Snow |
Subject: |
Re: [Qemu-block] [PATCH v5 06/10] block: add delayed bitmap successor cleanup |
Date: |
Fri, 05 Jun 2015 11:56:08 -0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 |
On 06/05/2015 08:56 AM, Stefan Hajnoczi wrote:
> On Thu, Jun 04, 2015 at 05:46:08PM -0400, John Snow wrote:
>> @@ -3190,19 +3193,13 @@ BdrvDirtyBitmap
>> *bdrv_dirty_bitmap_abdicate(BlockDriverState *bs, * we may wish
>> to re-join the parent and child/successor. * The merged parent
>> will be un-frozen, but not explicitly re-enabled. */
>> -BdrvDirtyBitmap *bdrv_reclaim_dirty_bitmap(BlockDriverState
>> *bs, - BdrvDirtyBitmap
>> *parent, - Error
>> **errp) +static BdrvDirtyBitmap
>> *bdrv_reclaim_dirty_bitmap(BlockDriverState *bs, +
>> BdrvDirtyBitmap *parent) { BdrvDirtyBitmap *successor =
>> parent->successor;
>>
>> - if (!successor) { - error_setg(errp, "Cannot reclaim
>> a successor when none is present"); - return NULL; - }
>> - + assert(successor); if (!hbitmap_merge(parent->bitmap,
>> successor->bitmap)) { - error_setg(errp, "Merging of
>> parent and successor bitmap failed"); return NULL; }
>
> Is this reachable? If the bitmap size and granularity match then
> hbitmap_merge() does not fail.
>
> This should probably be covered with an assertion instead to show
> that this is not allowed to happen.
>
You're right, I was thinking "What if something changes under my feet?
This layer does not know about the HBitmap internals," but for now
they do match and an assertion is appropriate to guard against
accidental changes.
--js
- [Qemu-block] [PATCH v5 04/10] block: re-add BlkTransactionState, (continued)
- [Qemu-block] [PATCH v5 04/10] block: re-add BlkTransactionState, John Snow, 2015/06/04
- [Qemu-block] [PATCH v5 01/10] qapi: Add transaction support to block-dirty-bitmap operations, John Snow, 2015/06/04
- [Qemu-block] [PATCH v5 07/10] qmp: Add an implementation wrapper for qmp_drive_backup, John Snow, 2015/06/04
- [Qemu-block] [PATCH v5 05/10] block: add transactional callbacks feature, John Snow, 2015/06/04
- [Qemu-block] [PATCH v5 06/10] block: add delayed bitmap successor cleanup, John Snow, 2015/06/04
- [Qemu-block] [PATCH v5 03/10] block: rename BlkTransactionState and BdrvActionOps, John Snow, 2015/06/04
- [Qemu-block] [PATCH v5 08/10] block: drive_backup transaction callback support, John Snow, 2015/06/04
- [Qemu-block] [PATCH v5 09/10] iotests: 124 - transactional failure test, John Snow, 2015/06/04
- [Qemu-block] [PATCH v5 10/10] qmp-commands.hx: Update the supported 'transaction' operations, John Snow, 2015/06/04