]> xenbits.xensource.com Git - libvirt.git/commitdiff
virsh: domain: Fix broken indentation in virshCPUCountCollect
authorPeter Krempa <pkrempa@redhat.com>
Mon, 3 Oct 2016 14:46:11 +0000 (16:46 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 12 Oct 2016 15:29:07 +0000 (17:29 +0200)
I managed to space most of the code by 5 spaces instead of 4 when
orignally implementing this function.

tools/virsh-domain.c

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