qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: John Snow <jsnow@redhat.com>, qemu-devel@nongnu.org
Cc: kwolf@redhat.com, famz@redhat.com, armbru@redhat.com,
	mreitz@redhat.com, vsementsov@parallels.com, stefanha@redhat.com
Subject: Re: [Qemu-devel] [PATCH v14 19/19] docs: incremental backup documentation
Date: Fri, 20 Feb 2015 16:55:48 -0700	[thread overview]
Message-ID: <54E7C984.2070305@redhat.com> (raw)
In-Reply-To: <1424473645-29161-20-git-send-email-jsnow@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 4780 bytes --]

On 02/20/2015 04:07 PM, John Snow wrote:
> Signed-off-by: John Snow <jsnow@redhat.com>
> ---
>  docs/bitmaps.md | 253 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 253 insertions(+)
>  create mode 100644 docs/bitmaps.md
> 
> diff --git a/docs/bitmaps.md b/docs/bitmaps.md
> new file mode 100644
> index 0000000..7cda146
> --- /dev/null
> +++ b/docs/bitmaps.md
> @@ -0,0 +1,253 @@
> +# Dirty Bitmaps

No copyright/license?  Might be good to add.

Also, I'm a fan of reviewing docs before code (does the design make
sense in isolation, and then did we implement it) rather than last in
the series (we may have faithfully documented our code, but that
includes baking in any design flaws that reviewers are now blind to
because of reading the code)

> +* To create a new bitmap that tracks changes in 32KiB segments:
> +
> +```json
> +{ "execute": "block-dirty-bitmap-add",
> +  "arguments": {
> +    "node": "drive0",
> +    "name": "bitmap0",
> +    "granularity": "32768"

s/"32768"/32768/ (we are using a JSON integer, not string)

> +  }
> +}
> +```
> +
> +### Deletion
> +
> +* Can be performed on a disabled bitmap, but not a frozen one.
> +
> +* Because bitmaps are only unique to the node to which they are attached,
> +you must specify the node/drive name here, too.
> +
> +```json
> +{ "execute": "block-dirty-bitmap-remove",
> +  "arguments": {
> +    "node": "drive0",
> +    "name": "bitmap0",
> +  }

No trailing commas in JSON.

> +}
> +```
> +
> +### Enable/Disable:
> +
> +* Not very useful in current cases, but potentially useful for debugging in the
> +future where we'd like to see what information changed only in a specific
> +time period:
> +
> +* To enable (which is, again, the default state after add)
> +
> +```json
> +{ "execute": "block-dirty-bitmap-enable",
> +  "arguments": {
> +    "node": "drive0",
> +    "name": "bitmap0",
> +  }

and again.

> +}
> +```
> +
> +* To disable:
> +
> +```json
> +{ "execute": "block-dirty-bitmap-disable",
> +  "arguments": {
> +    "node": "drive0",
> +    "name": "bitmap0",
> +  }
> +}
> +```

and again. Also, maybe swap these two, since a bitmap defaults to
enabled (that is, you would logically use disable first, then enable to
re-enable, when testing these out, if there is no way to create an
already-disabled bitmap).

> +
> +### Resetting
> +
> +* Resetting a bitmap will clear all information it holds.
> +* An incremental backup created from an empty bitmap will copy no data,
> +as if nothing has changed.
> +
> +```json
> +{ "execute": "block-dirty-bitmap-clear",
> +  "arguments": {
> +    "node": "drive0",
> +    "name": "bitmap0",
> +  }

I'll quit pointing out broken trailing JSON commas, on the assumption
that you'll fix all of them rather than stopping here :)

> +}
> +```
> +
> +## Transactions
> +
> +### Justification
> +Bitmaps can be safely modified when the VM is paused or halted by using
> +the basic QMP commands. For instance, you might perform the following actions:
> +
> +1. Boot the VM in a paused state.
> +2. Create a full drive backup of drive0
> +3. Create a new bitmap attached to drive0
> +4. resume execution of the VM
> +5. Incremental backups are ready to be created.

Consistency on using trailing '.'?

> +
> +At this point, the bitmap and drive backup would be correctly in sync,
> +and incremental backups made from this point forward would be correctly aligned
> +to the full drive backup.
> +
> +This is not particularly useful if we decide we want to start incremental
> +backups after the VM has been running for a while, which will allow us to
> +perform actions like the following:
> +
> +1. Boot the VM and begin execution
> +2. Using transactions, perform the following operations:
> +    * Create 'bitmap0'
> +    * Create a full drive backup of drive0
> +3. Incremental backups are now ready to be created.

