From nobody Wed May 14 13:07:29 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 152345782727687.76446254000325; Wed, 11 Apr 2018 07:43:47 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 176E13130671; Wed, 11 Apr 2018 14:43:46 +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 D65287494E; Wed, 11 Apr 2018 14:43:45 +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 921785BC12; Wed, 11 Apr 2018 14:43:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3BEgHpE008975 for ; Wed, 11 Apr 2018 10:42:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id CE20710B0F38; Wed, 11 Apr 2018 14:42:17 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7575310B0F39 for ; Wed, 11 Apr 2018 14:42:17 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 3F773100D58; Wed, 11 Apr 2018 16:42:11 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Wed, 11 Apr 2018 16:42:01 +0200 Message-Id: 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.3 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 71/73] 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Wed, 11 Apr 2018 14:43:46 +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 Reviewed-by: J=EF=BF=BDn Tomko --- 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 71c3a917c1..8cd00576c8 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 + + + + + + +
+ + + + + + + + + +
+ + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + + + +
+ + + +
+ + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ + + + + + + + + + + + + +
+ +