From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:41721) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guHxe-0002SA-TO for qemu-devel@nongnu.org; Thu, 14 Feb 2019 09:25:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1guHla-0002LZ-OD for qemu-devel@nongnu.org; Thu, 14 Feb 2019 09:13:32 -0500 From: Alberto Garcia In-Reply-To: <20190212144747.GC5283@localhost.localdomain> References: <20190212144747.GC5283@localhost.localdomain> Date: Thu, 14 Feb 2019 15:13:11 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 01/13] block: Allow freezing BdrvChild links List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, Max Reitz On Tue 12 Feb 2019 03:47:47 PM CET, Kevin Wolf wrote: > Am 17.01.2019 um 16:33 hat Alberto Garcia geschrieben: >> @@ -3861,6 +3923,10 @@ int bdrv_drop_intermediate(BlockDriverState *top, BlockDriverState *base, >> goto exit; >> } >> >> + if (bdrv_is_backing_chain_frozen(top, base, NULL)) { >> + goto exit; >> + } >> + >> /* If 'base' recursively inherits from 'top' then we should set >> * base->inherits_from to top->inherits_from after 'top' and all >> * other intermediate nodes have been dropped. > > bdrv_drop_intermediate() doesn't change the links between in the chain > between top and base, but the links between the parents of top and top > are changed to point to base instead. > > I think this is checking the wrong thing. You're right, those links should be checked. On the other hand it does remove all references from top's parents to top, so in the general case it will end up deleting all intermediate notes, and their backing links with them. So I think we still need that check. Berto