virsh: domain: Fix broken indentation in virshCPUCountCollect

I managed to space most of the code by 5 spaces instead of 4 when
orignally implementing this function.
This commit is contained in:
Peter Krempa 2016-10-03 16:46:11 +02:00
parent 3507af63ae
commit be69859255

View File

@ -6125,50 +6125,50 @@ virshCPUCountCollect(vshControl *ctl,
return count; return count;
/* fallback code */ /* fallback code */
if (!(last_error->code == VIR_ERR_NO_SUPPORT || if (!(last_error->code == VIR_ERR_NO_SUPPORT ||
last_error->code == VIR_ERR_INVALID_ARG)) last_error->code == VIR_ERR_INVALID_ARG))
goto cleanup; goto cleanup;
if (flags & VIR_DOMAIN_VCPU_GUEST) { if (flags & VIR_DOMAIN_VCPU_GUEST) {
vshError(ctl, "%s", _("Failed to retrieve vCPU count from the guest")); vshError(ctl, "%s", _("Failed to retrieve vCPU count from the guest"));
goto cleanup; goto cleanup;
} }
if (!(flags & (VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG)) && if (!(flags & (VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG)) &&
virDomainIsActive(dom) == 1) virDomainIsActive(dom) == 1)
flags |= VIR_DOMAIN_AFFECT_LIVE; flags |= VIR_DOMAIN_AFFECT_LIVE;
vshResetLibvirtError(); vshResetLibvirtError();
if (flags & VIR_DOMAIN_AFFECT_LIVE) { if (flags & VIR_DOMAIN_AFFECT_LIVE) {
if (flags & VIR_DOMAIN_VCPU_MAXIMUM) { if (flags & VIR_DOMAIN_VCPU_MAXIMUM) {
count = virDomainGetMaxVcpus(dom); count = virDomainGetMaxVcpus(dom);
} else { } else {
if (virDomainGetInfo(dom, &info) < 0) if (virDomainGetInfo(dom, &info) < 0)
goto cleanup; goto cleanup;
count = info.nrVirtCpu; count = info.nrVirtCpu;
} }
} else { } else {
if (!(def = virDomainGetXMLDesc(dom, VIR_DOMAIN_XML_INACTIVE))) if (!(def = virDomainGetXMLDesc(dom, VIR_DOMAIN_XML_INACTIVE)))
goto cleanup; goto cleanup;
if (!(xml = virXMLParseStringCtxt(def, _("(domain_definition)"), &ctxt))) if (!(xml = virXMLParseStringCtxt(def, _("(domain_definition)"), &ctxt)))
goto cleanup; goto cleanup;
if (flags & VIR_DOMAIN_VCPU_MAXIMUM) { if (flags & VIR_DOMAIN_VCPU_MAXIMUM) {
if (virXPathInt("string(/domain/vcpus)", ctxt, &count) < 0) { if (virXPathInt("string(/domain/vcpus)", ctxt, &count) < 0) {
vshError(ctl, "%s", _("Failed to retrieve maximum vcpu count")); vshError(ctl, "%s", _("Failed to retrieve maximum vcpu count"));
goto cleanup; goto cleanup;
} }
} else { } else {
if (virXPathInt("string(/domain/vcpus/@current)", if (virXPathInt("string(/domain/vcpus/@current)",
ctxt, &count) < 0) { ctxt, &count) < 0) {
vshError(ctl, "%s", _("Failed to retrieve current vcpu count")); vshError(ctl, "%s", _("Failed to retrieve current vcpu count"));
goto cleanup; goto cleanup;
} }
} }
} }
ret = count; ret = count;
cleanup: cleanup: