qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: John Snow <jsnow@redhat.com>
To: Eric Blake <eblake@redhat.com>, qemu-block@nongnu.org
Cc: kwolf@redhat.com, famz@redhat.com, qemu-devel@nongnu.org,
	armbru@redhat.com, vsementsov@parallels.com, stefanha@redhat.com,
	mreitz@redhat.com
Subject: Re: [Qemu-devel] [PATCH v5 09/21] block: Add bitmap successors
Date: Fri, 17 Apr 2015 18:56:47 -0400	[thread overview]
Message-ID: <55318FAF.2070103@redhat.com> (raw)
In-Reply-To: <55318C85.7000909@redhat.com>



On 04/17/2015 06:43 PM, Eric Blake wrote:
> On 04/08/2015 04:19 PM, John Snow wrote:
>> A bitmap successor is an anonymous BdrvDirtyBitmap that is intended to
>> be created just prior to a sensitive operation (e.g. Incremental Backup)
>> that can either succeed or fail, but during the course of which we still
>> want a bitmap tracking writes.
>>
>> On creating a successor, we "freeze" the parent bitmap which prevents
>> its deletion, enabling, anonymization, or creating a bitmap with the
>> same name.
>>
>> On success, the parent bitmap can "abdicate" responsibility to the
>> successor, which will inherit its name. The successor will have been
>> tracking writes during the course of the backup operation. The parent
>> will be safely deleted.
>>
>> On failure, we can "reclaim" the successor from the parent, unifying
>> them such that the resulting bitmap describes all writes occurring since
>> the last successful backup, for instance. Reclamation will thaw the
>> parent, but not explicitly re-enable it.
>>
>> BdrvDirtyBitmap operations that target a single bitmap are protected
>> by assertions that the bitmap is not frozen and/or disabled.
>>
>> BdrvDirtyBitmap operations that target a group of bitmaps, such as
>> bdrv_{set,reset}_dirty will ignore frozen/disabled drives with a
>> conditional instead.
>>
>> QMP transactions that enable/disable bitmaps have extra error checking
>> surrounding them that prevent modifying bitmaps that are frozen.
>
> Is this last paragraph stale now?
>

Yes, thank you. Those transactions no longer exist.

The implementations, however, have *assertions* that protect frozen 
bitmaps and still exist. Bitmaps can still be enabled/disabled as an 
internal concept, and it is still invalid to try to enable/disable one 
that is frozen.

