All of lore.kernel.org
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
	famz@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com,
	den@openvz.org, jsnow@redhat.com
Subject: Re: [Qemu-devel] [PATCH v4 RFC] spec: add qcow2-dirty-bitmaps specification
Date: Tue, 15 Dec 2015 15:03:57 +0100	[thread overview]
Message-ID: <56701DCD.6020205@redhat.com> (raw)
In-Reply-To: <20151215095850.GA4536@noname.redhat.com>

On 2015-12-15 at 10:58, Kevin Wolf wrote:
> Am 14.12.2015 um 21:05 hat Max Reitz geschrieben:
>> On 14.12.2015 18:43, Vladimir Sementsov-Ogievskiy wrote:
>>> The new feature for qcow2: storing dirty bitmaps.
>>>
>>> Only dirty bitmaps relative to this qcow2 image should be stored in it.
>>>
>>> Strings started from +# are RFC-strings, not to be commited of course.
>>>
>>>
>>> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
>
> First of all, I think we may need some improvemnts on details and wording
> here and there, but the format in general looks quite reasonable to me
> (at the first sight at least).
>

[...]

>> Not so good: While now any program knows how to read the bitmap and that
>> it does refer to this qcow2 file, it's interpretation is not so easy

*its

>> still. Generally, a dirty bitmap has some reference point, that is the
>> state of the disk when the bitmap was cleared or created. For instance,
>> for incremental backups, whenever you create a backup based on a dirty
>> bitmap, the dirty bitmap is cleared and the backup target is then said
>> reference point.
>> I think it would be nice to put that reference point (i.e. the name of
>> an image file that contains the clean image) into the dirty bitmap
>> header, if possible.
>
> I don't think it's a valid assumption that the reference point has a
> file name.

Right, but you can't really do anything useful with the dirty bitmap if 
you don't know that reference point.

I do realize that it may not always possible and often very cumbersome 
to come up with some filename to put here, but I still consider it very 
valuable information if available.

John suggested there to be a way for the management layer to put in this 
information if available. That may save qemu from the trouble of having 
to figure it out.

Unless you/we can think of a better way of describing the reference 
point (note: we don't necessarily have an existing reference point at 
all, you can just clear the dirty bitmap at your whim), I'd be 
completely fine with just adding a reference point filename field that 
may be empty if that information is unknown, and in practice just always 
leave it empty for now.

>            Which makes me wonder... How do dirty bitmaps and internal
> snapshots play together?
>
> What I guess could be done is storing a creation date if you think this
> would be useful.

Only in that you could look through the local filesystem if perchance 
you find a disk image with the same size as the qcow2 image in question 
and roughly the right creation date...

[...]

>>> +             19:    granularity_bits
>>> +                    Granularity bits. Valid values are: 0 - 31.
>>> +# Now, qemu allows creating bitmaps with granularity as a 32bit value. And
>>> +# there are no reasons of increasing it.
>>
>> Good (implicit) question. I can't imagine any reason for wanting to have
>> a coarser granularity than 2 GB, but I do think there may be a need in
>> the future for some people.
>>
>> Once again, I think we should discriminate between what is generally a
>> useful limitation and what is simply due to qemu not supporting anything
>> else right now.
>>
>> Thus, I think it would be better to increase the range to 0 - 63 and
>> make a note that qemu only supports values up to 31 right now.
>
> Why 63 and not 255 (the maximum for this one-byte field)? As soon as we
> pick an arbitrary value, we can just take whatever qemu actually
> supports. We can always increase the limit later.

Because I'm willing to take a bet that we won't need granularities 
greater than 2^63 even in twenty years of now.

Also, qcow2 simply doesn't support images with more than ~2^64 clusters.

[...]

>>> +
>>> +        variable:   The name of the bitmap (not null terminated). Should be
>>> +                    unique among all dirty bitmap names within the Dirty
>>> +                    bitmaps extension.
>>> +
>>> +        variable:   Padding to round up the Dirty Bitmap Directory Entry size
>>> +                    to the next multiple of 8.
>>
>> What I'd like here is variable additional information based on the
>> bitmap type. For some types, this may be absolutely necessary; for dirty
>> tracking bitmaps it depends on what we do about the reference point thing.
>
> This could turn out useful, yes.
>
> I also think some extensibility mechanism would be good, like extra_data
> in internal snapshots.
>
>> The reference point thing is the following: As mentioned at the top, I'd
>> like there to be some kind of description of what the clean state was.
>> As far as I know, this is generally a backup in the form of a file. In
>> that case, we could put that filename here.
>
> Who says that it's a local file? Or that it hasn't been moved since we
> created the bitmap?

The former: Nobody, but if it is, it's valuable information. (I won't 
suggest json: filenames, because that's not very useful information to 
any program outside of qemu.)

The latter: Good point. But the same applies to backing filenames (and 
for the case of incremental backups, which is probably mainly what we 
want to use this feature for, the reference point filename just is the 
backing filename of the backup to be created).

Max

      reply	other threads:[~2015-12-15 14:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-14 17:43 [Qemu-devel] [PATCH v4 RFC] spec: add qcow2-dirty-bitmaps specification Vladimir Sementsov-Ogievskiy
2015-12-14 20:05 ` Max Reitz
2015-12-14 20:45   ` John Snow
2015-12-14 21:44     ` Max Reitz
2015-12-14 22:26       ` John Snow
2015-12-15  4:34         ` Fam Zheng
2015-12-15 14:10         ` Max Reitz
2015-12-21 13:41     ` Vladimir Sementsov-Ogievskiy
2015-12-15  4:18   ` Fam Zheng
2015-12-15 10:04     ` Vladimir Sementsov-Ogievskiy
2015-12-15 16:40     ` John Snow
2015-12-21 12:20       ` Vladimir Sementsov-Ogievskiy
2015-12-15  9:58   ` Kevin Wolf
2015-12-15 14:03     ` Max Reitz [this message]

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=56701DCD.6020205@redhat.com \
    --to=mreitz@redhat.com \
    --cc=den@openvz.org \
    --cc=famz@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.