From nobody Mon Feb 9 01:21:55 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 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=1613058064; cv=none; d=zohomail.com; s=zohoarc; b=f7nHggJ71J9dvXgDVQvD7NtGb8W0M1Jpe9Riy3xJ8ySql5mU653AA3XNdWAFRrXfSftU7e321XK/RHciC0c3yW2XEvTCgfaXujV61LqzMkPYa2OxNlMrqPSKDGQcGMTJ9c9B9Uh1IK667ZX6Jw1n3GMaURRHn9kCIE0nsfqcJhs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1613058064; 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=OjRJedBvuAoggNTz0FyXp7XlvB08pHG+oLv8zs9vcvs=; b=nJSpvRY1vkk8S8daoL/dYF7CKRLrNvQmOid6hZaxtFC80lFpwH+pl4Ouzap7xvSDBOE1MEy1PBv8dYN1AfCc0AMZUkxyCh0Mle6pqkGyZHATS6LaR0y3UbTytWteqfBpu4dvSQpDP6WSkmq05DmWrFlpk/DesFbeqXhDJOoBe+Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1613058064365157.34942383332316; Thu, 11 Feb 2021 07:41:04 -0800 (PST) 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-78-uCMbteLNOvW-JXQP7gTLVw-1; Thu, 11 Feb 2021 10:38:50 -0500 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 65C95196634D; Thu, 11 Feb 2021 15:38:41 +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 462BC60BF1; Thu, 11 Feb 2021 15:38:41 +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 0709618077D3; Thu, 11 Feb 2021 15:38:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 11BFcXr4019315 for ; Thu, 11 Feb 2021 10:38:33 -0500 Received: by smtp.corp.redhat.com (Postfix) id AB01B5D6B1; Thu, 11 Feb 2021 15:38:33 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0BEB75D764 for ; Thu, 11 Feb 2021 15:38:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613058063; 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=OjRJedBvuAoggNTz0FyXp7XlvB08pHG+oLv8zs9vcvs=; b=F0BM5jWu8lD6O+8CX79ey2WQp3X0k1dk/yQ9N1rs5GgbWXcc2jaz6ZH+tvGO5qIx+7IIT2 rRQjV89RUmHEwwXd+XiJykrpthPSVLmkP3dTF3HOi0br5rRgD7GQve1exSbo+5NKPnI/iU DxeylXsLEDCXkBoO1i/jmQRjqHS4jqM= X-MC-Unique: uCMbteLNOvW-JXQP7gTLVw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 17/19] qemu: migration: Clean up temporary bitmaps when cancelling a migration Date: Thu, 11 Feb 2021 16:37:56 +0100 Message-Id: <0fca39a42d8e5a3784ebd8664b3cdea3bbc4c20c.1613057278.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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" In case when the block migration job required temporary bitmaps for merging the appropriate checkpoints we need to clean them up when cancelling the job. On success we don't need to do that though as the bitmaps are just temporary thus are not written to disk. Signed-off-by: Peter Krempa Reviewed-by: Jiri Denemark --- src/qemu/qemu_migration.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 37f0d43d24..36424f8493 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -834,6 +834,32 @@ qemuMigrationSrcNBDCopyCancel(virQEMUDriverPtr driver, } +static int +qemuMigrationSrcCancelRemoveTempBitmaps(virDomainObjPtr vm, + qemuDomainAsyncJob asyncJob) +{ + qemuDomainObjPrivatePtr priv =3D vm->privateData; + virQEMUDriverPtr driver =3D priv->driver; + qemuDomainJobPrivatePtr jobPriv =3D priv->job.privateData; + GSList *next; + + if (!jobPriv->migTempBitmaps) + return 0; + + for (next =3D jobPriv->migTempBitmaps; next; next =3D next->next) { + qemuDomainJobPrivateMigrateTempBitmapPtr t =3D next->data; + + if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0) + return -1; + qemuMonitorBitmapRemove(priv->mon, t->nodename, t->bitmapname); + if (qemuDomainObjExitMonitor(driver, vm) < 0) + return -1; + } + + return 0; +} + + static virStorageSourcePtr qemuMigrationSrcNBDStorageCopyBlockdevPrepareSource(virDomainDiskDefPtr di= sk, const char *host, @@ -3999,6 +4025,8 @@ qemuMigrationSrcRun(virQEMUDriverPtr driver, QEMU_ASYNC_JOB_MIGRATION_OUT, dconn); + qemuMigrationSrcCancelRemoveTempBitmaps(vm, QEMU_ASYNC_JOB_MIGRATI= ON_OUT); + if (priv->job.current->status !=3D QEMU_DOMAIN_JOB_STATUS_CANCELED) priv->job.current->status =3D QEMU_DOMAIN_JOB_STATUS_FAILED; } @@ -5701,6 +5729,9 @@ qemuMigrationSrcCancel(virQEMUDriverPtr driver, QEMU_ASYNC_JOB_NONE, NULL) < 0) return -1; + if (qemuMigrationSrcCancelRemoveTempBitmaps(vm, QEMU_ASYNC_JOB_NONE) <= 0) + return -1; + return 0; } --=20 2.29.2