From patchwork Wed Oct 31 16:16:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alberto Garcia X-Patchwork-Id: 10662901 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 71C0513A4 for ; Wed, 31 Oct 2018 16:20:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 622552AFFE for ; Wed, 31 Oct 2018 16:20:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 56BD22B001; Wed, 31 Oct 2018 16:20:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 15A4A2B1C3 for ; Wed, 31 Oct 2018 16:20:48 +0000 (UTC) Received: from localhost ([::1]:60556 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHtEd-0003a8-PL for patchwork-qemu-devel@patchwork.kernel.org; Wed, 31 Oct 2018 12:20:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41834) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHtBi-0008VE-TT for qemu-devel@nongnu.org; Wed, 31 Oct 2018 12:17:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gHtBf-0001Wq-3w for qemu-devel@nongnu.org; Wed, 31 Oct 2018 12:17:46 -0400 Received: from fanzine.igalia.com ([91.117.99.155]:54105) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gHtBe-0000fw-LJ; Wed, 31 Oct 2018 12:17:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Message-Id:Date:Subject:Cc:To:From; bh=7hm/4O5UpzmS0mQsBIO2T5a5X2bxnido1IxqUFpKdNI=; b=sZGRt9XnNrgNqGQp+sY/GO8CY8mxhiuLIWMYC3xGWAvw0I+P7RmpJPOej8PJM4AgJCfJMfYGFAC8nnRxje5KFO2CQDggU5NAbZwb0t2yRAlJ+8asFfUC73P2nH9J4Oze7qyzS3WsxcrYGvL3FJE5NSORkUr3S2G3406Z/YYvgwqrNmVSsNnLpjc9tMaURcR8KS2t+WEwoh8ioaCxVKFGYHIId0NF//xswZXCpfCUOTjyk1sNVzRHZ0LMIp4sUJLqozgkh/4dcD7GUDTu0Qd0EADvCEsRFcGlkbFmf5Vs8HXGpcAQgy3CCveElWka3+X6abywRucoW+hJxOuDdKiILg==; Received: from [194.100.51.2] (helo=perseus.local) by fanzine.igalia.com with esmtpsa (Cipher TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim) id 1gHtAx-0006Gb-MH; Wed, 31 Oct 2018 17:16:59 +0100 Received: from berto by perseus.local with local (Exim 4.89) (envelope-from ) id 1gHtAh-0008Iu-5S; Wed, 31 Oct 2018 18:16:43 +0200 From: Alberto Garcia To: qemu-devel@nongnu.org Date: Wed, 31 Oct 2018 18:16:36 +0200 Message-Id: X-Mailer: git-send-email 2.11.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Received-From: 91.117.99.155 Subject: [Qemu-devel] [PATCH 0/2] Update the inherits_from pointer after stream and commit X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Alberto Garcia , qemu-block@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Hi all, when you open an image [A] with a few more images on the backing chain you get something like this: [E] <- [D] <- [C] <- [B] <- [A] Here you can go from [A] to [E] by following the bs->backing pointer. At the same time each one of the backing files has an 'inherits_from' attribute pointing to their parent, so you can go from [E] to [A] following the inherits_from pointer. 'inherits_from' is used on bdrv_reopen_queue_child() to decide if a node's children must be reopened together with the parent and inherit its options. If some the intermediate nodes are removed (either by block-stream or by block-commit) you end up with something like this: [E] <- [A] In this case we would expect [E] to inherit from [A], however its inherits_from pointer is NULL and trying to change its options by reopening [A] with backing.option=value fails. This patch series fixes this. See each individual patch for more details. Regards, Berto Alberto Garcia (2): block: Update BlockDriverState.inherits_from on bdrv_set_backing_hd() block: Update BlockDriverState.inherits_from on bdrv_drop_intermediate() block.c | 37 ++++++++++++ tests/qemu-iotests/161 | 137 +++++++++++++++++++++++++++++++++++++++++++++ tests/qemu-iotests/161.out | 39 +++++++++++++ tests/qemu-iotests/group | 1 + 4 files changed, 214 insertions(+) create mode 100755 tests/qemu-iotests/161 create mode 100644 tests/qemu-iotests/161.out