From: John Snow <jsnow@redhat.com>
To: Eric Blake <eblake@redhat.com>, qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
Juan Quintela <quintela@redhat.com>,
qemu-block@nongnu.org, Fam Zheng <fam@euphon.net>,
vsementsov@virtuozzo.com,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
Max Reitz <mreitz@redhat.com>,
Markus Armbruster <armbru@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 2/5] block/dirty-bitmaps: rename frozen predicate helper
Date: Tue, 12 Feb 2019 13:30:44 -0500 [thread overview]
Message-ID: <bb72e892-fcaf-f1b9-1c07-12a740478de3@redhat.com> (raw)
In-Reply-To: <987e83f6-2a6f-9547-a6d2-afe7a323181d@redhat.com>
On 2/12/19 1:26 PM, Eric Blake wrote:
> 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().
>
D'oh. I need to re-enable checkpatch, obviously.
> 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.
>
Good point. Will do.
>
>> @@ -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/
>
I was trying to draw a contrast between "We will forcibly set locked =
false, but make no guaranteed about enable/disable."
I guess nor still works in that case.
next prev parent reply other threads:[~2019-02-12 18:31 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-12 1:02 [Qemu-devel] [PATCH 0/5] dirty-bitmaps: deprecate @status field John Snow
2019-02-12 1:02 ` [Qemu-devel] [PATCH 1/5] block/dirty-bitmap: add recording and busy properties John Snow
2019-02-12 18:17 ` Eric Blake
2019-02-12 18:23 ` John Snow
2019-02-13 9:31 ` Vladimir Sementsov-Ogievskiy
2019-02-12 1:02 ` [Qemu-devel] [PATCH 2/5] block/dirty-bitmaps: rename frozen predicate helper John Snow
2019-02-12 18:26 ` Eric Blake
2019-02-12 18:30 ` John Snow [this message]
2019-02-12 1:02 ` [Qemu-devel] [PATCH 3/5] block/dirty-bitmap: change semantics of enabled predicate John Snow
2019-02-12 18:58 ` Eric Blake
2019-02-12 19:03 ` John Snow
2019-02-12 1:02 ` [Qemu-devel] [PATCH 4/5] block/dirty-bitmap: explicitly lock bitmaps with successors John Snow
2019-02-12 19:18 ` Eric Blake
2019-02-12 1:02 ` [Qemu-devel] [PATCH 5/5] block/dirty-bitmaps: unify qmp_locked and user_locked calls John Snow
2019-02-12 19:27 ` Eric Blake
2019-02-12 19:33 ` John Snow
2019-02-12 18:12 ` [Qemu-devel] [PATCH 0/5] dirty-bitmaps: deprecate @status field Eric Blake
2019-02-12 18:15 ` John Snow
2019-02-13 19:27 ` Vladimir Sementsov-Ogievskiy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bb72e892-fcaf-f1b9-1c07-12a740478de3@redhat.com \
--to=jsnow@redhat.com \
--cc=armbru@redhat.com \
--cc=dgilbert@redhat.com \
--cc=eblake@redhat.com \
--cc=fam@euphon.net \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=stefanha@redhat.com \
--cc=vsementsov@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).