[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH] commit: get the overlay node before manipulatin
From: |
Max Reitz |
Subject: |
Re: [Qemu-block] [PATCH] commit: get the overlay node before manipulating the backing chain |
Date: |
Wed, 24 Aug 2016 12:38:41 -0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 |
On 2016-08-21 at 23:36, Alberto Garcia wrote:
The 'block-commit' command has a 'top' parameter to specify the
topmost node from which the data is going to be copied.
[E] <- [D] <- [C] <- [B] <- [A]
In this case if [C] is the top node then this is the result:
[E] <- [B] <- [A]
[B] must be modified so its backing image string points to [E] instead
of [C]. commit_start() takes care of reopening [B] in read-write
mode, and commit_complete() puts it back in read-only mode once the
operation has finished.
In order to find [B] (the overlay node) we look for the node that has
[C] (the top node) as its backing image. However in commit_complete()
we're doing it after [C] has been removed from the chain, so [B] is
never found and remains in read-write mode.
That's... Unfortunate.
This patch gets the overlay node before the backing chain is
manipulated.
Signed-off-by: Alberto Garcia <address@hidden>
---
block/commit.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
Thanks, applied to my block-next tree:
https://github.com/XanClic/qemu/commits/block-next
Max