It's unclear whether point 2 is describing two separate transactions, or
one transaction with two steps.  If it's just one, I'd word it:

Using a single transaction, perform the following operations:


> +
> +The star of the show.
> +
> +**Nota Bene!** Only incremental backups of entire drives are supported for now.
> +So despite the fact that you can attach a bitmap to any arbitrary node, they are
> +only currently useful when attached to the root node. This is because
> +drive-backup only supports drives/devices instead of arbitrary nodes.

Maybe it's time to think about adding a node-backup :)  But doesn't have
to be this series.



-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2015-02-20 23:55 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-20 23:07 [Qemu-devel] [PATCH v14 00/19] block: incremental backup series John Snow
2015-02-20 23:07 ` [Qemu-devel] [PATCH v14 01/19] qapi: Add optional field "name" to block dirty bitmap John Snow
2015-02-20 23:07 ` [Qemu-devel] [PATCH v14 02/19] qmp: Ensure consistent granularity type John Snow
2015-02-20 23:07 ` [Qemu-devel] [PATCH v14 03/19] qmp: Add block-dirty-bitmap-add and block-dirty-bitmap-remove John Snow
2015-02-27 18:44   ` Eric Blake
2015-02-20 23:07 ` [Qemu-devel] [PATCH v14 04/19] block: Introduce bdrv_dirty_bitmap_granularity() John Snow
2015-02-27 20:42   ` Eric Blake
2015-02-20 23:07 ` [Qemu-devel] [PATCH v14 05/19] hbitmap: add hbitmap_merge John Snow
2015-02-20 23:07 ` [Qemu-devel] [PATCH v14 06/19] qmp: Add block-dirty-bitmap-enable and block-dirty-bitmap-disable John Snow
2015-02-20 23:07 ` [Qemu-devel] [PATCH v14 07/19] block: Add bitmap successors John Snow
2015-02-20 23:07 ` [Qemu-devel] [PATCH v14 08/19] qmp: Add support of "dirty-bitmap" sync mode for drive-backup John Snow
2015-02-20 23:07 ` [Qemu-devel] [PATCH v14 09/19] qmp: add block-dirty-bitmap-clear John Snow
2015-02-20 23:07 ` [Qemu-devel] [PATCH v14 10/19] qapi: Add transaction support to block-dirty-bitmap operations John Snow
2015-02-23 15:48   ` Max Reitz
2015-02-20 23:07 ` [Qemu-devel] [PATCH v14 11/19] qmp: Add dirty bitmap status fields in query-block John Snow
2015-02-20 23:07 ` [Qemu-devel] [PATCH v14 12/19] block: add BdrvDirtyBitmap documentation John Snow
2015-02-20 23:07 ` [Qemu-devel] [PATCH v14 13/19] block: Ensure consistent bitmap function prototypes John Snow
2015-02-20 23:07 ` [Qemu-devel] [PATCH v14 14/19] iotests: add invalid input incremental backup tests John Snow
2015-02-20 23:07 ` [Qemu-devel] [PATCH v14 15/19] iotests: add simple incremental backup case John Snow
2015-02-20 23:07 ` [Qemu-devel] [PATCH v14 16/19] iotests: add transactional incremental backup test John Snow
2015-02-20 23:07 ` [Qemu-devel] [PATCH v14 17/19] iotests: add incremental backup failure recovery test John Snow
2015-02-20 23:07 ` [Qemu-devel] [PATCH v14 18/19] block: Resize bitmaps on bdrv_truncate John Snow
2015-02-23 17:03   ` Max Reitz
2015-02-23 19:12     ` John Snow
2015-02-20 23:07 ` [Qemu-devel] [PATCH v14 19/19] docs: incremental backup documentation John Snow
2015-02-20 23:55   ` Eric Blake [this message]
2015-02-21  0:09     ` John Snow
2015-02-23 17:07 ` [Qemu-devel] [PATCH v14 00/19] block: incremental backup series 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=54E7C984.2070305@redhat.com \
    --to=eblake@redhat.com \
    --cc=armbru@redhat.com \
    --cc=famz@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --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).