From nobody Tue Sep 9 07:12:11 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1522853367373508.4309109949053; Wed, 4 Apr 2018 07:49:27 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id A52DD13A4E; Wed, 4 Apr 2018 14:49:25 +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 DD6EF8270D; Wed, 4 Apr 2018 14:49:24 +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 5991218523CD; Wed, 4 Apr 2018 14:49:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w34Eg6UI020212 for ; Wed, 4 Apr 2018 10:42:08 -0400 Received: by smtp.corp.redhat.com (Postfix) id C2318215CDCA; Wed, 4 Apr 2018 14:42:08 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 69574215CDC6 for ; Wed, 4 Apr 2018 14:42:08 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 5867C104657; Wed, 4 Apr 2018 16:42:02 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Wed, 4 Apr 2018 16:41:55 +0200 Message-Id: <968a4c4133c681f24f0e065db591b427acf87ba9.1522852108.git.jdenemar@redhat.com> In-Reply-To: References: In-Reply-To: References: Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 66/68] qemu: Store API flags for async jobs in 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 04 Apr 2018 14:49:26 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This will help us decide what to do when libvirtd is restarted while an async job is running. Signed-off-by: Jiri Denemark --- src/qemu/qemu_domain.c | 8 + .../migration-out-nbd-out.xml | 450 +++++++++++++++++- 2 files changed, 457 insertions(+), 1 deletion(-) mode change 120000 =3D> 100644 tests/qemustatusxml2xmldata/migration-out-n= bd-out.xml diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 2a15eb273b..704f395c24 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -2087,6 +2087,9 @@ qemuDomainObjPrivateXMLFormatJob(virBufferPtr buf, priv->job.phase)= ); } =20 + if (priv->job.asyncJob !=3D QEMU_ASYNC_JOB_NONE) + virBufferAsprintf(&attrBuf, " flags=3D'0x%lx'", priv->job.apiFlags= ); + if (priv->job.asyncJob =3D=3D QEMU_ASYNC_JOB_MIGRATION_OUT) { size_t i; virDomainDiskDefPtr disk; @@ -2382,6 +2385,11 @@ qemuDomainObjPrivateXMLParseJob(virDomainObjPtr vm, } } =20 + if (virXPathULongHex("string(@flags)", ctxt, &priv->job.apiFlags) =3D= =3D -2) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid job flags"= )); + goto cleanup; + } + if ((n =3D virXPathNodeSet("./disk[@migrating=3D'yes']", ctxt, &nodes)= ) < 0) goto cleanup; =20 diff --git a/tests/qemustatusxml2xmldata/migration-out-nbd-out.xml b/tests/= qemustatusxml2xmldata/migration-out-nbd-out.xml deleted file mode 120000 index a4830f04a8..0000000000 --- a/tests/qemustatusxml2xmldata/migration-out-nbd-out.xml +++ /dev/null @@ -1 +0,0 @@ -migration-out-nbd-in.xml \ No newline at end of file diff --git a/tests/qemustatusxml2xmldata/migration-out-nbd-out.xml b/tests/= qemustatusxml2xmldata/migration-out-nbd-out.xml new file mode 100644 index 0000000000..05da1f81c6 --- /dev/null +++ b/tests/qemustatusxml2xmldata/migration-out-nbd-out.xml @@ -0,0 +1,449 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + upstream + dcf47dbd-46d1-4d5b-b442-262a806a333a + 1024000 + 1024000 + + + + 8 + + + + + /machine + + + hvm + + + + + + + + + + + + + + + + + + + destroy + restart + restart + + + + + + /usr/bin/qemu-system-x86_64 + + + + + + + + base.qcow2 + + + + + + +
+ + + + + + + + + +
+ + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + + + +
+ + + +
+ + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ + + + + + + + + + + + + +
+ +