From nobody Sat Feb 7 04:47:22 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=1571081588; cv=none; d=zoho.com; s=zohoarc; b=kzTam2gEoHtijV17nJxU/IEnY0k+v4OZpytfuSwIKRh6erpT6A2g/zHwbSICm/u8XLangHa53f43uur0WXrASWiifVjPhjhKlrmBrpX/SItPPKEDQFIuF3taw4mc4bOECy6oIwthbdwkH6XLkULjDw7BR0qTgzQP8yoMmBN777M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571081588; 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=fj7KmnOzbec9yNKVTLcj0FZLVX/6ktpY82F2dOxAmpY=; b=gPYDMqokJlV04khHYj5TrOY0BVCgSprZEL59rzzVMh0ZBrmseQdxtJoLRjLmUF2FWeYf2O4jTg4tsBihn3j0ut4t2YyOq+DGXSjK+EokWjPoDPXFH/86i588JjnaX73TcTk4JgxH94nz6IBTnw/uc0AC4Jp+VC0M47JfDMtiRBk= 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 1571081588464213.66030771823375; Mon, 14 Oct 2019 12:33:08 -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 7DDF3315C027; Mon, 14 Oct 2019 19:33:06 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 06BB01001B07; Mon, 14 Oct 2019 19:33:06 +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 B70474EE6E; Mon, 14 Oct 2019 19:33:05 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9EJTqpf004419 for ; Mon, 14 Oct 2019 15:29:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id C34C560C80; Mon, 14 Oct 2019 19:29:52 +0000 (UTC) Received: from probe.bos.redhat.com (dhcp-17-152.bos.redhat.com [10.18.17.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7165A60BE2; Mon, 14 Oct 2019 19:29:51 +0000 (UTC) From: John Snow To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 14 Oct 2019 15:29:00 -0400 Message-Id: <20191014192909.16044-11-jsnow@redhat.com> In-Reply-To: <20191014192909.16044-1-jsnow@redhat.com> References: <20191014192909.16044-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 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 v2 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.5.16 (mx1.redhat.com [10.5.110.41]); Mon, 14 Oct 2019 19:33:06 +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 0347632c6c..cf312258a9 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