[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v4 17/17] libxl: Coding Style cleanups to libxl_dom.c



This file had a rash of spaces and assignments inside if expressions.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Cc: Ian Jackson <ian.jackson@xxxxxxxxxx>
---
 tools/libxl/libxl_dom.c |   45 +++++++++++++++++++++++++++++----------------
 1 file changed, 29 insertions(+), 16 deletions(-)

diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 6351ebd..227f7b9 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -353,26 +353,30 @@ int libxl__build_pv(libxl__gc *gc, uint32_t domid,
         ret = xc_dom_kernel_mem(dom,
                                 state->pv_kernel.data,
                                 state->pv_kernel.size);
-        if ( ret != 0) {
+        if (ret != 0) {
             LOGE(ERROR, "xc_dom_kernel_mem failed");
             goto out;
         }
     } else {
         ret = xc_dom_kernel_file(dom, state->pv_kernel.path);
-        if ( ret != 0) {
+        if (ret != 0) {
             LOGE(ERROR, "xc_dom_kernel_file failed");
             goto out;
         }
     }
 
-    if ( state->pv_ramdisk.path && strlen(state->pv_ramdisk.path) ) {
+    if (state->pv_ramdisk.path && strlen(state->pv_ramdisk.path)) {
         if (state->pv_ramdisk.mapped) {
-            if ( (ret = xc_dom_ramdisk_mem(dom, state->pv_ramdisk.data, 
state->pv_ramdisk.size)) != 0 ) {
+            ret = xc_dom_ramdisk_mem(dom,
+                                     state->pv_ramdisk.data,
+                                     state->pv_ramdisk.size);
+            if (ret != 0) {
                 LOGE(ERROR, "xc_dom_ramdisk_mem failed");
                 goto out;
             }
         } else {
-            if ( (ret = xc_dom_ramdisk_file(dom, state->pv_ramdisk.path)) != 0 
) {
+            ret = xc_dom_ramdisk_file(dom, state->pv_ramdisk.path);
+            if (ret != 0) {
                 LOGE(ERROR, "xc_dom_ramdisk_file failed");
                 goto out;
             }
@@ -386,41 +390,50 @@ int libxl__build_pv(libxl__gc *gc, uint32_t domid,
     dom->xenstore_domid = state->store_domid;
     dom->claim_enabled = libxl_defbool_val(info->claim_mode);
 
-    if ( (ret = xc_dom_boot_xen_init(dom, ctx->xch, domid)) != 0 ) {
+    ret = xc_dom_boot_xen_init(dom, ctx->xch, domid);
+    if (ret != 0) {
         LOGE(ERROR, "xc_dom_boot_xen_init failed");
         goto out;
     }
 #ifdef GUEST_RAM_BASE
-    if ( (ret = xc_dom_rambase_init(dom, GUEST_RAM_BASE)) != 0 ) {
+    ret = xc_dom_rambase_init(dom, GUEST_RAM_BASE);
+    if (ret != 0) {
         LOGE(ERROR, "xc_dom_rambase failed");
         goto out;
     }
 #endif
-    if ( (ret = xc_dom_parse_image(dom)) != 0 ) {
+    ret = xc_dom_parse_image(dom);
+    if (ret != 0) {
         LOGE(ERROR, "xc_dom_parse_image failed");
         goto out;
     }
-    if ( (ret = libxl__arch_domain_configure(gc, info, dom)) != 0 ) {
+    ret = libxl__arch_domain_configure(gc, info, dom);
+    if (ret != 0) {
         LOGE(ERROR, "libxl__arch_domain_configure failed");
         goto out;
     }
-    if ( (ret = xc_dom_mem_init(dom, info->target_memkb / 1024)) != 0 ) {
+    ret = xc_dom_mem_init(dom, info->target_memkb / 1024);
+    if (ret != 0) {
         LOGE(ERROR, "xc_dom_mem_init failed");
         goto out;
     }
-    if ( (ret = xc_dom_boot_mem_init(dom)) != 0 ) {
+    ret = xc_dom_boot_mem_init(dom);
+    if (ret != 0) {
         LOGE(ERROR, "xc_dom_boot_mem_init failed");
         goto out;
     }
-    if ( (ret = xc_dom_build_image(dom)) != 0 ) {
+    ret = xc_dom_build_image(dom);
+    if (ret != 0) {
         LOGE(ERROR, "xc_dom_build_image failed");
         goto out;
     }
-    if ( (ret = xc_dom_boot_image(dom)) != 0 ) {
+    ret = xc_dom_boot_image(dom);
+    if (ret != 0) {
         LOGE(ERROR, "xc_dom_boot_image failed");
         goto out;
     }
-    if ( (ret = xc_dom_gnttab_init(dom)) != 0 ) {
+    ret = xc_dom_gnttab_init(dom);
+    if (ret != 0) {
         LOGE(ERROR, "xc_dom_gnttab_init failed");
         goto out;
     }
@@ -1393,7 +1406,7 @@ void libxl__xc_domain_save_done(libxl__egc *egc, void 
*dss_void,
                          dss->guest_responded ?
                          "domain responded to suspend request" :
                          "domain did not respond to suspend request");
-        if ( !dss->guest_responded )
+        if (!dss->guest_responded)
             rc = ERROR_GUEST_TIMEDOUT;
         else
             rc = ERROR_FAIL;
@@ -1648,7 +1661,7 @@ err:
     if (fd>=0) close(fd);
 
     errno = e;
-    if ( rc )
+    if (rc)
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "cannot write %s for %s",
                  newfilename, filename);
 out:
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.