From nobody Tue Dec 16 11:08:27 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1673027586; cv=none; d=zohomail.com; s=zohoarc; b=AyaxgZW8NxZbCIzkf9/AeTvCg37fZ433J0SDzdpNVSdfE9amWCnqYhstNsUXKRjv8vnxmkWFfPqKDGfRpEoovoqeW4LafIo+BOj6l6xSkfO+km3Wy6eVYBC3Q2fSMvbOX5PnVae6UGl4QQHM6+ttB2ho2uWY152bwKzThfHqskQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673027586; 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=bOQrHZORnKmH6Od4hrS5B4qXoPWOQiVUKUNNUbYzUBQ=; b=YiGx3Ea4qGCAFwn7/mmP+DbAxZh151Sh+hDKw+h+oUCRlN+wTod1vt+uhmbm/pjgOUPwazjtIUi47Gb7vmV0WgyvprSyKKCdSdiKPjoVphXl7mdzn+DwmNAw9ELRb9YLWB0Fv4lUmGIgUuxedGtQxJOeyjszHuqIvFtbNgwEhJU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 167302758671288.63133120470388; Fri, 6 Jan 2023 09:53:06 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-342-tZspjXDSOoi9yLV6LkSbYQ-1; Fri, 06 Jan 2023 12:52:42 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0E803810BCD; Fri, 6 Jan 2023 17:52:36 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id E306B1121315; Fri, 6 Jan 2023 17:52:35 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id BA8A219459D3; Fri, 6 Jan 2023 17:52:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 284E919459DC for ; Fri, 6 Jan 2023 17:52:33 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 1B74B40C2004; Fri, 6 Jan 2023 17:52:33 +0000 (UTC) Received: from antique-work.redhat.com (ovpn-193-172.brq.redhat.com [10.40.193.172]) by smtp.corp.redhat.com (Postfix) with ESMTP id AD96140C2064 for ; Fri, 6 Jan 2023 17:52:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673027585; 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=bOQrHZORnKmH6Od4hrS5B4qXoPWOQiVUKUNNUbYzUBQ=; b=SHx0OjLXPRRwjluJTyL9okiWubvHYb+4b6L9Go8jQvQy7KnLd4fstRu8a+oOYCCeio7hzD jma46reFQzZq/EK78jHVhP5ZMHhZa142wm6rmRQFy1NnNaeog0VEoQzzoHcIOhTdH+g5g1 UbT74C7MuH9d41i3EAXkToEDeQlDTas= X-MC-Unique: tZspjXDSOoi9yLV6LkSbYQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH v3 28/32] qemu_domain: store snapshotDelete in qemuDomainJobPrivate Date: Fri, 6 Jan 2023 18:52:03 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1673027587276100003 Content-Type: text/plain; charset="utf-8"; x-default="true" When daemon is restarted and libvirt tries to recover domain jobs we need to know if the snapshot job was a snapshot delete in order to safely abort running QEMU block jobs. Signed-off-by: Pavel Hrdina --- src/qemu/qemu_domain.c | 23 +++++++++++++++++++++++ src/qemu/qemu_domain.h | 2 ++ 2 files changed, 25 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 73dc13e178..7be431dd19 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -197,6 +197,15 @@ qemuDomainObjPrivateXMLFormatMigrateTempBitmap(virBuff= er *buf, } =20 =20 +static void +qemuDomainFormatJobPrivateSnapshot(virBuffer *buf, + qemuDomainJobPrivate *priv) +{ + if (priv->snapshotDelete) + virBufferAddLit(buf, "\n"); +} + + static int qemuDomainFormatJobPrivate(virBuffer *buf, virDomainJobObj *job, @@ -214,6 +223,9 @@ qemuDomainFormatJobPrivate(virBuffer *buf, if (priv->migParams) qemuMigrationParamsFormat(buf, priv->migParams); =20 + if (job->asyncJob =3D=3D VIR_ASYNC_JOB_SNAPSHOT) + qemuDomainFormatJobPrivateSnapshot(buf, priv); + return 0; } =20 @@ -340,6 +352,15 @@ qemuDomainObjPrivateXMLParseMigrateTempBitmap(qemuDoma= inJobPrivate *jobPriv, } =20 =20 +static void +qemuDomainParseJobPrivateSnapshot(xmlXPathContextPtr ctxt, + qemuDomainJobPrivate *priv) +{ + if (virXPathNode("./snapshotDelete", ctxt)) + priv->snapshotDelete =3D true; +} + + static int qemuDomainParseJobPrivate(xmlXPathContextPtr ctxt, virDomainJobObj *job, @@ -356,6 +377,8 @@ qemuDomainParseJobPrivate(xmlXPathContextPtr ctxt, if (qemuMigrationParamsParse(ctxt, &priv->migParams) < 0) return -1; =20 + qemuDomainParseJobPrivateSnapshot(ctxt, priv); + return 0; } =20 diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index e34d52c033..4b0593d5db 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -550,6 +550,8 @@ struct _qemuDomainJobPrivate { * should wait for it to finish */ bool spiceMigrated; /* spice migration completed */ bool dumpCompleted; /* dump completed */ + bool snapshotDelete; /* indicate that snapshot job is + * deleting snapshot */ qemuMigrationParams *migParams; GSList *migTempBitmaps; /* temporary block dirty bitmaps - qemuDomain= JobPrivateMigrateTempBitmap */ }; --=20 2.39.0