On 03/23/2015 06:10 PM, Peter Krempa wrote:
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(a)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.
Yes, i just didn't know how to describe it in a right way when i wrote
this :)
> 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.
Thanks for your review.
Peter
Luyao