>>
>> Signed-off-by: John Snow <jsnow@redhat.com>
>> Reviewed-by: Max Reitz <mreitz@redhat.com>
>> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
>> ---
>>   block.c               | 104 +++++++++++++++++++++++++++++++++++++++++++++++++-
>>   blockdev.c            |   7 ++++
>>   include/block/block.h |  10 +++++
>>   qapi/block-core.json  |   1 +
>>   4 files changed, 121 insertions(+), 1 deletion(-)
>>
>
>> +/**
>> + * A BdrvDirtyBitmap can be in three possible states:
>> + * (1) successor is false and disabled is false: full r/w mode
>> + * (2) successor is false and disabled is true: read only mode ("disabled")
>> + * (3) successor is set: frozen mode.
>> + *     A frozen bitmap cannot be renamed, deleted, anonymized, cleared, set,
>> + *     or enabled. A frozen bitmap can only abdicate() or reclaim().
>> + */
>>   struct BdrvDirtyBitmap {
>>       HBitmap *bitmap;
>> +    BdrvDirtyBitmap *successor;
>
> 'successor is false' reads awkwardly given that it is not a bool; maybe
> 'successor is NULL' is better?
>

That is better.

>>
>> +bool bdrv_dirty_bitmap_frozen(BdrvDirtyBitmap *bitmap)
>> +{
>> +    return bitmap->successor;
>
> Good thing C99 requires conversion of pointer to bool to work :)
>

Is there a case to be made for explicit NULL checks?

>
>> +
>> +/**
>> + * For a bitmap with a successor, yield our name to the successor,
>> + * Delete the old bitmap, and return a handle to the new bitmap.
>
> Sentences with capitals after comma, Even with a line break, Look weird.
> (s/Delete/delete/)
>

You Are Right, Sorry About That.

>
>> +
>> +/**
>> + * In cases of failure where we can no longer safely delete the parent,
>> + * We may wish to re-join the parent and child/successor.
>
> and again (s/We/we/)
>

It is an /extra/ royal 'we.'

> Grammar fixes are minor, so:
> Reviewed-by: Eric Blake <eblake@redhat.com>
>

  reply	other threads:[~2015-04-17 22:56 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-08 22:19 [Qemu-devel] [PATCH v5 00/21] block: transactionless incremental backup series John Snow
2015-04-08 22:19 ` [Qemu-devel] [PATCH v5 01/21] docs: incremental backup documentation John Snow
2015-04-17 15:06   ` Eric Blake
2015-04-17 15:50     ` John Snow
2015-04-17 16:36       ` Eric Blake
2015-04-08 22:19 ` [Qemu-devel] [PATCH v5 02/21] qapi: Add optional field "name" to block dirty bitmap John Snow
2015-04-08 22:19 ` [Qemu-devel] [PATCH v5 03/21] qmp: Ensure consistent granularity type John Snow
2015-04-08 22:19 ` [Qemu-devel] [PATCH v5 04/21] qmp: Add block-dirty-bitmap-add and block-dirty-bitmap-remove John Snow
2015-04-17 14:54   ` Eric Blake
2015-04-08 22:19 ` [Qemu-devel] [PATCH v5 05/21] block: Introduce bdrv_dirty_bitmap_granularity() John Snow
2015-04-08 22:19 ` [Qemu-devel] [PATCH v5 06/21] hbitmap: cache array lengths John Snow
2015-04-17 15:18   ` Eric Blake
2015-04-08 22:19 ` [Qemu-devel] [PATCH v5 07/21] hbitmap: add hbitmap_merge John Snow
2015-04-17 15:23   ` Eric Blake
2015-04-17 21:30     ` John Snow
2015-04-08 22:19 ` [Qemu-devel] [PATCH v5 08/21] block: Add bitmap disabled status John Snow
2015-04-08 22:19 ` [Qemu-devel] [PATCH v5 09/21] block: Add bitmap successors John Snow
2015-04-17 22:43   ` Eric Blake
2015-04-17 22:56     ` John Snow [this message]
2015-04-08 22:19 ` [Qemu-devel] [PATCH v5 10/21] qmp: Add support of "dirty-bitmap" sync mode for drive-backup John Snow
2015-04-17 13:17   ` Max Reitz
2015-04-17 16:21     ` John Snow
2015-04-17 22:51   ` Eric Blake
2015-04-17 23:02     ` John Snow
2015-04-17 23:10       ` Eric Blake
2015-04-08 22:19 ` [Qemu-devel] [PATCH v5 11/21] qmp: add block-dirty-bitmap-clear John Snow
2015-04-17 22:55   ` Eric Blake
2015-04-08 22:19 ` [Qemu-devel] [PATCH v5 12/21] qmp: Add dirty bitmap status field in query-block John Snow
2015-04-17 22:55   ` Eric Blake
2015-04-08 22:19 ` [Qemu-devel] [PATCH v5 13/21] block: add BdrvDirtyBitmap documentation John Snow
2015-04-08 22:19 ` [Qemu-devel] [PATCH v5 14/21] block: Ensure consistent bitmap function prototypes John Snow
2015-04-08 22:19 ` [Qemu-devel] [PATCH v5 15/21] block: Resize bitmaps on bdrv_truncate John Snow
2015-04-09 14:38   ` Stefan Hajnoczi
2015-04-17 13:25   ` Max Reitz
2015-04-17 16:51     ` John Snow
2015-04-08 22:19 ` [Qemu-devel] [PATCH v5 16/21] hbitmap: truncate tests John Snow
2015-04-08 22:20 ` [Qemu-devel] [PATCH v5 17/21] iotests: add invalid input incremental backup tests John Snow
2015-04-08 22:20 ` [Qemu-devel] [PATCH v5 18/21] iotests: add QMP event waiting queue John Snow
2015-04-17 13:33   ` Max Reitz
2015-04-17 18:23     ` John Snow
2015-04-22 15:04       ` Max Reitz
2015-04-08 22:20 ` [Qemu-devel] [PATCH v5 19/21] iotests: add simple incremental backup case John Snow
2015-04-17 14:33   ` Max Reitz
2015-04-17 16:56     ` John Snow
2015-04-08 22:20 ` [Qemu-devel] [PATCH v5 20/21] iotests: add incremental backup failure recovery test John Snow
2015-04-17 14:33   ` Max Reitz
2015-04-08 22:20 ` [Qemu-devel] [PATCH v5 21/21] iotests: add incremental backup granularity tests John Snow
2015-04-17 14:36   ` Max Reitz

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=55318FAF.2070103@redhat.com \
    --to=jsnow@redhat.com \
    --cc=armbru@redhat.com \
    --cc=eblake@redhat.com \
    --cc=famz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=vsementsov@parallels.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).