From nobody Mon Dec 15 23:04:00 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 1519236751043234.80891794038052; Wed, 21 Feb 2018 10:12:31 -0800 (PST) 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 10B762C2848; Wed, 21 Feb 2018 18:12:29 +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 7B5A960CA3; Wed, 21 Feb 2018 18:12:27 +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 3878F18033F5; Wed, 21 Feb 2018 18:12:27 +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 w1LIBobf026273 for ; Wed, 21 Feb 2018 13:11:50 -0500 Received: by smtp.corp.redhat.com (Postfix) id 35BF910A971D; Wed, 21 Feb 2018 18:11:50 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.192]) by smtp.corp.redhat.com (Postfix) with ESMTP id B4D5710A971B; Wed, 21 Feb 2018 18:11:49 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Wed, 21 Feb 2018 19:11:33 +0100 Message-Id: <1265a40745795d7931792df4704c7a22e0e3b6ec.1519235042.git.mprivozn@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Cc: pbonzini@redhat.com Subject: [libvirt] [PATCH v2 08/12] qemu_domain: Track pr-helper PID 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.38]); Wed, 21 Feb 2018 18:12:29 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Michal Privoznik --- src/qemu/qemu_domain.c | 16 ++++++++++++++++ src/qemu/qemu_domain.h | 2 ++ 2 files changed, 18 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 45205fd03..f7da62dba 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -1864,6 +1864,7 @@ qemuDomainObjPrivateAlloc(void *opaque) =20 priv->migMaxBandwidth =3D QEMU_DOMAIN_MIG_BANDWIDTH_MAX; priv->driver =3D opaque; + priv->prPid =3D (pid_t) -1; =20 return priv; =20 @@ -1926,6 +1927,8 @@ qemuDomainObjPrivateDataClear(qemuDomainObjPrivatePtr= priv) =20 virBitmapFree(priv->migrationCaps); priv->migrationCaps =3D NULL; + + priv->prPid =3D (pid_t) -1; } =20 =20 @@ -2172,6 +2175,11 @@ qemuDomainObjPrivateXMLFormat(virBufferPtr buf, if (qemuDomainObjPrivateXMLFormatBlockjobs(buf, vm) < 0) return -1; =20 + if (priv->prPid !=3D (pid_t) -1) { + virBufferAsprintf(buf, "%lld\n", + (long long) priv->prPid); + } + return 0; } =20 @@ -2318,6 +2326,7 @@ qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, xmlNodePtr *nodes =3D NULL; xmlNodePtr node =3D NULL; virQEMUCapsPtr qemuCaps =3D NULL; + long long prPid =3D -1; =20 if (VIR_ALLOC(priv->monConfig) < 0) goto error; @@ -2524,6 +2533,13 @@ qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, if (qemuDomainObjPrivateXMLParseBlockjobs(priv, ctxt) < 0) goto error; =20 + if (virXPathLongLong("string(./prPid)", ctxt, &prPid) < -1) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("unable to parse ")); + goto error; + } + priv->prPid =3D (pid_t) prPid; + return 0; =20 error: diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index b9258eb8e..418b47153 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -342,6 +342,8 @@ struct _qemuDomainObjPrivate { /* Migration capabilities. Rechecked on reconnect, not to be saved in * private XML. */ virBitmapPtr migrationCaps; + + pid_t prPid; }; =20 # define QEMU_DOMAIN_PRIVATE(vm) \ --=20 2.16.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list