[PATCH v3 08/12] qemu_domain: Track pr-helper PID in status XML

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 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)
 
     priv->migMaxBandwidth = QEMU_DOMAIN_MIG_BANDWIDTH_MAX;
     priv->driver = opaque;
+    priv->prPid = (pid_t) -1;
 
     return priv;
 
@@ -1926,6 +1927,8 @@ qemuDomainObjPrivateDataClear(qemuDomainObjPrivatePtr priv)
 
     virBitmapFree(priv->migrationCaps);
     priv->migrationCaps = NULL;
+
+    priv->prPid = (pid_t) -1;
 }
 
 
@@ -2182,6 +2185,11 @@ qemuDomainObjPrivateXMLFormat(virBufferPtr buf,
     if (qemuDomainObjPrivateXMLFormatBlockjobs(buf, vm) < 0)
         return -1;
 
+    if (priv->prPid != (pid_t) -1) {
+        virBufferAsprintf(buf, "<prPid>%lld</prPid>\n",
+                          (long long) priv->prPid);
+    }
+
     return 0;
 }
 
@@ -2390,6 +2398,7 @@ qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt,
     xmlNodePtr *nodes = NULL;
     xmlNodePtr node = NULL;
     virQEMUCapsPtr qemuCaps = NULL;
+    long long prPid = -1;
 
     if (VIR_ALLOC(priv->monConfig) < 0)
         goto error;
@@ -2552,6 +2561,13 @@ qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt,
     if (qemuDomainObjPrivateXMLParseBlockjobs(priv, ctxt) < 0)
         goto error;
 
+    if (virXPathLongLong("string(./prPid)", ctxt, &prPid) < -1) {
+        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                       _("unable to parse <prPid/>"));
+        goto error;
+    }
+    priv->prPid = (pid_t) prPid;
+
     return 0;
 
  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;
 };
 
 # define QEMU_DOMAIN_PRIVATE(vm) \
-- 
2.16.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux