From nobody Mon Feb 9 13:35:31 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; 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 207.211.31.81 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=1575995171; cv=none; d=zohomail.com; s=zohoarc; b=gT3aZGN8Ky1aL4DT5iF5wI+NoZ+fLkx979p7niEoEvus7KNla+rcUxdtAtr++iCiT35Vw74/3RQj9hQeb4SRXibtKRP3qloxoP+4Vqz9AiZhsTazlaHiRaeET9FzVFUuu05+ickJ1Q+h3Yqkm/ICGP7YEz9VZAa10d0a68Ap2LE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1575995171; 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=YeGa1o83RI2euCyeV4NWueLedO862qrEJlWF3ogZdCM=; b=IqFTZvtmXYKl2qfT4/ByIFr6r7yiTPgf1/h80urBZaEqqRyEvQzTjsQUk0B4TgRaXtO3+/ef07SrYWpzk43DfsHqFbPMjBL6QL/3EhX1/QnrzCFYeb/UhrS3nLl1hcmKLC3X952xlEgNzu05aWWY/9Q6iiKYoVABYuz09kOQYPg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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 [207.211.31.81]) by mx.zohomail.com with SMTPS id 1575995171462952.1319774724709; Tue, 10 Dec 2019 08:26:11 -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-343-VqVu03P3PJ28-rkTy4MYWQ-1; Tue, 10 Dec 2019 11:26:08 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 62DDC477; Tue, 10 Dec 2019 16:25:58 +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 33B025D9C5; Tue, 10 Dec 2019 16:25:58 +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 C01BB8356C; Tue, 10 Dec 2019 16:25:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xBAGPn1x006221 for ; Tue, 10 Dec 2019 11:25:49 -0500 Received: by smtp.corp.redhat.com (Postfix) id 3537819486; Tue, 10 Dec 2019 16:25:49 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.43.2.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8A9D419C6A; Tue, 10 Dec 2019 16:25:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575995170; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=YeGa1o83RI2euCyeV4NWueLedO862qrEJlWF3ogZdCM=; b=JYTI3kCI1ME5E4vZTlRMs4xI7bFKWzjKlKmZwBi2GdxYbBSmbU3aEz95Uv5ywC1GkHEDVZ JWiyjhjZnNyLY3w0M36EiFLw/l8ijHfngIpIH+rUC2An5J+P+C7qtJcy7kFIZ+VUmAwg9d iFLlaDNaebTjiAr8UkOpaiH3CL/ubGU= From: Pavel Mores To: libvir-list@redhat.com Date: Tue, 10 Dec 2019 17:25:40 +0100 Message-Id: <20191210162541.15432-4-pmores@redhat.com> In-Reply-To: <20191210162541.15432-1-pmores@redhat.com> References: <20191210162541.15432-1-pmores@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Pavel Mores Subject: [libvirt] [PATCH v4 3/4] qemu: block: store the delete flag in libvirtd's status XML 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.14 X-MC-Unique: VqVu03P3PJ28-rkTy4MYWQ-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Since blockcommit is asynchronous, libvirtd can be restarted while the operation runs. To ensure the information necessary to finish up the job is not lost, serialisation to and deserialisation from the status XML is added. To unittest this, the new element was only added to the active commit test, the non-active commit test doesn't have the new element so as to test its absence. Signed-off-by: Pavel Mores Reviewed-by: Peter Krempa --- src/qemu/qemu_domain.c | 4 ++++ tests/qemustatusxml2xmldata/blockjob-blockdev-in.xml | 1 + 2 files changed, 5 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 767790bfc0..27926c7670 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -2586,6 +2586,8 @@ qemuDomainObjPrivateXMLFormatBlockjobIterator(void *p= ayload, virBufferAsprintf(&childBuf, "\n", job->= data.commit.top->nodeformat); if (job->data.commit.topparent) virBufferAsprintf(&childBuf, "\n",= job->data.commit.topparent->nodeformat); + if (job->data.commit.deleteCommittedImages) + virBufferAddLit(&childBuf, "\n"); break; =20 case QEMU_BLOCKJOB_TYPE_CREATE: @@ -3185,6 +3187,8 @@ qemuDomainObjPrivateXMLParseBlockjobDataSpecific(qemu= BlockJobDataPtr job, "string(./base/@n= ode)", &job->data.commit= .base, ctxt); + if (virXPathNode("./deleteCommittedImages", ctxt)) + job->data.commit.deleteCommittedImages =3D true; if (!job->data.commit.top || !job->data.commit.base) goto broken; diff --git a/tests/qemustatusxml2xmldata/blockjob-blockdev-in.xml b/tests/q= emustatusxml2xmldata/blockjob-blockdev-in.xml index 67ab099bd9..b5d62fd4ab 100644 --- a/tests/qemustatusxml2xmldata/blockjob-blockdev-in.xml +++ b/tests/qemustatusxml2xmldata/blockjob-blockdev-in.xml @@ -242,6 +242,7 @@ + --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list