From nobody Wed May 14 17:09:01 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 1521099445687163.70322349272078; Thu, 15 Mar 2018 00:37:25 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6D8E383F46; Thu, 15 Mar 2018 07:37:24 +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 3E51C60A9E; Thu, 15 Mar 2018 07:37: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 0BBA662D0D; Thu, 15 Mar 2018 07:37:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2EG5xsC012951 for ; Wed, 14 Mar 2018 12:06:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id 19B03AFD56; Wed, 14 Mar 2018 16:05:51 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.192]) by smtp.corp.redhat.com (Postfix) with ESMTP id B3E30AFD54 for ; Wed, 14 Mar 2018 16:05:50 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Wed, 14 Mar 2018 17:05:37 +0100 Message-Id: <466ce784e9d6b756e1fbb4930d660c222b535a3e.1521043392.git.mprivozn@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 15 Mar 2018 07:37:24 +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 d673ddbb2..3e05cf0f8 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 @@ -2182,6 +2185,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 @@ -2390,6 +2398,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; @@ -2552,6 +2561,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