[libvirt] [PATCH] conf: fix running vm numa settings disappear after restart libvirtd

Peter Krempa pkrempa at redhat.com
Mon Mar 23 10:10:00 UTC 2015


On Thu, Mar 19, 2015 at 18:13:04 +0800, Luyao Huang wrote:
> 5bba61f introduce a issue : when start a vm with <numa> settings and
> restart libvirtd, numa settings will disappear. Because when parse the
> vm states file, there is no node in "/domain/cpu/numa" this place.
> 
> Change to use ./cpu/numa instead of /domain/cpu/numa.
> 
> Signed-off-by: Luyao Huang <lhuang at redhat.com>
> ---
>  src/conf/numa_conf.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Indeed the status XML wraps the  <domain> element with another container
element.

> 
> diff --git a/src/conf/numa_conf.c b/src/conf/numa_conf.c
> index b92cb44..c34ba5f 100644
> --- a/src/conf/numa_conf.c
> +++ b/src/conf/numa_conf.c
> @@ -663,10 +663,10 @@ virDomainNumaDefCPUParseXML(virDomainNumaPtr def,
>      int ret = -1;
>  
>      /* check if NUMA definition is present */
> -    if (!virXPathNode("/domain/cpu/numa[1]", ctxt))
> +    if (!virXPathNode("./cpu/numa[1]", ctxt))
>          return 0;
>  
> -    if ((n = virXPathNodeSet("/domain/cpu/numa[1]/cell", ctxt, &nodes)) <= 0) {
> +    if ((n = virXPathNodeSet("./cpu/numa[1]/cell", ctxt, &nodes)) <= 0) {
>          virReportError(VIR_ERR_XML_ERROR, "%s",
>                         _("NUMA topology defined without NUMA cells"));
>          goto cleanup;
> -- 

ACK, I'll push your patch after I figure out how to add tests for
problems like this.

Peter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150323/a6b4e4b7/attachment-0001.sig>


More information about the libvir-list mailing list