qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: John Snow <jsnow@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Cc: Peter Krempa <pkrempa@redhat.com>,
	qemu-devel <qemu-devel@nongnu.org>,
	Qemu-block <qemu-block@nongnu.org>, Max Reitz <mreitz@redhat.com>
Subject: Re: bitmap migration bug with -drive while block mirror runs
Date: Tue, 1 Oct 2019 12:07:54 -0400	[thread overview]
Message-ID: <e112c85a-684f-5721-2da7-d23312c9e487@redhat.com> (raw)
In-Reply-To: <9431d242-bfe1-b9db-17d0-6c1a280a05da@virtuozzo.com>



On 10/1/19 11:57 AM, Vladimir Sementsov-Ogievskiy wrote:
> 01.10.2019 17:10, John Snow wrote:
>>
>>
>> On 10/1/19 10:00 AM, Vladimir Sementsov-Ogievskiy wrote:
>>>> Otherwise: I have a lot of cloudy ideas on how to solve this, but
>>>> ultimately what we want is to be able to find the "addressable" name for
>>>> the node the bitmap is attached to, which would be the name of the first
>>>> ancestor node that isn't a filter. (OR, the name of the block-backend
>>>> above that node.)
>>> Not the name of ancestor node, it will break mapping: it must be name of the
>>> node itself or name of parent (may be through several filters) block-backend
>>>
>>
>> Ah, you are right of course -- because block-backends are the only
>> "nodes" for which we actually descend the graph and add the bitmap to
>> its child.
>>
>> So the real back-resolution mechanism is:
>>

Amendment:
   - If our local node-name N is well-formed, use this.
   - Otherwise:
>> - Find the first non-filter ancestor, A
>> - if A is not a block-backend, we must use our node-local name.
     Amendment: If it's not a BB, we have no addressable name
                for the bitmap and this is an error.
>> - if A's name is empty, we must use our node-local name.
     Amendment: If it's empty, we have no addressable name
                for the bitmap and this is an error.
>> - If the name we have chosen is not id_wellformed, we have no
>> migration-stable addressable name for this bitmap and the migration must
>> fail!
     (Handled by above amendments.)

The reason for the change is to prefer user-defined node names whenever
possible; only trying to find a "device" or "backend" name whenever we
fail to find one.

>>
>>
>> For resolving bitmap addresses via QMP (node, name) pairs; the
>> resolution method would be this:
>>
>> - if the node-name N is a block-backend, descend the tree until we find
>> the first non-filter node V.
>> - if the node-name N is a BlockDriverState, use this node directly.
>>
> 
> Looks good for me.
> 

I hope the increased leeway of the name resolution doesn't make things
worse with respect to filters. I specified this to match the
back-resolution process.

I suppose if you want to add bitmaps to filters, you are required to add
them by node-name specifically.

> I also think if on destination we have both block-backend with name N and
> block-node with name N and the latter is not (filtered) child of the former,
> we should fail migration of at least that bitmap. (Hope, nobody reuse
> block-backend names as node-names in practice.. (should we restrict it
> explicitly ?))
> 

:(

>>
>> (I don't have the time to investigate the code snippet right now; my
>> attention is being pulled to a different project. sorry!)
>>
> 
> So, you are not working on this? Then I'll make patches.
> 

Right; I'm not prototyping a fix currently.

--js


  reply	other threads:[~2019-10-01 16:27 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-01  0:09 bitmap migration bug with -drive while block mirror runs John Snow
2019-10-01  4:28 ` Peter Krempa
2019-10-01  9:07   ` Vladimir Sementsov-Ogievskiy
2019-10-01  8:57 ` Vladimir Sementsov-Ogievskiy
2019-10-01  9:54   ` Kevin Wolf
2019-10-01 10:05     ` Vladimir Sementsov-Ogievskiy
2019-10-01 13:24     ` Peter Krempa
2019-10-01 15:09     ` John Snow
2019-10-01 15:58       ` Kevin Wolf
2019-10-01 16:12         ` Vladimir Sementsov-Ogievskiy
2019-10-01 16:24           ` Kevin Wolf
2019-10-01 16:23         ` John Snow
2019-10-01 11:45   ` Peter Krempa
2019-10-01  9:17 ` Vladimir Sementsov-Ogievskiy
2019-10-01 14:00 ` Vladimir Sementsov-Ogievskiy
2019-10-01 14:10   ` John Snow
2019-10-01 15:57     ` Vladimir Sementsov-Ogievskiy
2019-10-01 16:07       ` John Snow [this message]
2019-10-02  8:12         ` Kevin Wolf
2019-10-02 10:46         ` Peter Krempa
2019-10-02 11:11           ` Kevin Wolf
2019-10-02 12:22             ` Vladimir Sementsov-Ogievskiy
2019-10-02 13:48               ` Peter Krempa
2019-10-02 13:43             ` Peter Krempa
2019-10-02 14:03               ` Vladimir Sementsov-Ogievskiy
2019-10-02 21:35           ` John Snow
2019-10-03 10:14             ` Vladimir Sementsov-Ogievskiy
2019-10-03 23:34               ` John Snow
2019-10-04  8:33                 ` Peter Krempa
2019-10-04  9:21                   ` Vladimir Sementsov-Ogievskiy
2019-10-06  3:15                   ` John Snow
2019-10-04  9:24                 ` Vladimir Sementsov-Ogievskiy
2019-10-04 13:07                   ` Eric Blake
2019-10-06  3:19                     ` John Snow
2019-10-01 16:16       ` Kevin Wolf
2019-10-01 16:17         ` Vladimir Sementsov-Ogievskiy
2019-10-01 14:13   ` Max Reitz
2019-10-01 14:27     ` Vladimir Sementsov-Ogievskiy
2019-10-01 14:34       ` Max Reitz
2019-10-01 14:53         ` Vladimir Sementsov-Ogievskiy
2019-10-01 15:26           ` Max Reitz
2019-10-02  7:34             ` Peter Krempa
2019-10-01 15:09         ` Kevin Wolf
2019-10-01 15:27           ` Max Reitz
2019-10-01 16:12             ` Kevin Wolf
2019-10-01 16:17               ` Max Reitz
2019-10-01 16:22                 ` Vladimir Sementsov-Ogievskiy

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=e112c85a-684f-5721-2da7-d23312c9e487@redhat.com \
    --to=jsnow@redhat.com \
    --cc=mreitz@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).