提交 5e61be54 编写于 作者: P Peter Krempa

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 <domain> <vcpu> element instead of <vcpus> which was not present
until lately.
上级 be698592
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册