From nobody Mon Nov 25 17:52:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1594909542; cv=none; d=zohomail.com; s=zohoarc; b=lXAPT9r33Zgq69pvDtUn6ic1wS0IlvOH45uxfQJOjnRBhmlRrSHanxQ61fR0/SAlIaffghFmP3gByPxJKUPpKuDDwekq7vMF4ecmR2ix6T/yBlO3mXbY50dFx0eMmAzoN6L9QSh8kSBpetN/VmCMCWZNEdgKscOee5/oSsDna9Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594909542; h=Content-Type:Content-Transfer-Encoding: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=Teqh9HDajWgrZt231oA0JFHOfg3Lus10Jx5qXpEzAJU=; b=OCw5RCJ+7lvGH8hVcrc1hdiUYBei0IjyiaojSWGLV8xw92QKPcicfafhzn5RqcRHdJ7x5VCCozmaEN9yIhBYNvDJkw6ezzb5jBMn7DG4e6dGD8FPHN2/7eqNOVeXJU5qJcvgUvwgpDaB+KjW1rUdxdDcKPNn6SQinOXm1svvSBo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 159490954238967.68583713425801; Thu, 16 Jul 2020 07:25:42 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-33-481Cfv3mOLKTmXehJHwvUA-1; Thu, 16 Jul 2020 10:25:38 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AE709806413; Thu, 16 Jul 2020 14:24:25 +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 04D9B6FDD1; Thu, 16 Jul 2020 14:24:25 +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 AA1A996239; Thu, 16 Jul 2020 14:24:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06GEKSf8028865 for ; Thu, 16 Jul 2020 10:20:28 -0400 Received: by smtp.corp.redhat.com (Postfix) id 47F766178C; Thu, 16 Jul 2020 14:20:28 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9096361494 for ; Thu, 16 Jul 2020 14:20:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594909541; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Teqh9HDajWgrZt231oA0JFHOfg3Lus10Jx5qXpEzAJU=; b=Wou4iu1SzEiA0W2nmUDbcRD5ge0UOEvkkyr1VXaTiUkRkPsGem3AjULWfpxfMBxv5e+lFh vW3zxEovmlSWG/i/hXDhFx65oSiiMoxkEGdeb7Hysg2PD94bPND7Xzizap2UKlubSCnNuo PjQR3EtxUmes5Kdy+YnPnOFScTB6dtE= X-MC-Unique: 481Cfv3mOLKTmXehJHwvUA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 1/5] qemu: blockjob: Don't base bitmap handling of active-layer block commit on QEMU_CAPS_BLOCKDEV_REOPEN Date: Thu, 16 Jul 2020 16:20:18 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The handler finalizing the active layer block commit doesn't actually reopen the file for active layer block commit, so the comment and check are invalid. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/qemu/qemu_blockjob.c | 3 ++- src/qemu/qemu_driver.c | 6 +----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index 0039bc0e9f..9b78733c53 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -1101,7 +1101,8 @@ qemuBlockJobProcessEventCompletedCommitBitmaps(virDom= ainObjPtr vm, g_autoptr(virJSONValue) actions =3D NULL; bool active =3D job->type =3D=3D QEMU_BLOCKJOB_TYPE_ACTIVE_COMMIT; - if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV_REOPEN)) + if (!active && + !virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV_REOPEN)) return 0; if (!(blockNamedNodeData =3D qemuBlockGetNamedNodeData(vm, asyncJob))) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index d185666ed8..f5074cb151 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -17386,11 +17386,7 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver, break; case QEMU_BLOCKJOB_TYPE_ACTIVE_COMMIT: - /* we technically don't need reopen here, but we couldn't prepare - * the bitmaps if it wasn't present thus must skip this */ - if (blockdev && - virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV_REOPEN)) { - + if (blockdev) { actions =3D virJSONValueNewArray(); if (qemuMonitorTransactionBitmapAdd(actions, --=20 2.26.2 From nobody Mon Nov 25 17:52:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1594909555; cv=none; d=zohomail.com; s=zohoarc; b=TArej8Q9sthgh9NXP3sSuFEUFKivp8YRo6E23n0EKLnvRCJSkpa2vhp8I0ZCQC/22CwRzGjtLKHKu8LkCjf/ekrkjBkcaE0lMwHjDWfWH7m/h/gHbj1+D1Z+NjydR+RMpAr4lSCwXCjKt0rGoIrB5i2qw+/4ubJcjqM0kFhfeU0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594909555; h=Content-Type:Content-Transfer-Encoding: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=kWneWESwxj4LvyrHJIzd3PSmlqPjjDYvcSn6CjY9wLU=; b=Lgf4zV3XT5scM5N0S7pPHxtnT2hOJvRZUbPHP8Ee6TQ2iFRAPQSp4gtWTn7B4q2gabDpJ4XgKluEB1Spfw3yJ/zBAynxxHujRXrwEAN0zjRoBnif9Dh/9ux+HTaLzwm65waopHyi8/htgPEs1NZErr/4n+K081HZz/rzywkCazM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1594909555929707.3929126861104; Thu, 16 Jul 2020 07:25:55 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-236-cZYk2WdSMcespEPQDOB8Vw-1; Thu, 16 Jul 2020 10:25:49 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 23892803F19; Thu, 16 Jul 2020 14:24:35 +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 F2BDD72AE1; Thu, 16 Jul 2020 14:24:34 +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 C4C4D1809554; Thu, 16 Jul 2020 14:24:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06GEKVr3028878 for ; Thu, 16 Jul 2020 10:20:31 -0400 Received: by smtp.corp.redhat.com (Postfix) id 246A561475; Thu, 16 Jul 2020 14:20:31 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id 784EE6149A for ; Thu, 16 Jul 2020 14:20:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594909554; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=kWneWESwxj4LvyrHJIzd3PSmlqPjjDYvcSn6CjY9wLU=; b=Z2rebaloR0L7Slky/lWh227R54tZ/Lxb2d3ihTm44kdUjV8gWmRJREIqDIdMOKPKHbJi0M g7oRgIstZ/1/YJ1koGDf/Miq+ICnPUfKA7kz1MRWCVY3mZ5ua9Mwwqvk+q066350pEze3q BxLVkKaHZwkbondmv0o6m9drObwOR4Y= X-MC-Unique: cZYk2WdSMcespEPQDOB8Vw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 2/5] qemu: blockjob: Actually delete temporary bitmap on failed active commit Date: Thu, 16 Jul 2020 16:20:19 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Commit 20a7abc2d2d tried to delete the possibly leftover bitmap but neglected to call the actual monitor to do so. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/qemu/qemu_blockjob.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index 9b78733c53..c49c98e547 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -1416,8 +1416,10 @@ qemuBlockJobProcessEventConcludedCopyAbort(virQEMUDr= iverPtr driver, static void qemuBlockJobProcessEventFailedActiveCommit(virQEMUDriverPtr driver, virDomainObjPtr vm, - qemuBlockJobDataPtr job) + qemuBlockJobDataPtr job, + qemuDomainAsyncJob asyncJob) { + qemuDomainObjPrivatePtr priv =3D vm->privateData; g_autoptr(virJSONValue) actions =3D virJSONValueNewArray(); virDomainDiskDefPtr disk =3D job->disk; @@ -1429,6 +1431,13 @@ qemuBlockJobProcessEventFailedActiveCommit(virQEMUDr= iverPtr driver, ignore_value(qemuMonitorTransactionBitmapRemove(actions, disk->mirror-= >nodeformat, "libvirt-tmp-activewri= te")); + if (qemuDomainObjEnterMonitorAsync(priv->driver, vm, asyncJob) < 0) + return; + + qemuMonitorTransaction(priv->mon, &actions); + + if (qemuDomainObjExitMonitor(priv->driver, vm) < 0) + return; /* Ideally, we would make the backing chain read only again (yes, SELi= nux * can do that using different labels). But that is not implemented ye= t and @@ -1553,7 +1562,7 @@ qemuBlockJobEventProcessConcludedTransition(qemuBlock= JobDataPtr job, if (success) { qemuBlockJobProcessEventCompletedActiveCommit(driver, vm, job,= asyncJob); } else { - qemuBlockJobProcessEventFailedActiveCommit(driver, vm, job); + qemuBlockJobProcessEventFailedActiveCommit(driver, vm, job, as= yncJob); } break; --=20 2.26.2 From nobody Mon Nov 25 17:52:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1594909553; cv=none; d=zohomail.com; s=zohoarc; b=R+YyqL2MsKSVpoDpwn6W/MMhtEqzPtb+qjGtb4XJbnviZuhNxr+y+ZAtbClq+3Mnq3pMZ0okbChMBB8f5MccYG0ISp/wcL/o6upfzzjhiPmCR0RMdK5ckQQwr3qqt27wWnFOfXkpBWuVBk8pceTrz6UzrNtjdoWclBNcZdeO2G0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594909553; h=Content-Type:Content-Transfer-Encoding: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=/240cvtF0euClTE9OMb9s2UXCy4gGR+DSRmtK6/Y8YA=; b=cVgHEl/EtEgeYokQWf7DnWGo6bV9F5SQVKGMwkLtGj3Ah43qKINXGYYIaBqe+JMCPw+1Cr0hwFxYSGQVLJvK1XcSvWtOigRJkwh+MWoe71enG51COWKY1nNWxMUiJIRMCvaSK19OhfSBnLM282XUeFk3f7/36oWJrXPeV5KKxAg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1594909553345281.72483464143454; Thu, 16 Jul 2020 07:25:53 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-458-PNvt_xdKMlK0EcmNNtIP6w-1; Thu, 16 Jul 2020 10:25:49 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C488182BA70; Thu, 16 Jul 2020 14:24:38 +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 9E09F60C84; Thu, 16 Jul 2020 14:24:38 +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 6C05196239; Thu, 16 Jul 2020 14:24:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06GEKWPi028887 for ; Thu, 16 Jul 2020 10:20:33 -0400 Received: by smtp.corp.redhat.com (Postfix) id F288F61788; Thu, 16 Jul 2020 14:20:32 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id 50B9961783 for ; Thu, 16 Jul 2020 14:20:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594909552; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=/240cvtF0euClTE9OMb9s2UXCy4gGR+DSRmtK6/Y8YA=; b=CQIAc0wZpgNhGW2IRU1/Mhj8OcOwT+TdO0TbLGcPfcAtJJjUqKOvS5Bkn+pAF6wfxQ+oKG VHr3YqFxkDWkOCUTlp+XrF4wdx1+abDkx32A9x+ApP5suGwbuJaYiFG2uYDjDcqgTby2VJ 7cmZKWX9C21Kj2WVUliymZ/7IErObuo= X-MC-Unique: PNvt_xdKMlK0EcmNNtIP6w-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 3/5] qemu: block: Remove 'active-write' bitmap even if there are no bitmaps to merge Date: Thu, 16 Jul 2020 16:20:20 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The 'libvirt-tmp-activewrite' bitmap is added during the 'pivot' operation of block copy and active layer block commit operations regardless of whether there are any bitmaps to merge, but was not removed unless a bitmap was merged. This meant that subsequent attempts to merge into the same image would fail. Fix it by checking whether the 'libvirt-tmp-activewrite' would be used by the code and don't skip the code which would delete it. This is a regression introduced when we switched to the new code for block commit in <20a7abc2d2d> and for block copy in <7bfff40fdfe5>. The actual bug originates from <4fa8654ece>. https://bugzilla.redhat.com/show_bug.cgi?id=3D1857735 Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/qemu/qemu_block.c | 3 ++- tests/qemublocktestdata/bitmapblockcommit/empty | 9 +++++++++ .../bitmapblockcopy/empty-deep-out.json | 9 +++++++++ .../bitmapblockcopy/empty-shallow-out.json | 9 +++++++++ 4 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index a2eabbcd64..c8607e56a8 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -2962,7 +2962,7 @@ qemuBlockGetBitmapMergeActions(virStorageSourcePtr to= psrc, if (!(bitmaps =3D qemuBlockGetBitmapMergeActionsGetBitmaps(topsrc, bit= mapname, blockNamedNod= eData))) - return 0; + goto done; for (next =3D bitmaps; next; next =3D next->next) { const char *curbitmap =3D next->data; @@ -3019,6 +3019,7 @@ qemuBlockGetBitmapMergeActions(virStorageSourcePtr to= psrc, return -1; } + done: if (writebitmapsrc && qemuMonitorTransactionBitmapRemove(act, writebitmapsrc->nodeformat, "libvirt-tmp-activewrite") < 0) diff --git a/tests/qemublocktestdata/bitmapblockcommit/empty b/tests/qemubl= ocktestdata/bitmapblockcommit/empty index 9260011852..eddef0ddcd 100644 --- a/tests/qemublocktestdata/bitmapblockcommit/empty +++ b/tests/qemublocktestdata/bitmapblockcommit/empty @@ -1 +1,10 @@ merge bitmpas: +[ + { + "type": "block-dirty-bitmap-remove", + "data": { + "node": "libvirt-2-format", + "name": "libvirt-tmp-activewrite" + } + } +] diff --git a/tests/qemublocktestdata/bitmapblockcopy/empty-deep-out.json b/= tests/qemublocktestdata/bitmapblockcopy/empty-deep-out.json index e69de29bb2..99f2589ed4 100644 --- a/tests/qemublocktestdata/bitmapblockcopy/empty-deep-out.json +++ b/tests/qemublocktestdata/bitmapblockcopy/empty-deep-out.json @@ -0,0 +1,9 @@ +[ + { + "type": "block-dirty-bitmap-remove", + "data": { + "node": "mirror-format-node", + "name": "libvirt-tmp-activewrite" + } + } +] diff --git a/tests/qemublocktestdata/bitmapblockcopy/empty-shallow-out.json= b/tests/qemublocktestdata/bitmapblockcopy/empty-shallow-out.json index e69de29bb2..99f2589ed4 100644 --- a/tests/qemublocktestdata/bitmapblockcopy/empty-shallow-out.json +++ b/tests/qemublocktestdata/bitmapblockcopy/empty-shallow-out.json @@ -0,0 +1,9 @@ +[ + { + "type": "block-dirty-bitmap-remove", + "data": { + "node": "mirror-format-node", + "name": "libvirt-tmp-activewrite" + } + } +] --=20 2.26.2 From nobody Mon Nov 25 17:52:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1594909624; cv=none; d=zohomail.com; s=zohoarc; b=PJorm7vDnOBZ9Lh2L8KclHxa2LlzZrrb5YKpoOCGOnssG659nC07i8F/+00rkww9k4UfVhxoaPyJ34pqNFHsM7RxPosFnNhrfkKnXtZMZ17GpHu819LWoFnU/edneY48FQdzIREZ8+ZTUTTbn2L6hktiBIiB4iT+PemRTrozatA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594909624; h=Content-Type:Content-Transfer-Encoding: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=0/fRgoOKgC7sxsMwgdDiE9UjujXbXaYlt7v1hZE3rnk=; b=P6rgWtOsQT20hSFoA0xdC/3oXeNozeyxpOCVseX+Yz4OnKh71RVCzK2806eNYJ33RDcEIaS7+1fzpvaq093pLLtc8XoiR7+Rn03s71dQ1p7hgRCoqv/6aujPUhn98OjmUiQwINLE3EUvNHQ5uoBHFrkdRnErLmnyyFAA4/Oc8Lo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1594909624292977.0123939187748; Thu, 16 Jul 2020 07:27:04 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-214-a3lo01WRM3iwOZLFBWPe5Q-1; Thu, 16 Jul 2020 10:26:05 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7422110A30DE; Thu, 16 Jul 2020 14:25:04 +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 51AAE61475; Thu, 16 Jul 2020 14:25:04 +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 2162D9623A; Thu, 16 Jul 2020 14:25:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06GEKYgu028895 for ; Thu, 16 Jul 2020 10:20:34 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1137061792; Thu, 16 Jul 2020 14:20:34 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id 735476178E for ; Thu, 16 Jul 2020 14:20:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594909623; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=0/fRgoOKgC7sxsMwgdDiE9UjujXbXaYlt7v1hZE3rnk=; b=bUIGOanr0qOdknSQccNzPIYfjqrNIuTFLomIN/7I+TCzuPnjYUNyyolxW7c+GykjOK3iQa g9ak96hbjJBFoDOGnn8IyUSfiw4YUBTL9KioVswX4798c4oJ/WSXYuqOgFsW6mYK4g+5va WrR/fiDzzvoWbn2Cx7wp0lRR1Mrx09I= X-MC-Unique: a3lo01WRM3iwOZLFBWPe5Q-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 4/5] qemuDomainBlockPivot: Rename 'actions' to 'bitmapactions' Date: Thu, 16 Jul 2020 16:20:21 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" There are two possible 'transaction' command arguments in the function. Rename 'actions' as they deal with creating bitmaps only. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/qemu/qemu_driver.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index f5074cb151..348ef17141 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -17319,7 +17319,7 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver, int ret =3D -1; qemuDomainObjPrivatePtr priv =3D vm->privateData; bool blockdev =3D virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV); - g_autoptr(virJSONValue) actions =3D NULL; + g_autoptr(virJSONValue) bitmapactions =3D NULL; g_autoptr(virJSONValue) reopenactions =3D NULL; if (job->state !=3D QEMU_BLOCKJOB_STATE_READY) { @@ -17352,9 +17352,9 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver, bool shallow =3D job->jobflags & VIR_DOMAIN_BLOCK_COPY_SHALLOW; bool reuse =3D job->jobflags & VIR_DOMAIN_BLOCK_COPY_REUSE_EXT; - actions =3D virJSONValueNewArray(); + bitmapactions =3D virJSONValueNewArray(); - if (qemuMonitorTransactionBitmapAdd(actions, + if (qemuMonitorTransactionBitmapAdd(bitmapactions, disk->mirror->nodeformat, "libvirt-tmp-activewrite", false, @@ -17387,9 +17387,9 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver, case QEMU_BLOCKJOB_TYPE_ACTIVE_COMMIT: if (blockdev) { - actions =3D virJSONValueNewArray(); + bitmapactions =3D virJSONValueNewArray(); - if (qemuMonitorTransactionBitmapAdd(actions, + if (qemuMonitorTransactionBitmapAdd(bitmapactions, job->data.commit.base->nod= eformat, "libvirt-tmp-activewrite", false, @@ -17413,8 +17413,8 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver, } } - if (actions && rc =3D=3D 0) - rc =3D qemuMonitorTransaction(priv->mon, &actions); + if (bitmapactions && rc =3D=3D 0) + rc =3D qemuMonitorTransaction(priv->mon, &bitmapactions); if (rc =3D=3D 0) ret =3D qemuMonitorJobComplete(priv->mon, job->name); --=20 2.26.2 From nobody Mon Nov 25 17:52:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1594909521; cv=none; d=zohomail.com; s=zohoarc; b=mFDnFKlK5iAc18Z86Edh9aXxL9FTCg6xIsayhIGuFxP7HEj4sOmer/X3lk7OXL/X4sAkcTPszqididVDvfSqqL4o8VCbItGgagbghzO180D7XvUd6ThK8JFKuTx+EvpcP5uEh/pJzpXCSD746Ka/R7KEEw396OUdGM3kh0ykZnM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594909521; h=Content-Type:Content-Transfer-Encoding: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=Q+gOHTQhhDXxpzMQ5S6v/RRPJk4TEfgVG7ZbPNYEEZs=; b=cx/chFWQnYsy94mrVL6cgToXK+JeaivQ/Wyc1VDdwwWBVNr1jAER3FA7tmY1TVBjxslv9moGiSnPh3FFGqa6K7SSVRdmsY0YK/zRLREn5xLWJ1TqpCBvvl8d1d4dVj0uFRLLq8pF+d77vIH81FkDq1w8pdFfMKaMJ2wi/SEdBrY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1594909521326806.1655519818391; Thu, 16 Jul 2020 07:25:21 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-84-vGdJFAYfOumIdpuTCJdQlQ-1; Thu, 16 Jul 2020 10:25:15 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9BBBC100CD14; Thu, 16 Jul 2020 14:24:42 +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 77B4A70100; Thu, 16 Jul 2020 14:24:42 +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 14FC01809557; Thu, 16 Jul 2020 14:24:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06GEKZZ2028905 for ; Thu, 16 Jul 2020 10:20:35 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7A4306147E; Thu, 16 Jul 2020 14:20:35 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id B78F96179C for ; Thu, 16 Jul 2020 14:20:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594909520; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Q+gOHTQhhDXxpzMQ5S6v/RRPJk4TEfgVG7ZbPNYEEZs=; b=V/eel0GSQmE2pflNHlZgtDBHGtvx/j9g8hTCG2doaY9thOZU6Ryz12QmxU7AOU63BgkdIe rsMAY4AF96jPVj1bW/xFTdFP5uUPx1nmW8ZVbA86R/2pOqzEahwwdObYku1ORmHDT960QI BW+/8IWkkYGxUzqViWTMBNgsu0ESceY= X-MC-Unique: vGdJFAYfOumIdpuTCJdQlQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 5/5] qemuDomainBlockPivot: Ignore failures of creating active layer bitmap Date: Thu, 16 Jul 2020 16:20:22 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Ignore errors from creating "libvirt-tmp-activewrite" bitmap. This prevents failures of finishing blockjobs if the bitmap already exists. Note that if the bitmap exists, the worst case that can happen is that more bits are marked as dirty in the resulting merge. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/qemu/qemu_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 348ef17141..64ddc8dce9 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -17414,7 +17414,7 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver, } if (bitmapactions && rc =3D=3D 0) - rc =3D qemuMonitorTransaction(priv->mon, &bitmapactions); + ignore_value(qemuMonitorTransaction(priv->mon, &bitmapactions)= ); if (rc =3D=3D 0) ret =3D qemuMonitorJobComplete(priv->mon, job->name); --=20 2.26.2