[PATCH 03/11] maint: fix comma style issues: xen

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

 



Most of our code base uses space after comma but not before;
fix the remaining uses before adding a syntax check.

* src/libxl/libxl_driver.c: Consistently use commas.
* src/xen/xend_internal.c: Likewise.
* src/xen/xs_internal.c: Likewise.
* src/xenapi/xenapi_driver.c: Likewise.
* src/xenapi/xenapi_utils.c: Likewise.
* src/xenxs/xen_sxpr.c: Likewise.
* src/xenxs/xen_xm.c: Likewise.

Signed-off-by: Eric Blake <eblake@xxxxxxxxxx>
---
 src/libxl/libxl_driver.c   |  2 +-
 src/xen/xend_internal.c    |  2 +-
 src/xen/xs_internal.c      |  4 ++--
 src/xenapi/xenapi_driver.c | 10 +++++-----
 src/xenapi/xenapi_utils.c  | 30 +++++++++++++++---------------
 src/xenxs/xen_sxpr.c       |  2 +-
 src/xenxs/xen_xm.c         |  2 +-
 7 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index 7a75a04..1b42f14 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -1501,7 +1501,7 @@ libxlDomainDestroyFlags(virDomainPtr dom,
         goto cleanup;
     }

-    event = virDomainEventNewFromObj(vm,VIR_DOMAIN_EVENT_STOPPED,
+    event = virDomainEventNewFromObj(vm, VIR_DOMAIN_EVENT_STOPPED,
                                      VIR_DOMAIN_EVENT_STOPPED_DESTROYED);

     if (libxlVmReap(driver, vm, VIR_DOMAIN_SHUTOFF_DESTROYED) != 0) {
diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c
index dc57350..dac9a79 100644
--- a/src/xen/xend_internal.c
+++ b/src/xen/xend_internal.c
@@ -549,7 +549,7 @@ xend_op(virConnectPtr xend, const char *name, const char *key, ...)
  * Returns a parsed S-Expression in case of success, NULL in case of failure
  */
 static struct sexpr *sexpr_get(virConnectPtr xend, const char *fmt, ...)
-  ATTRIBUTE_FMT_PRINTF(2,3);
+  ATTRIBUTE_FMT_PRINTF(2, 3);

 static struct sexpr *
 sexpr_get(virConnectPtr xend, const char *fmt, ...)
diff --git a/src/xen/xs_internal.c b/src/xen/xs_internal.c
index 4368f85..9748a77 100644
--- a/src/xen/xs_internal.c
+++ b/src/xen/xs_internal.c
@@ -815,7 +815,7 @@ retry:
     if (new_domain_cnt < 0)
         return -1;

-    if (VIR_ALLOC_N(new_domids,new_domain_cnt) < 0)
+    if (VIR_ALLOC_N(new_domids, new_domain_cnt) < 0)
         return -1;
     nread = xenStoreDoListDomains(conn, priv, new_domids, new_domain_cnt);
     if (nread != new_domain_cnt) {
@@ -898,7 +898,7 @@ retry:
     if (new_domain_cnt < 0)
         return -1;

-    if (VIR_ALLOC_N(new_domids,new_domain_cnt) < 0)
+    if (VIR_ALLOC_N(new_domids, new_domain_cnt) < 0)
         return -1;
     nread = xenStoreDoListDomains(conn, priv, new_domids, new_domain_cnt);
     if (nread != new_domain_cnt) {
diff --git a/src/xenapi/xenapi_driver.c b/src/xenapi/xenapi_driver.c
index 5a798e7..2c6fdce 100644
--- a/src/xenapi/xenapi_driver.c
+++ b/src/xenapi/xenapi_driver.c
@@ -1,6 +1,6 @@
 /*
  * xenapi_driver.c: Xen API driver.
- * Copyright (C) 2011-2012 Red Hat, Inc.
+ * Copyright (C) 2011-2013 Red Hat, Inc.
  * Copyright (C) 2009, 2010 Citrix Ltd.
  *
  * This library is free software; you can redistribute it and/or
@@ -637,7 +637,7 @@ xenapiDomainLookupByUUID(virConnectPtr conn,
     char uuidStr[VIR_UUID_STRING_BUFLEN];
     virDomainPtr domP = NULL;
     xen_session *session = ((struct _xenapiPrivate *)(conn->privateData))->session;
-    virUUIDFormat(uuid,uuidStr);
+    virUUIDFormat(uuid, uuidStr);
     if (xen_vm_get_by_uuid(session, &vm, uuidStr)) {
         xen_vm_get_record(session, &record, vm);
         if (record != NULL) {
@@ -1393,7 +1393,7 @@ xenapiDomainGetXMLDesc(virDomainPtr dom, unsigned int flags)
     if (VIR_STRDUP(defPtr->name, dom->name) < 0)
         goto error;
     xen_vm_get_hvm_boot_policy(session, &boot_policy, vm);
-    if (STREQ(boot_policy,"BIOS order")) {
+    if (STREQ(boot_policy, "BIOS order")) {
         if (VIR_STRDUP(defPtr->os.type, "hvm") < 0) {
             VIR_FREE(boot_policy);
             goto error;
@@ -2019,7 +2019,7 @@ write_func(void *ptr, size_t size, size_t nmemb, void *comms_)
     size_t n = size * nmemb;
 #ifdef PRINT_XML
     printf("\n\n---Result from server -----------------------\n");
-    printf("%s\n",((char*) ptr));
+    printf("%s\n", (char*) ptr);
     fflush(stdout);
 #endif
     return (size_t) (comms->func(ptr, n, comms->handle) ? n : 0);
@@ -2036,7 +2036,7 @@ call_func(const void *data, size_t len, void *user_handle,
     struct _xenapiPrivate *priv = (struct _xenapiPrivate *)user_handle;
 #ifdef PRINT_XML
     printf("\n\n---Data to server: -----------------------\n");
-    printf("%s\n",((char*) data));
+    printf("%s\n", (char*) data);
     fflush(stdout);
 #endif
     CURL *curl = curl_easy_init();
diff --git a/src/xenapi/xenapi_utils.c b/src/xenapi/xenapi_utils.c
index 02d4885..427fc21 100644
--- a/src/xenapi/xenapi_utils.c
+++ b/src/xenapi/xenapi_utils.c
@@ -1,6 +1,6 @@
 /*
  * xenapi_utils.c: Xen API driver -- utils parts.
- * Copyright (C) 2011-2012 Red Hat, Inc.
+ * Copyright (C) 2011-2013 Red Hat, Inc.
  * Copyright (C) 2009, 2010 Citrix Ltd.
  *
  * This library is free software; you can redistribute it and/or
@@ -172,7 +172,7 @@ createXenAPIBootOrderString(int nboot, int *bootDevs)
         else if (bootDevs[i] == VIR_DOMAIN_BOOT_NET)
             val = (char *)"n";
         if (val)
-            virBufferEscapeString(&ret,"%s",val);
+            virBufferEscapeString(&ret, "%s", val);
     }
     return virBufferContentAndReset(&ret);
 }
@@ -231,20 +231,20 @@ xenapiCrashExitEnum2virDomainLifecycle(enum xen_on_crash_behaviour action)
 int
 getStorageVolumeType(char *type)
 {
-    if (STREQ(type,"lvmoiscsi") ||
-        STREQ(type,"lvmohba") ||
-        STREQ(type,"lvm") ||
-        STREQ(type,"file") ||
-        STREQ(type,"iso") ||
-        STREQ(type,"ext") ||
-        STREQ(type,"nfs"))
+    if (STREQ(type, "lvmoiscsi") ||
+        STREQ(type, "lvmohba") ||
+        STREQ(type, "lvm") ||
+        STREQ(type, "file") ||
+        STREQ(type, "iso") ||
+        STREQ(type, "ext") ||
+        STREQ(type, "nfs"))
         return (int)VIR_STORAGE_VOL_FILE;
-    else if (STREQ(type,"iscsi") ||
-             STREQ(type,"equal") ||
-             STREQ(type,"hba") ||
-             STREQ(type,"cslg") ||
-             STREQ(type,"udev") ||
-             STREQ(type,"netapp"))
+    else if (STREQ(type, "iscsi") ||
+             STREQ(type, "equal") ||
+             STREQ(type, "hba") ||
+             STREQ(type, "cslg") ||
+             STREQ(type, "udev") ||
+             STREQ(type, "netapp"))
         return (int)VIR_STORAGE_VOL_BLOCK;
     return -1;
 }
diff --git a/src/xenxs/xen_sxpr.c b/src/xenxs/xen_sxpr.c
index d23a3ca..d514725 100644
--- a/src/xenxs/xen_sxpr.c
+++ b/src/xenxs/xen_sxpr.c
@@ -2257,7 +2257,7 @@ xenFormatSxpr(virConnectPtr conn,
         if (hvm &&
             def->os.loader == NULL) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
-                           "%s",_("no HVM domain loader"));
+                           "%s", _("no HVM domain loader"));
             goto error;
         }

diff --git a/src/xenxs/xen_xm.c b/src/xenxs/xen_xm.c
index 88374f4..5e89876 100644
--- a/src/xenxs/xen_xm.c
+++ b/src/xenxs/xen_xm.c
@@ -1891,7 +1891,7 @@ virConfPtr xenFormatXM(virConnectPtr conn,
     netVal->list = NULL;

     for (i = 0; i < def->nnets; i++) {
-        if (xenFormatXMNet(conn, netVal,def->nets[i],
+        if (xenFormatXMNet(conn, netVal, def->nets[i],
                            hvm, xendConfigVersion) < 0)
             goto cleanup;
     }
-- 
1.8.3.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]