From nobody Mon Feb 9 07:26:57 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1614259816; cv=none; d=zohomail.com; s=zohoarc; b=QdXn/yDTsmif4758LuEgiVjJQShTf3iAABTRiH7jHIm0Rc6/vcv1/+/1n6EtI4QyvDu0KZSHGVNPL+Y87OYiHnrVprJ32CIf9VPqulA264zQPEWCXvqKX7QEzOWRqMadcnasAtjd+HPJXZlgOlBt9LmAKnwm8Zgal4FBd593Wvk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614259816; 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=hv5kDanazz/34o4b+TaUabH+pzo3pQDbaxejYN+Oflo=; b=Vl6NoXDA8OXyCtLaBA1yRrqgFEnUIjgSurxkESMXNxnfy1d+L5PzWKPKsy+3cNWRAmMvyLTN3NvMJTbhK0Skv8iRWrmBUXE6QiMjVcmp1Hao0bBuVU+d9HOYgM47vPuSYUrZD0d4Sj0QJR7Mh9Sp5/FZQi2sHGnOYgePfiCFTdo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 161425981652542.76466443529273; Thu, 25 Feb 2021 05:30:16 -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-41-eS5q8ueYO9uTkGf5YNJvfA-1; Thu, 25 Feb 2021 08:30:11 -0500 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 8F5C8193578E; Thu, 25 Feb 2021 13:30:05 +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 5F9665D6D7; Thu, 25 Feb 2021 13:30:05 +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 1643C58077; Thu, 25 Feb 2021 13:30:05 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 11PDTer1012669 for ; Thu, 25 Feb 2021 08:29:40 -0500 Received: by smtp.corp.redhat.com (Postfix) id A86AB19801; Thu, 25 Feb 2021 13:29:40 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 158841346D for ; Thu, 25 Feb 2021 13:29:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614259815; 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=hv5kDanazz/34o4b+TaUabH+pzo3pQDbaxejYN+Oflo=; b=h4PWSjATz27ArWz6ztzWbUrvhXERRDMJWpc12r31OVXDJOvopo0CQ2OZAdgXCn0z/mpXvp qw8T/rJYRkSRGbIZTM1VHjHDQYVGNLdOymfC8EGkpgodaKrVdqf/Wr9ouweTNRJnawOjVF qLojAKMNzQTnlzFAS7qHN2va5TglQLo= X-MC-Unique: eS5q8ueYO9uTkGf5YNJvfA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 1/2] qemuBackupJobTerminate: Move cleanup of temp files earlier Date: Thu, 25 Feb 2021 14:29:31 +0100 Message-Id: <4b78d5f724aae9d7331691bd352945257a8ccb13.1614259713.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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 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" Upcoming patch will remove unnecessary actions if the VM crashed. The cleanup needs to be performed always, thus needs to be moved earlier. Signed-off-by: Peter Krempa --- src/qemu/qemu_backup.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/qemu/qemu_backup.c b/src/qemu/qemu_backup.c index 423de9c719..d3d98c1d6a 100644 --- a/src/qemu/qemu_backup.c +++ b/src/qemu/qemu_backup.c @@ -560,21 +560,6 @@ qemuBackupJobTerminate(virDomainObjPtr vm, qemuDomainObjPrivatePtr priv =3D vm->privateData; size_t i; - qemuDomainJobInfoUpdateTime(priv->job.current); - - g_clear_pointer(&priv->job.completed, qemuDomainJobInfoFree); - priv->job.completed =3D qemuDomainJobInfoCopy(priv->job.current); - - priv->job.completed->stats.backup.total =3D priv->backup->push_total; - priv->job.completed->stats.backup.transferred =3D priv->backup->push_t= ransferred; - priv->job.completed->stats.backup.tmp_used =3D priv->backup->pull_tmp_= used; - priv->job.completed->stats.backup.tmp_total =3D priv->backup->pull_tmp= _total; - - priv->job.completed->status =3D jobstatus; - priv->job.completed->errmsg =3D g_strdup(priv->backup->errmsg); - - qemuDomainEventEmitJobCompleted(priv->driver, vm); - if (!(priv->job.apiFlags & VIR_DOMAIN_BACKUP_BEGIN_REUSE_EXTERNAL) && (priv->backup->type =3D=3D VIR_DOMAIN_BACKUP_TYPE_PULL || (priv->backup->type =3D=3D VIR_DOMAIN_BACKUP_TYPE_PUSH && @@ -598,6 +583,21 @@ qemuBackupJobTerminate(virDomainObjPtr vm, } } + qemuDomainJobInfoUpdateTime(priv->job.current); + + g_clear_pointer(&priv->job.completed, qemuDomainJobInfoFree); + priv->job.completed =3D qemuDomainJobInfoCopy(priv->job.current); + + priv->job.completed->stats.backup.total =3D priv->backup->push_total; + priv->job.completed->stats.backup.transferred =3D priv->backup->push_t= ransferred; + priv->job.completed->stats.backup.tmp_used =3D priv->backup->pull_tmp_= used; + priv->job.completed->stats.backup.tmp_total =3D priv->backup->pull_tmp= _total; + + priv->job.completed->status =3D jobstatus; + priv->job.completed->errmsg =3D g_strdup(priv->backup->errmsg); + + qemuDomainEventEmitJobCompleted(priv->driver, vm); + virDomainBackupDefFree(priv->backup); priv->backup =3D NULL; qemuDomainObjEndAsyncJob(priv->driver, vm); --=20 2.29.2