From nobody Mon Feb 9 11:32:17 2026 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 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 1580481243281163.92577453142917; Fri, 31 Jan 2020 06:34:03 -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-38-ov9tIHviOV2vbA0mogo-fg-1; Fri, 31 Jan 2020 09:33:59 -0500 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 A74C08010CB; Fri, 31 Jan 2020 14:33:54 +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 80EB05C3FA; Fri, 31 Jan 2020 14:33:54 +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 3D0A485CE2; Fri, 31 Jan 2020 14:33:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00VEVoeY019823 for ; Fri, 31 Jan 2020 09:31:50 -0500 Received: by smtp.corp.redhat.com (Postfix) id 7E32187B06; Fri, 31 Jan 2020 14:31:50 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id AC24C86C4B; Fri, 31 Jan 2020 14:31:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580481241; 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=vyHNpqn+xNwo9+ZDL0A8nKUV/QQaxL6j4BXlPMhqy4k=; b=UCM+cP5pHEe+1BqlnVR+j05Qyo0HVJo5oFeEuKvGTGr0iDZmZ+K6AjLnTjEXtGKUFp0NmJ dTp/juyetnX7UqfBXQiP6cQePX+Mgcx2622G3MLrVJE09TBtjVXNUJCMKurvEYFWYT7y1C ohwcTrHM9GzUWd9jgQcZlxti3ZQWGTg= From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 13/19] qemu: blockjob: Store 'jobflags' with block job data Date: Fri, 31 Jan 2020 15:31:17 +0100 Message-Id: <021352c4fce6512d3f5af8f04558a93e8ba63fa5.1580480483.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: Peter Krempa 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-MC-Unique: ov9tIHviOV2vbA0mogo-fg-1 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" Add a variable which will store the contents of the 'flags' variable as passed in by the individual block jobs. Since the flags may influence behaviour of the jobs it's important to preserve it to the finalization steps. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_blockjob.h | 3 +++ src/qemu/qemu_domain.c | 7 +++++++ tests/qemustatusxml2xmldata/backup-pull-in.xml | 2 +- tests/qemustatusxml2xmldata/blockjob-blockdev-in.xml | 8 ++++---- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_blockjob.h b/src/qemu/qemu_blockjob.h index 2f29e8209c..9e55382f15 100644 --- a/src/qemu/qemu_blockjob.h +++ b/src/qemu/qemu_blockjob.h @@ -129,6 +129,9 @@ struct _qemuBlockJobData { virStorageSourcePtr chain; /* Reference to the chain the job operates = on. */ virStorageSourcePtr mirrorChain; /* reference to 'mirror' part of the = job */ + unsigned int jobflags; /* per job flags */ + bool jobflagsmissing; /* job flags were not stored */ + union { qemuBlockJobPullData pull; qemuBlockJobCommitData commit; diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 05a8d3de38..0c7a2641ea 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -2582,6 +2582,8 @@ qemuDomainObjPrivateXMLFormatBlockjobIterator(void *p= ayload, virBufferEscapeString(&attrBuf, " newstate=3D'%s'", newstate); if (job->brokentype !=3D QEMU_BLOCKJOB_TYPE_NONE) virBufferEscapeString(&attrBuf, " brokentype=3D'%s'", qemuBlockjob= TypeToString(job->brokentype)); + if (!job->jobflagsmissing) + virBufferAsprintf(&attrBuf, " jobflags=3D'0x%x'", job->jobflags); virBufferEscapeString(&childBuf, "%s", job->errmsg); if (job->disk) { @@ -3294,6 +3296,7 @@ qemuDomainObjPrivateXMLParseBlockjobData(virDomainObj= Ptr vm, int newstate =3D -1; bool invalidData =3D false; xmlNodePtr tmp; + unsigned long jobflags =3D 0; ctxt->node =3D node; @@ -3333,6 +3336,9 @@ qemuDomainObjPrivateXMLParseBlockjobData(virDomainObj= Ptr vm, STRNEQ(mirror, "yes")) invalidData =3D true; + if (virXPathULongHex("string(./@jobflags)", ctxt, &jobflags) !=3D 0) + job->jobflagsmissing =3D true; + if (!disk && !invalidData) { if ((tmp =3D virXPathNode("./chains/disk", ctxt)) && !(job->chain =3D qemuDomainObjPrivateXMLParseBlockjobChain(tmp= , ctxt, xmlopt))) @@ -3352,6 +3358,7 @@ qemuDomainObjPrivateXMLParseBlockjobData(virDomainObj= Ptr vm, job->state =3D state; job->newstate =3D newstate; + job->jobflags =3D jobflags; job->errmsg =3D virXPathString("string(./errmsg)", ctxt); job->invalidData =3D invalidData; job->disk =3D disk; diff --git a/tests/qemustatusxml2xmldata/backup-pull-in.xml b/tests/qemusta= tusxml2xmldata/backup-pull-in.xml index 3c69c41840..1db978a3ac 100644 --- a/tests/qemustatusxml2xmldata/backup-pull-in.xml +++ b/tests/qemustatusxml2xmldata/backup-pull-in.xml @@ -235,7 +235,7 @@ - + diff --git a/tests/qemustatusxml2xmldata/blockjob-blockdev-in.xml b/tests/q= emustatusxml2xmldata/blockjob-blockdev-in.xml index b5d62fd4ab..ca6d110179 100644 --- a/tests/qemustatusxml2xmldata/blockjob-blockdev-in.xml +++ b/tests/qemustatusxml2xmldata/blockjob-blockdev-in.xml @@ -261,19 +261,19 @@ - + - + - + - + --=20 2.24.1