From: Max Reitz <mreitz@redhat.com>
To: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Cc: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
qemu-block@nongnu.org, Juan Quintela <quintela@redhat.com>,
qemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>,
Peter Krempa <pkrempa@redhat.com>
Subject: Re: [RFC v2] migration: Add migrate-set-bitmap-node-mapping
Date: Thu, 14 May 2020 11:08:10 +0200 [thread overview]
Message-ID: <146b4724-69b8-93b5-e2ac-b909721f530b@redhat.com> (raw)
In-Reply-To: <20200514084242.GB2787@work-vm>
[-- Attachment #1.1: Type: text/plain, Size: 2659 bytes --]
On 14.05.20 10:42, Dr. David Alan Gilbert wrote:
> * Max Reitz (mreitz@redhat.com) wrote:
>
> <snip>
>
>> +void qmp_migrate_set_bitmap_node_mapping(MigrationBlockNodeMappingList *mapping,
>> + Error **errp)
>> +{
>> + QDict *in_mapping = qdict_new();
>> + QDict *out_mapping = qdict_new();
>> +
>> + for (; mapping; mapping = mapping->next) {
>> + MigrationBlockNodeMapping *entry = mapping->value;
>> +
>> + if (qdict_haskey(out_mapping, entry->node_name)) {
>> + error_setg(errp, "Cannot map node name '%s' twice",
>> + entry->node_name);
>> + goto fail;
>> + }
>
> I'm not too clear exactly which case this is protecting against;
> I think that's protecting against mapping
>
> 'src1'->'dst1' and 'src1'->'dst2'
> which is a good check.s (or maybe it's checking against dst2 twice?)
This one is against mapping src1 twice. Both checks together check that
it’s a one-to-one bijective mapping.
The technical reason why it needs to be one-to-one is because we base
two QDicts off of it, so the inverse mapping needs to work.
> What about cases where there is no mapping - e.g. imagine
> that we have b1/b2 on the source and b2/b3 on the dest; now
> if we add just a mapping:
>
> b1->b2
>
> then we end up with:
>
> b1 -> b2
> b2 -> b2 (non-mapped)
> b3
>
> so we have a clash there - are we protected against that?
Oh, no, we aren’t. That wasn’t intentional. However, I’m not sure how
we’d protect against it. We can’t check it in
qmp_migrate_set_bitmap_node_mapping(), because we don’t know yet which
nodes will exist at the time of migration, and which of those will have
bitmaps.
So we’d need to check it as part of the migration process (by looking up
any unmapped entries that default to the identity mapping in the
respective reverse mapping, to see whether anything maps to the same name).
OTOH, Vladimir proposed adding a parameter to
migrate-set-bitmap-node-mapping that would make migration fail if any
bitmaps should be migrated off of unmapped nodes, or if any incoming
alias is unmapped (instead of defaulting to the identity mapping). If
we just make that the only behavior, then we wouldn’t have a problem
with that at all, because all unmapped nodes would always throw an error.
(And on the third hand, I wonder whether we should actually allow
migrating bitmaps from multiple nodes to a single one, but I suppose
that would require two separate commands, one for incoming and one for
outgoing...)
Max
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2020-05-14 9:09 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-13 14:56 [RFC v2] migration: Add migrate-set-bitmap-node-mapping Max Reitz
2020-05-13 16:11 ` Eric Blake
2020-05-14 7:13 ` Max Reitz
2020-05-14 11:07 ` Kevin Wolf
2020-05-13 20:09 ` Vladimir Sementsov-Ogievskiy
2020-05-14 7:42 ` Max Reitz
2020-05-14 9:09 ` Max Reitz
2020-05-14 10:58 ` Vladimir Sementsov-Ogievskiy
2020-05-14 11:04 ` Kevin Wolf
2020-05-14 8:42 ` Dr. David Alan Gilbert
2020-05-14 9:08 ` Max Reitz [this message]
2020-05-14 9:32 ` Dr. David Alan Gilbert
2020-05-18 16:26 ` Peter Krempa
2020-05-18 17:52 ` Vladimir Sementsov-Ogievskiy
2020-05-18 18:20 ` Peter Krempa
2020-05-18 18:47 ` Vladimir Sementsov-Ogievskiy
2020-06-02 10:56 ` Max Reitz
2020-06-02 11:12 ` Peter Krempa
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=146b4724-69b8-93b5-e2ac-b909721f530b@redhat.com \
--to=mreitz@redhat.com \
--cc=armbru@redhat.com \
--cc=dgilbert@redhat.com \
--cc=pkrempa@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=quintela@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 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).