[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/5] block/dirty-bitmaps: rename frozen predicat
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH 2/5] block/dirty-bitmaps: rename frozen predicate helper |
Date: |
Tue, 12 Feb 2019 12:26:35 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 |
On 2/11/19 7:02 PM, John Snow wrote:
> "Frozen" was a good description a long time ago, but it isn't adequate now.
> Rename the frozen predicate to has_successor to make the semantics of the
> predicate more clear to outside callers.
>
> In the process, remove some calls to frozen() that no longer semantically
> make sense. For enabled and disabled in particular, it's actually okay for
> the internals to do this but only forbidden for users to invoke them, and
> all of the QMP entry uses already check against qmp_locked.
>
> Several other assertions really want to check that the bitmap isn't in-use
> by another operation -- use the qmp_locked function for this instead, which
> presently also checks for has_successor.
> ---
Missing S-o-b on entire series, so you have to send v2 anyway :)
> @@ -244,12 +244,16 @@ int bdrv_dirty_bitmap_create_successor(BlockDriverState
> *bs,
> uint64_t granularity;
> BdrvDirtyBitmap *child;
>
> - if (bdrv_dirty_bitmap_frozen(bitmap)) {
> - error_setg(errp, "Cannot create a successor for a bitmap that is "
> - "currently frozen");
> + if (bdrv_dirty_bitmap_has_successor(bitmap)) {
> + error_setg(errp, "Cannot create a successor for a bitmap that
> already "
> + "has one");
> + return -1;
> + }
> + if (bdrv_dirty_bitmap_user_locked(bitmap)) {
> + error_setg(errp, "Cannot create a successor for a bitmap that is
> in-use "
> + "by an operation.");
> return -1;
No trailing dot in error_setg().
Should these two errors be swapped (check for locked before
has_successor)? After all, having a successor is an internal detail,
whereas being in use by something I already triggered is fairly
straightforward to understand.
> @@ -325,7 +328,7 @@ BdrvDirtyBitmap
> *bdrv_dirty_bitmap_abdicate(BlockDriverState *bs,
> /**
> * In cases of failure where we can no longer safely delete the parent,
> * we may wish to re-join the parent and child/successor.
> - * The merged parent will be un-frozen, but not explicitly re-enabled.
> + * The merged parent will not be user_locked, but not explicitly re-enabled.
s/but not/nor/
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH 0/5] dirty-bitmaps: deprecate @status field, John Snow, 2019/02/11
- [Qemu-devel] [PATCH 1/5] block/dirty-bitmap: add recording and busy properties, John Snow, 2019/02/11
- [Qemu-devel] [PATCH 2/5] block/dirty-bitmaps: rename frozen predicate helper, John Snow, 2019/02/11
- Re: [Qemu-devel] [PATCH 2/5] block/dirty-bitmaps: rename frozen predicate helper,
Eric Blake <=
- [Qemu-devel] [PATCH 4/5] block/dirty-bitmap: explicitly lock bitmaps with successors, John Snow, 2019/02/11
- [Qemu-devel] [PATCH 3/5] block/dirty-bitmap: change semantics of enabled predicate, John Snow, 2019/02/11
- [Qemu-devel] [PATCH 5/5] block/dirty-bitmaps: unify qmp_locked and user_locked calls, John Snow, 2019/02/11
- Re: [Qemu-devel] [PATCH 0/5] dirty-bitmaps: deprecate @status field, Eric Blake, 2019/02/12