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

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

 




On 02/21/2018 01:11 PM, Michal Privoznik wrote:
> Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
> ---
>  src/qemu/qemu_domain.c | 16 ++++++++++++++++
>  src/qemu/qemu_domain.h |  2 ++
>  2 files changed, 18 insertions(+)
> 

This seems reasonable...  Although given the next patch and usage of
"daemon*s*" I'd almost expect this to be an array of prPid; otherwise,
plurality in the subsequent patch really don't make sense.

John

> 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)
>  
>      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;
>  }
>  
>  
> @@ -2172,6 +2175,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;
>  }
>  
> @@ -2318,6 +2326,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;
> @@ -2524,6 +2533,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) \
> 

--
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