}
}
- 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;
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,
/* 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);
}
if (memcmp(uuid, uuid_candidate,
- VIR_UUID_BUFLEN * sizeof (unsigned char)) != 0) {
+ VIR_UUID_BUFLEN * sizeof(unsigned char)) != 0) {
continue;
}
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");
++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");
++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");
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;
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) {
}
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 "
int
-esxUtil_EqualSuffix(const char *string, const char* suffix)
+esxUtil_EqualSuffix(const char *string, const char *suffix)
{
int difference = (int)strlen(string) - (int)strlen(suffix);
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 char* suffix);
+int esxUtil_EqualSuffix(const char *string, const char *suffix);
#endif /* __ESX_UTIL_H__ */
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) \
failure:
result = -1;
+
goto cleanup;
}
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 char* element, 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; \
} \
\
/* esxVI_Long_SerializeList */
ESX_VI__TEMPLATE__LIST__SERIALIZE(Long);
-
/* esxVI_Long_Deserialize */
ESX_VI__TEMPLATE__DESERIALIZE_NUMBER(Long, "xsd:long", INT64_MIN, INT64_MAX);
}
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);
esxVI_TraversalSpec **traversalSpec)
{
if (esxVI_Alloc(conn, (void **)traversalSpec,
- sizeof (esxVI_TraversalSpec)) < 0) {
+ sizeof(esxVI_TraversalSpec)) < 0) {
return -1;
}
struct _esxVI_PerfQuerySpec {
esxVI_PerfQuerySpec *_next; /* optional */
- esxVI_ManagedObjectReference* entity; /* required */
- esxVI_DateTime* startTime; /* optional */
- esxVI_DateTime* endTime; /* 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 */
- char* format; /* optional */ // FIXME: see PerfFormat
+ char *format; /* optional */ // FIXME: see PerfFormat
};
int esxVI_PerfQuerySpec_Alloc(virConnectPtr conn,
struct _esxVI_PerfSampleInfo {
esxVI_PerfSampleInfo *_next; /* optional */
- esxVI_DateTime* timestamp; /* required */
- esxVI_Int* interval; /* required */
+ esxVI_DateTime *timestamp; /* required */
+ esxVI_Int *interval; /* required */
};
int esxVI_PerfSampleInfo_Alloc(virConnectPtr conn,