From nobody Mon Feb 9 00:20:29 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1570829190; cv=none; d=zoho.com; s=zohoarc; b=g4TlFl2P/wZcFm4vEF2RpQM0H41mH+i4h0lLgex00YUXrloFrbHZcTFaFYGn4z/ucQy/gkSgzfPhoZJbP04BxrxO1MAFspD/uSawkW67LjvyAHu9l4GBJTZCIil1AMbq+t1nnkDrqRmIaTw2NMint+AsUos8G9/jw+dau98y9tQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570829190; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=3gjd+m3usSSauhE7qSZGdSiFLjpzN1GiK7cnLyS5S0g=; b=Ntj74sPUkIEFwRvXiDLdBw+yvLnpGC7BYWye86TxNp8DdizRVphJF6GUUkz/4wmKFlnZ5mzTAmJSxWL8cjdKxW3h7maRmhX3gy/ZQCTQmJcO+OIy4R0AWeAr+wcyFdDdZzEay4MmHSITesV69e+SIfJgaF7DekPzhrrpUgqTigs= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1570829190858173.61456406032687; Fri, 11 Oct 2019 14:26:30 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 50749801661; Fri, 11 Oct 2019 21:26:29 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2848710027A9; Fri, 11 Oct 2019 21:26:29 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id E25061806B14; Fri, 11 Oct 2019 21:26:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9BLQRRi006607 for ; Fri, 11 Oct 2019 17:26:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id A9B1526181; Fri, 11 Oct 2019 21:26:27 +0000 (UTC) Received: from probe.bos.redhat.com (dhcp-17-173.bos.redhat.com [10.18.17.173]) by smtp.corp.redhat.com (Postfix) with ESMTP id 16C6745A2; Fri, 11 Oct 2019 21:26:21 +0000 (UTC) From: John Snow To: Peter Maydell , qemu-devel@nongnu.org Date: Fri, 11 Oct 2019 17:25:41 -0400 Message-Id: <20191011212550.27269-11-jsnow@redhat.com> In-Reply-To: <20191011212550.27269-1-jsnow@redhat.com> References: <20191011212550.27269-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Fam Zheng , Kevin Wolf , Vladimir Sementsov-Ogievskiy , qemu-block@nongnu.org, Juan Quintela , libvir-list@redhat.com, John Snow , "Dr. David Alan Gilbert" , Max Reitz , Stefan Hajnoczi Subject: [libvirt] [PULL 10/19] block: reverse order for reopen commits X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.67]); Fri, 11 Oct 2019 21:26:29 +0000 (UTC) Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy It's needed to fix reopening qcow2 with bitmaps to RW. Currently it can't work, as qcow2 needs write access to file child, to mark bitmaps in-image with IN_USE flag. But usually children goes after parents in reopen queue and file child is still RO on qcow2 reopen commit. Reverse reopen order to fix it. Signed-off-by: Vladimir Sementsov-Ogievskiy Acked-by: Max Reitz Acked-by: John Snow Message-id: 20190927122355.7344-3-vsementsov@virtuozzo.com Signed-off-by: John Snow --- block.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/block.c b/block.c index aaf5d796284..c548885608d 100644 --- a/block.c +++ b/block.c @@ -3486,10 +3486,16 @@ int bdrv_reopen_multiple(BlockReopenQueue *bs_queue= , Error **errp) bs_entry->perms_checked =3D true; } =20 - /* If we reach this point, we have success and just need to apply the - * changes + /* + * If we reach this point, we have success and just need to apply the + * changes. + * + * Reverse order is used to comfort qcow2 driver: on commit it need to= write + * IN_USE flag to the image, to mark bitmaps in the image as invalid. = But + * children are usually goes after parents in reopen-queue, so go from= last + * to first element. */ - QTAILQ_FOREACH(bs_entry, bs_queue, entry) { + QTAILQ_FOREACH_REVERSE(bs_entry, bs_queue, entry) { bdrv_reopen_commit(&bs_entry->state); } =20 --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list