]> xenbits.xensource.com Git - libvirt.git/commitdiff
libxl: remove unnecessary curly braces
authorJim Fehlig <jfehlig@suse.com>
Wed, 14 Aug 2013 21:33:48 +0000 (15:33 -0600)
committerJim Fehlig <jfehlig@suse.com>
Wed, 14 Aug 2013 22:12:25 +0000 (16:12 -0600)
As per HACKING, remove some unneeded curly braces in the
libxl driver.

src/libxl/libxl_conf.c
src/libxl/libxl_driver.c

index 827dfddd6e04e66001093fef8acd8e4ab8efc306..e18391944ec5ef023328ea60803e0b2a09cd94be 100644 (file)
@@ -246,9 +246,8 @@ libxlMakeCapabilitiesInternal(virArch hostarch,
             /* Search for existing matching (model,hvm) tuple */
             for (i = 0; i < nr_guest_archs; i++) {
                 if ((guest_archs[i].arch == arch) &&
-                    guest_archs[i].hvm == hvm) {
+                    guest_archs[i].hvm == hvm)
                     break;
-                }
             }
 
             /* Too many arch flavours - highly unlikely ! */
@@ -916,21 +915,17 @@ libxlBuildDomainConfig(libxlDriverPrivatePtr driver,
     if (libxlMakeDomCreateInfo(driver, def, &d_config->c_info) < 0)
         return -1;
 
-    if (libxlMakeDomBuildInfo(vm, d_config) < 0) {
+    if (libxlMakeDomBuildInfo(vm, d_config) < 0)
         return -1;
-    }
 
-    if (libxlMakeDiskList(def, d_config) < 0) {
+    if (libxlMakeDiskList(def, d_config) < 0)
         return -1;
-    }
 
-    if (libxlMakeNicList(def, d_config) < 0) {
+    if (libxlMakeNicList(def, d_config) < 0)
         return -1;
-    }
 
-    if (libxlMakeVfbList(driver, def, d_config) < 0) {
+    if (libxlMakeVfbList(driver, def, d_config) < 0)
         return -1;
-    }
 
     d_config->on_reboot = def->onReboot;
     d_config->on_poweroff = def->onPoweroff;
index 9dc72617c06a80ae789b5349f0e5aeee12859dc2..ddd794304f16c51164eab1183ec21e42a417b26d 100644 (file)
@@ -301,13 +301,13 @@ libxlTimeoutRegisterEventHook(void *priv,
     gettimeofday(&now, NULL);
     timersub(&abs_t, &now, &res);
     /* Ensure timeout is not overflowed */
-    if (timercmp(&res, &zero, <)) {
+    if (timercmp(&res, &zero, <))
         timeout = 0;
-    } else if (res.tv_sec > INT_MAX / 1000) {
+    else if (res.tv_sec > INT_MAX / 1000)
         timeout = INT_MAX;
-    } else {
+    else
         timeout = res.tv_sec * 1000 + (res.tv_usec + 999) / 1000;
-    }
+
     info->id = virEventAddTimeout(timeout, libxlTimerCallback,
                                   info, libxlEventHookInfoFree);
     if (info->id < 0) {
@@ -1006,10 +1006,10 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
             virDomainObjAssignDef(vm, def, true, NULL);
             def = NULL;
 
-            if (unlink(managed_save_path) < 0) {
+            if (unlink(managed_save_path) < 0)
                 VIR_WARN("Failed to remove the managed state %s",
                          managed_save_path);
-            }
+
             vm->hasManagedSave = false;
         }
         VIR_FREE(managed_save_path);
@@ -4177,6 +4177,7 @@ libxlNodeGetCellsFreeMemory(virConnectPtr conn,
         else
             freeMems[numCells++] = numa_info[n].free;
     }
+
     ret = numCells;
 
 cleanup:
@@ -4530,11 +4531,10 @@ libxlDomainSetSchedulerParametersFlags(virDomainPtr dom,
     for (i = 0; i < nparams; ++i) {
         virTypedParameterPtr param = &params[i];
 
-        if (STREQ(param->field, VIR_DOMAIN_SCHEDULER_WEIGHT)) {
+        if (STREQ(param->field, VIR_DOMAIN_SCHEDULER_WEIGHT))
             sc_info.weight = params[i].value.ui;
-        } else if (STREQ(param->field, VIR_DOMAIN_SCHEDULER_CAP)) {
+        else if (STREQ(param->field, VIR_DOMAIN_SCHEDULER_CAP))
             sc_info.cap = params[i].value.ui;
-        }
     }
 
     if (libxl_domain_sched_params_set(priv->ctx, dom->id, &sc_info) != 0) {