]> xenbits.xensource.com Git - libvirt.git/commitdiff
ESX Whitespace cleanup
authorMatthias Bolte <matthias.bolte@googlemail.com>
Wed, 23 Sep 2009 12:37:26 +0000 (14:37 +0200)
committerDaniel Veillard <veillard@redhat.com>
Wed, 23 Sep 2009 13:00:54 +0000 (15:00 +0200)
src/esx/esx_driver.c
src/esx/esx_util.c
src/esx/esx_util.h
src/esx/esx_vi.c
src/esx/esx_vi_types.c
src/esx/esx_vi_types.h

index aebdf3f8d60adb0f90f3bc2c8d55ca31813fea7e..f9ae9883271f979251f952c20a88159ccd860088 100644 (file)
@@ -752,13 +752,13 @@ esxGetHostname(virConnectPtr conn)
         }
     }
 
-    if (hostName == NULL || strlen (hostName) < 1) {
+    if (hostName == NULL || strlen(hostName) < 1) {
         ESX_ERROR(conn, VIR_ERR_INTERNAL_ERROR,
                   "Missing or empty 'hostName' property");
         goto failure;
     }
 
-    if (domainName == NULL || strlen (domainName) < 1) {
+    if (domainName == NULL || strlen(domainName) < 1) {
         ESX_ERROR(conn, VIR_ERR_INTERNAL_ERROR,
                   "Missing or empty 'domainName' property");
         goto failure;
@@ -800,7 +800,7 @@ esxNodeGetInfo(virConnectPtr conn, virNodeInfoPtr nodeinfo)
     int32_t numaInfo_numNodes = 0;
     char *ptr = NULL;
 
-    memset (nodeinfo, 0, sizeof (virNodeInfo));
+    memset(nodeinfo, 0, sizeof(virNodeInfo));
 
     if (priv->phantom) {
         ESX_ERROR(conn, VIR_ERR_OPERATION_INVALID,
@@ -891,11 +891,11 @@ esxNodeGetInfo(virConnectPtr conn, virNodeInfoPtr nodeinfo)
 
             /* Strip the string to fit more relevant information in 32 chars */
             while (*ptr != '\0') {
-                if (STRPREFIX (ptr, "  ")) {
-                    memmove(ptr, ptr + 1, strlen (ptr + 1) + 1);
+                if (STRPREFIX(ptr, "  ")) {
+                    memmove(ptr, ptr + 1, strlen(ptr + 1) + 1);
                     continue;
                 } else if (STRPREFIX(ptr, "(R)") || STRPREFIX(ptr, "(C)")) {
-                    memmove(ptr, ptr + 3, strlen (ptr + 3) + 1);
+                    memmove(ptr, ptr + 3, strlen(ptr + 3) + 1);
                     continue;
                 } else if (STRPREFIX(ptr, "(TM)")) {
                     memmove(ptr, ptr + 4, strlen(ptr + 4) + 1);
@@ -1201,7 +1201,7 @@ esxDomainLookupByUUID(virConnectPtr conn, const unsigned char *uuid)
         }
 
         if (memcmp(uuid, uuid_candidate,
-                   VIR_UUID_BUFLEN * sizeof (unsigned char)) != 0) {
+                   VIR_UUID_BUFLEN * sizeof(unsigned char)) != 0) {
             continue;
         }
 
@@ -2737,7 +2737,7 @@ esxDomainGetSchedulerParameters(virDomainPtr domain,
          dynamicProperty != NULL && mask != 7 && i < 3;
          dynamicProperty = dynamicProperty->_next) {
         if (STREQ(dynamicProperty->name, "config.cpuAllocation.reservation") &&
-            !(mask & (1 << 0))) {
+            ! (mask & (1 << 0))) {
             snprintf (params[i].field, VIR_DOMAIN_SCHED_FIELD_LENGTH, "%s",
                       "reservation");
 
@@ -2753,7 +2753,7 @@ esxDomainGetSchedulerParameters(virDomainPtr domain,
             ++i;
         } else if (STREQ(dynamicProperty->name,
                          "config.cpuAllocation.limit") &&
-                   !(mask & (1 << 1))) {
+                   ! (mask & (1 << 1))) {
             snprintf (params[i].field, VIR_DOMAIN_SCHED_FIELD_LENGTH, "%s",
                       "limit");
 
@@ -2769,7 +2769,7 @@ esxDomainGetSchedulerParameters(virDomainPtr domain,
             ++i;
         } else if (STREQ(dynamicProperty->name,
                          "config.cpuAllocation.shares") &&
-                   !(mask & (1 << 2))) {
+                   ! (mask & (1 << 2))) {
             snprintf (params[i].field, VIR_DOMAIN_SCHED_FIELD_LENGTH, "%s",
                       "shares");
 
index 38014de527859130908d346419f4856a8e3f5ad7..7130a415005f53b6c5a74febf7d9bf4b2805938a 100644 (file)
@@ -271,7 +271,7 @@ esxUtil_ResolveHostname(virConnectPtr conn, const char *hostname,
     struct addrinfo *result = NULL;
     int errcode;
 
-    memset(&hints, 0, sizeof (struct addrinfo));
+    memset(&hints, 0, sizeof(struct addrinfo));
 
     hints.ai_flags = AI_ADDRCONFIG;
     hints.ai_family = AF_INET;
@@ -455,12 +455,12 @@ esxUtil_GetConfigLong(virConnectPtr conn, virConfPtr conf, const char *name,
 
 int
 esxUtil_GetConfigBoolean(virConnectPtr conn, virConfPtr conf,
-                         const char *name, int *boolval, int default_,
+                         const char *name, int *boolean_, int default_,
                          int optional)
 {
     virConfValuePtr value;
 
-    *boolval = default_;
+    *boolean_ = default_;
     value = virConfGetValue(conf, name);
 
     if (value == NULL) {
@@ -485,9 +485,9 @@ esxUtil_GetConfigBoolean(virConnectPtr conn, virConfPtr conf,
         }
 
         if (STRCASEEQ(value->str, "true")) {
-            *boolval = 1;
+            *boolean_ = 1;
         } else if (STRCASEEQ(value->str, "false")) {
-            *boolval = 0;
+            *boolean_ = 0;
         } else {
             ESX_ERROR(conn, VIR_ERR_INTERNAL_ERROR,
                       "Config entry '%s' must represent a boolean value "
@@ -506,7 +506,7 @@ esxUtil_GetConfigBoolean(virConnectPtr conn, virConfPtr conf,
 
 
 int
-esxUtil_EqualSuffix(const char *string, const charsuffix)
+esxUtil_EqualSuffix(const char *string, const char *suffix)
 {
     int difference = (int)strlen(string) - (int)strlen(suffix);
 
index 476e004956d632bb03af85f1e09f20351cd77ada..e4922c16ad9dd5a640ff68813b67999950763efa 100644 (file)
@@ -53,9 +53,9 @@ int esxUtil_GetConfigLong(virConnectPtr conn, virConfPtr conf, const char *name,
                           long long *number, long long default_, int optional);
 
 int esxUtil_GetConfigBoolean(virConnectPtr conn, virConfPtr conf,
-                             const char *name, int *boolean, int default_,
+                             const char *name, int *boolean_, int default_,
                              int optional);
 
-int esxUtil_EqualSuffix(const char *string, const charsuffix);
+int esxUtil_EqualSuffix(const char *string, const char *suffix);
 
 #endif /* __ESX_UTIL_H__ */
index 32e9be343d16279fbeb359ae62e9bd92d255df4f..091977468e8454677dd2c176a12eee92b4dab7b3 100644 (file)
@@ -82,7 +82,7 @@
     int                                                                       \
     esxVI_##_type##_Alloc(virConnectPtr conn, esxVI_##_type **ptrptr)         \
     {                                                                         \
-        return esxVI_Alloc(conn, (void **)ptrptr, sizeof (esxVI_##_type));    \
+        return esxVI_Alloc(conn, (void **)ptrptr, sizeof(esxVI_##_type));     \
     }
 
 #define ESX_VI__TEMPLATE__FREE(_type, _body)                                  \
@@ -765,6 +765,7 @@ esxVI_Enumeration_Deserialize(virConnectPtr conn,
 
   failure:
     result = -1;
+
     goto cleanup;
 }
 
index 09cdec3e4722f693460b78afd3c03d513bdc9d4e..d3d306e5ee0e91cca3221a7e789cf6b4ba5b1ff0 100644 (file)
@@ -66,7 +66,7 @@
     int                                                                       \
     esxVI_##_type##_Alloc(virConnectPtr conn, esxVI_##_type **ptrptr)         \
     {                                                                         \
-        return esxVI_Alloc(conn, (void **)ptrptr, sizeof (esxVI_##_type));    \
+        return esxVI_Alloc(conn, (void **)ptrptr, sizeof(esxVI_##_type));     \
     }
 
 
 #define ESX_VI__TEMPLATE__LIST__SERIALIZE(_type)                              \
     int                                                                       \
     esxVI_##_type##_SerializeList(virConnectPtr conn, esxVI_##_type *list,    \
-                                  const charelement, virBufferPtr output,   \
+                                  const char *element, virBufferPtr output,   \
                                   esxVI_Boolean required)                     \
     {                                                                         \
         return esxVI_List_Serialize(conn, (esxVI_List *)list,                 \
         if (value < (_min) || value > (_max)) {                               \
             ESX_VI_ERROR(conn, VIR_ERR_INTERNAL_ERROR,                        \
                          "Value '%s' is not representable as "_xsdType,       \
-                         (const char *) string);                              \
+                         (const char *)string);                               \
             goto failure;                                                     \
         }                                                                     \
                                                                               \
@@ -1010,7 +1010,6 @@ ESX_VI__TEMPLATE__SERIALIZE_EXTRA(Long, "xsd:long",
 /* esxVI_Long_SerializeList */
 ESX_VI__TEMPLATE__LIST__SERIALIZE(Long);
 
-
 /* esxVI_Long_Deserialize */
 ESX_VI__TEMPLATE__DESERIALIZE_NUMBER(Long, "xsd:long", INT64_MIN, INT64_MAX);
 
@@ -1394,7 +1393,7 @@ esxVI_ManagedObjectReference_Deserialize
     }
 
     if (expectedType != NULL &&
-        !STREQ(expectedType, (*managedObjectReference)->type)) {
+        STRNEQ(expectedType, (*managedObjectReference)->type)) {
         ESX_VI_ERROR(conn, VIR_ERR_INTERNAL_ERROR,
                      "Expected type '%s' but found '%s'", expectedType,
                      (*managedObjectReference)->type);
@@ -1615,7 +1614,7 @@ esxVI_TraversalSpec_Alloc(virConnectPtr conn,
                           esxVI_TraversalSpec **traversalSpec)
 {
     if (esxVI_Alloc(conn, (void **)traversalSpec,
-                    sizeof (esxVI_TraversalSpec)) < 0) {
+                    sizeof(esxVI_TraversalSpec)) < 0) {
         return -1;
     }
 
index 8738ab3bf607382b4c5c5a572ab8fcf0360aaa5e..32ccda614ee8d59664f0271eae9e4cc79da6c5f0 100644 (file)
@@ -1157,13 +1157,13 @@ int esxVI_PerfCounterInfo_DeserializeList
 struct _esxVI_PerfQuerySpec {
     esxVI_PerfQuerySpec *_next;                            /* optional */
 
-    esxVI_ManagedObjectReferenceentity;                  /* required */
-    esxVI_DateTimestartTime;                             /* optional */
-    esxVI_DateTimeendTime;                               /* optional */
+    esxVI_ManagedObjectReference *entity;                  /* required */
+    esxVI_DateTime *startTime;                             /* optional */
+    esxVI_DateTime *endTime;                               /* optional */
     esxVI_Int *maxSample;                                  /* optional */
     esxVI_PerfMetricId *metricId;                          /* optional, list */
     esxVI_Int *intervalId;                                 /* optional */
-    charformat;                                          /* optional */ // FIXME: see PerfFormat
+    char *format;                                          /* optional */ // FIXME: see PerfFormat
 };
 
 int esxVI_PerfQuerySpec_Alloc(virConnectPtr conn,
@@ -1187,8 +1187,8 @@ int esxVI_PerfQuerySpec_SerializeList(virConnectPtr conn,
 struct _esxVI_PerfSampleInfo {
     esxVI_PerfSampleInfo *_next;                           /* optional */
 
-    esxVI_DateTimetimestamp;                             /* required */
-    esxVI_Intinterval;                                   /* required */
+    esxVI_DateTime *timestamp;                             /* required */
+    esxVI_Int *interval;                                   /* required */
 };
 
 int esxVI_PerfSampleInfo_Alloc(virConnectPtr conn,