From: Peter Krempa Date: Tue, 11 Oct 2016 13:40:31 +0000 (+0200) Subject: virsh: Fix xpath queries for retrieving vcpu count X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=5e61be54d86350ecff84b1ca52cca601bb8cdedc;p=libvirt.git virsh: Fix xpath queries for retrieving vcpu count The fallback code used if virDomainGetVcpusFlags is not supported used wrong XPath queries and basically did not work at all. Fix them to point to the element instead of which was not present until lately. --- diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 03bf032526..5fdad1b1b1 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -6157,13 +6157,12 @@ virshCPUCountCollect(vshControl *ctl, goto cleanup; if (flags & VIR_DOMAIN_VCPU_MAXIMUM) { - if (virXPathInt("string(/domain/vcpus)", ctxt, &count) < 0) { + if (virXPathInt("string(/domain/vcpu)", ctxt, &count) < 0) { vshError(ctl, "%s", _("Failed to retrieve maximum vcpu count")); goto cleanup; } } else { - if (virXPathInt("string(/domain/vcpus/@current)", - ctxt, &count) < 0) { + if (virXPathInt("string(/domain/vcpu/@current)", ctxt, &count) < 0) { vshError(ctl, "%s", _("Failed to retrieve current vcpu count")); goto cleanup; }