qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: "Denis V. Lunev" <den@openvz.org>, John Snow <jsnow@redhat.com>,
	Qemu-block <qemu-block@nongnu.org>
Cc: Kevin Wolf <kwolf@redhat.com>, Peter Krempa <pkrempa@redhat.com>,
	Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
	qemu-devel <qemu-devel@nongnu.org>
Subject: Re: bitmaps -- copying allocation status into dirty bitmaps
Date: Fri, 1 Nov 2019 17:10:56 +0100	[thread overview]
Message-ID: <686e8a67-06e9-d7f1-037b-cf730de23744@redhat.com> (raw)
In-Reply-To: <c8a31188-ff21-368e-12ca-0481a51c3136@openvz.org>

On 11/1/19 4:49 PM, Denis V. Lunev wrote:
> On 11/1/19 4:42 PM, 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.
> original problem was a little bit incorrect. After some thoughts I found
> that this is NOT enough. We should also add zeroed clusters to the
> bitmap to merge! They do cover some data clusters from the original
> image.
> 
> Thus we should either provide "ALLOCATED" bitmap for other purposes,
> and we should supply "CHANGED" which contains allocated AND
> explicitly zeroed clusters.

I'm also wondering if 'nbd-server-add' should add support to expose a 
'qemu:allocation:XXX' meta context, in addition to the existing 
'qemu:dirty-bitmap:XXX' contexts (would it just be a 0/1 bit for what is 
allocated in block layer XXX, or would it be an integer depth 0,1,2,... 
based on how deep in the chain a cluster is allocated, or?)

It may also be interesting to have a way to have 'nbd-server-add' force 
EIO errors to reads from an area not covered by a bitmap (whether that 
be the dirty bitmap or the #ALLOCATED bitmap), rather than falling back 
to a read from the backing chain, to ensure that an NBD client using 
such a backup image cannot read any more data than what the bitmap says 
is available.

> 
> Den
>> 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.
>>
>> Also, with regards to introspection, if we do create a special reserved
>> name like #ALLOCATED, we need to make sure that this is available and
>> obvious via the QAPI schema.

If nothing else, the recent addition of introspectible QMP features 
should make this possible.


-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org



  reply	other threads:[~2019-11-01 16:13 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 [this message]
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

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=686e8a67-06e9-d7f1-037b-cf730de23744@redhat.com \
    --to=eblake@redhat.com \
    --cc=den@openvz.org \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=pkrempa@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).