---
src/locking/domain_lock.c | 4 ++--
src/locking/lock_daemon.c | 4 ++--
src/locking/lock_driver_lockd.c | 12 ++++++------
src/locking/lock_driver_sanlock.c | 6 +++---
src/locking/lock_manager.c | 2 +-
5 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/src/locking/domain_lock.c b/src/locking/domain_lock.c
index 6191e9b..d79aeac 100644
--- a/src/locking/domain_lock.c
+++ b/src/locking/domain_lock.c
@@ -138,12 +138,12 @@ static virLockManagerPtr
virDomainLockManagerNew(virLockManagerPluginPtr plugin,
if (withResources) {
VIR_DEBUG("Adding leases");
- for (i = 0 ; i < dom->def->nleases ; i++)
+ for (i = 0; i < dom->def->nleases; i++)
if (virDomainLockManagerAddLease(lock, dom->def->leases[i]) < 0)
goto error;
VIR_DEBUG("Adding disks");
- for (i = 0 ; i < dom->def->ndisks ; i++)
+ for (i = 0; i < dom->def->ndisks; i++)
if (virDomainLockManagerAddDisk(lock, dom->def->disks[i]) < 0)
goto error;
}
diff --git a/src/locking/lock_daemon.c b/src/locking/lock_daemon.c
index e1653b1..23a119f 100644
--- a/src/locking/lock_daemon.c
+++ b/src/locking/lock_daemon.c
@@ -215,7 +215,7 @@ virLockDaemonNewPostExecRestart(virJSONValuePtr object, bool
privileged)
goto error;
}
- for (i = 0 ; i < n ; i++) {
+ for (i = 0; i < n; i++) {
virLockSpacePtr lockspace;
child = virJSONValueArrayGet(lockspaces, i);
@@ -749,7 +749,7 @@ virLockDaemonClientFree(void *opaque)
* closed the connection, we must kill it off
* to make sure it doesn't do nasty stuff */
if (data.gotError || data.hadSomeLeases) {
- for (i = 0 ; i < 15 ; i++) {
+ for (i = 0; i < 15; i++) {
int signum;
if (i == 0)
signum = SIGTERM;
diff --git a/src/locking/lock_driver_lockd.c b/src/locking/lock_driver_lockd.c
index afe9e94..cc3b6b1 100644
--- a/src/locking/lock_driver_lockd.c
+++ b/src/locking/lock_driver_lockd.c
@@ -428,7 +428,7 @@ static void virLockManagerLockDaemonFree(virLockManagerPtr lock)
lock->privateData = NULL;
- for (i = 0 ; i < priv->nresources ; i++) {
+ for (i = 0; i < priv->nresources; i++) {
VIR_FREE(priv->resources[i].lockspace);
VIR_FREE(priv->resources[i].name);
}
@@ -459,7 +459,7 @@ static int virLockManagerLockDaemonNew(virLockManagerPtr lock,
switch (type) {
case VIR_LOCK_MANAGER_OBJECT_TYPE_DOMAIN:
- for (i = 0 ; i < nparams ; i++) {
+ for (i = 0; i < nparams; i++) {
if (STREQ(params[i].key, "uuid")) {
memcpy(priv->uuid, params[i].value.uuid, VIR_UUID_BUFLEN);
} else if (STREQ(params[i].key, "name")) {
@@ -530,7 +530,7 @@ static char *virLockManagerLockDaemonDiskLeaseName(const char *path)
return NULL;
}
- for (i = 0 ; i < SHA256_DIGEST_SIZE ; i++) {
+ for (i = 0; i < SHA256_DIGEST_SIZE; i++) {
ret[i*2] = hex[(buf[i] >> 4) & 0xf];
ret[(i*2)+1] = hex[buf[i] & 0xf];
}
@@ -629,7 +629,7 @@ static int virLockManagerLockDaemonAddResource(virLockManagerPtr
lock,
size_t i;
char *path = NULL;
char *lockspace = NULL;
- for (i = 0 ; i < nparams ; i++) {
+ for (i = 0; i < nparams; i++) {
if (STREQ(params[i].key, "offset")) {
if (params[i].value.ul != 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
@@ -725,7 +725,7 @@ static int virLockManagerLockDaemonAcquire(virLockManagerPtr lock,
if (!(flags & VIR_LOCK_MANAGER_ACQUIRE_REGISTER_ONLY)) {
size_t i;
- for (i = 0 ; i < priv->nresources ; i++) {
+ for (i = 0; i < priv->nresources; i++) {
virLockSpaceProtocolAcquireResourceArgs args;
memset(&args, 0, sizeof(args));
@@ -781,7 +781,7 @@ static int virLockManagerLockDaemonRelease(virLockManagerPtr lock,
if (!(client = virLockManagerLockDaemonConnect(lock, &program, &counter)))
goto cleanup;
- for (i = 0 ; i < priv->nresources ; i++) {
+ for (i = 0; i < priv->nresources; i++) {
virLockSpaceProtocolReleaseResourceArgs args;
memset(&args, 0, sizeof(args));
diff --git a/src/locking/lock_driver_sanlock.c b/src/locking/lock_driver_sanlock.c
index eb15e29..de14725 100644
--- a/src/locking/lock_driver_sanlock.c
+++ b/src/locking/lock_driver_sanlock.c
@@ -540,7 +540,7 @@ static int virLockManagerSanlockDiskLeaseName(const char *path,
return -1;
}
- for (i = 0 ; i < MD5_DIGEST_SIZE ; i++) {
+ for (i = 0; i < MD5_DIGEST_SIZE; i++) {
str[i*2] = hex[(buf[i] >> 4) & 0xf];
str[(i*2)+1] = hex[buf[i] & 0xf];
}
@@ -1020,7 +1020,7 @@ static int virLockManagerSanlockAcquire(virLockManagerPtr lock,
VIR_DEBUG("Acquire completed fd=%d", sock);
if (res_free) {
- for (i = 0 ; i < res_count ; i++) {
+ for (i = 0; i < res_count; i++) {
VIR_FREE(res_args[i]);
}
VIR_FREE(res_args);
@@ -1033,7 +1033,7 @@ static int virLockManagerSanlockAcquire(virLockManagerPtr lock,
error:
if (res_free) {
- for (i = 0 ; i < res_count ; i++) {
+ for (i = 0; i < res_count; i++) {
VIR_FREE(res_args[i]);
}
VIR_FREE(res_args);
diff --git a/src/locking/lock_manager.c b/src/locking/lock_manager.c
index 4cffc3f..7c30c6f 100644
--- a/src/locking/lock_manager.c
+++ b/src/locking/lock_manager.c
@@ -79,7 +79,7 @@ static void virLockManagerLogParams(size_t nparams,
{
int i;
char uuidstr[VIR_UUID_STRING_BUFLEN];
- for (i = 0 ; i < nparams ; i++) {
+ for (i = 0; i < nparams; i++) {
switch (params[i].type) {
case VIR_LOCK_MANAGER_PARAM_TYPE_INT:
VIR_DEBUG(" key=%s type=int value=%d", params[i].key,
params[i].value.i);
--
1.8.1.4