qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: John Snow <jsnow@redhat.com>
To: Max Reitz <mreitz@redhat.com>, Qemu-block <qemu-block@nongnu.org>
Cc: Kevin Wolf <kwolf@redhat.com>, "Denis V. Lunev" <den@openvz.org>,
	Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
	qemu-devel <qemu-devel@nongnu.org>
Subject: Re: bitmaps -- copying allocation status into dirty bitmaps
Date: Mon, 2 Dec 2019 17:13:02 -0500	[thread overview]
Message-ID: <12048403-663d-8c0b-1bd6-a3db3e415244@redhat.com> (raw)
In-Reply-To: <5a31f1aa-dd8d-0fda-b20f-938e52243ce3@redhat.com>



On 11/4/19 6:27 AM, Max Reitz wrote:
> On 04.11.19 12:21, Max Reitz wrote:
>> On 01.11.19 16:42, John Snow wrote:
>>> Hi, in one of my infamously unreadable and long status emails, I
>>> mentioned possibly wanting to copy allocation data into bitmaps as a way
>>> to enable users to create (external) snapshots from outside of the
>>> libvirt/qemu context.
>>>
>>> (That is: to repair checkpoints in libvirt after a user extended the
>>> backing chain themselves, you want to restore bitmap information for
>>> that node. Conveniently, this information IS the allocation map, so we
>>> can do this.)
>>>
>>> It came up at KVM Forum that we probably do want this, because oVirt
>>> likes the idea of being able to manipulate these chains from outside of
>>> libvirt/qemu.
>>>
>>> Denis suggested that instead of a new command, we can create a special
>>> name -- maybe "#ALLOCATED" or something similar that can never be
>>> allocated as a user-defined bitmap name -- as a special source for the
>>> merge command.
>>>
>>> You'd issue a merge from "#ALLOCATED" to "myBitmap0" to copy the current
>>> allocation data into "myBitmap0", for instance.
>>
>> Sounds fun, but is there actually any use for this if the only purpose
>> is to work as a source for merge?
>>
>> I mean, it would be interesting if it worked exactly like a perma-RO
>> pseudo-bitmap that whenever you try to get data from it performs a
>> block-status call.  But as you say, that would probably be too slow, and
>> it would take a lot of code modifications, so I wonder if there is
>> actually any purpose for this.
>>
>>> Some thoughts:
>>>
>>> - The only commands where this pseudo-bitmap makes sense is merge.
>>> enable/disable/remove/clear/add don't make sense here.
>>>
>>> - This pseudo bitmap might make sense for backup, but it's not needed;
>>> you can just merge into an empty/enabled bitmap and then use that.
>>>
>>> - Creating an allocation bitmap on-the-fly is probably not possible
>>> directly in the merge command, because the disk status calls might take
>>> too long...
>>>
>>> Hm, actually, I'm not sure how to solve that one. Merge would need to
>>> become a job (or an async QMP command?) or we'd need to keep an
>>> allocation bitmap object around and in-sync. I don't really want to do
>>> either, so maybe I'm missing an obvious/better solution.
>>
>> All of what you wrote in this mail makes me think it would make much
>> more sense to just add a “block-dirty-bitmap-create-from” job with an
>> enum of targets.  (One of which would be “allocated-blocks”.)

Sounds good. (What are the other targets? Questions-for-later?)

> 
> I forgot to add that of course the advantage of a pseudo-bitmap would be
> that it’s always up to date, but as you said, it would be slow to query
> (and it might even yield, which isn’t what callers expect) and at least
> for block allocation, it seems unnecessary to me (because writes will
> keep the new bitmap created from allocated-blocks up-to-date).
> 
> Max
> 

Who knows what's happened in the month since I've been gone, but I think
I agree completely with your assessment.

In our meeting with Denis it seemed like it was the optimal thing to
make a pseudo-bitmap for merge so we didn't have to add a new command,
but I think it's clear that the async properties are going to prohibit
that nice solution and we will indeed need a job.

--js



      reply	other threads:[~2019-12-02 22:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-01 15:42 bitmaps -- copying allocation status into dirty bitmaps John Snow
2019-11-01 15:49 ` Denis V. Lunev
2019-11-01 16:10   ` Eric Blake
2019-11-01 16:39   ` Vladimir Sementsov-Ogievskiy
2019-11-01 16:53 ` Vladimir Sementsov-Ogievskiy
2019-11-04 11:21 ` Max Reitz
2019-11-04 11:27   ` Max Reitz
2019-12-02 22:13     ` John Snow [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=12048403-663d-8c0b-1bd6-a3db3e415244@redhat.com \
    --to=jsnow@redhat.com \
    --cc=den@openvz.org \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --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).