qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] replication: Avoid blk_make_empty() on read-only child


From: Kevin Wolf
Subject: Re: [PATCH] replication: Avoid blk_make_empty() on read-only child
Date: Fri, 15 May 2020 14:12:17 +0200

Am 15.05.2020 um 14:03 hat Kevin Wolf geschrieben:
> This is just a bandaid to keep tests/test-replication working after
> bdrv_make_empty() starts to assert that we're not trying to call it on a
> read-only child.
> 
> For the real solution in the future, replication should not steal the
> BdrvChild from its backing file (this is never correct to do!), but
> instead have its own child node references, with the appropriate
> permissions.
> 
> Signed-off-by: Kevin Wolf <address@hidden>

I'll commit this patch for now so the brokenness of the replication
driver won't stop my pull request, but this is really not how things
should work.

Can someone who is interested in replication have a look at the real
solution, please? It's not trivial enough for me to fix it without
learning a lot about using replication first.

Essentially, the problem is that you can't just copy the BdrvChild from
bs->backing like replication_start() does, but you need to use
bdrv_attach_child() to attach the respective node directly to bs, too.
This gives you the opportunity to request the write permissions you need
for bdrv_make_empty().

However, it seems that during replication_start(), the backing file
isn't writable yet (which is not surprising, backing files are supposed
to be read-only), so my attempt to request write permissions right there
failed. So it seems we need to figure out where the backing file becomes
writable and then take write permissions after this point. Or make it
writable earlier. I don't understand enough about the whole setup to
figure out where this should happen, which is why I'm asking you.

Kevin




reply via email to

[Prev in Thread] Current Thread [Next in Thread]