Received: from eggs.gnu.org ([2001:4830:134:3::10]:37893) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bcbCd-0008UP-7C for qemu-devel@nongnu.org; Wed, 24 Aug 2016 12:39:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bcbCb-0007lH-72 for qemu-devel@nongnu.org; Wed, 24 Aug 2016 12:38:58 -0400 References: <1471836963-28548-1-git-send-email-berto@igalia.com> From: Max Reitz Message-ID: <2391f2c5-174e-745c-91c3-6066c3d6cda5@redhat.com> Date: Wed, 24 Aug 2016 12:38:41 -0400 MIME-Version: 1.0 In-Reply-To: <1471836963-28548-1-git-send-email-berto@igalia.com> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] commit: get the overlay node before manipulating the backing chain List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alberto Garcia , qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Kevin Wolf , Stefan Hajnoczi 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 > --- > 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