From 4af9bb0f516d85ffc722066d6a82a10824940cc2 Mon Sep 17 00:00:00 2001 Message-Id: <4af9bb0f516d85ffc722066d6a82a10824940cc2@dist-git> From: Eric Blake Date: Wed, 26 Feb 2014 14:54:06 +0100 Subject: [PATCH] maint: fix comma style issues: conf https://bugzilla.redhat.com/show_bug.cgi?id=1032370 Most of our code base uses space after comma but not before; fix the remaining uses before adding a syntax check. * src/conf/capabilities.c: Consistently use commas. * src/conf/domain_conf.c: Likewise. * src/conf/network_conf.c: Likewise. * src/conf/storage_conf.c: Likewise. Signed-off-by: Eric Blake (cherry picked from commit 6f4901e13b55b0a6adac303d7880740ac1bb5300) Signed-off-by: Jiri Denemark --- src/conf/capabilities.c | 2 +- src/conf/domain_conf.c | 4 +- src/conf/network_conf.c | 6 +-- src/conf/storage_conf.c | 97 +++++++++++++++++++++++++------------------------ 4 files changed, 55 insertions(+), 54 deletions(-) diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c index 1acc936..ad6faa2 100644 --- a/src/conf/capabilities.c +++ b/src/conf/capabilities.c @@ -761,7 +761,7 @@ virCapabilitiesFormatXML(virCapsPtr caps) virBufferAddLit(&xml, " \n"); if (virUUIDIsValid(caps->host.host_uuid)) { virUUIDFormat(caps->host.host_uuid, host_uuid); - virBufferAsprintf(&xml," %s\n", host_uuid); + virBufferAsprintf(&xml, " %s\n", host_uuid); } virBufferAddLit(&xml, " \n"); if (caps->host.arch) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 9536250..b612f3a 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -14421,7 +14421,7 @@ virDomainDiskBlockIoDefFormat(virBufferPtr buf, { if (def->blockio.logical_block_size > 0 || def->blockio.physical_block_size > 0) { - virBufferAddLit(buf," blockio.logical_block_size > 0) { virBufferAsprintf(buf, " logical_block_size='%u'", @@ -14448,7 +14448,7 @@ virDomainDiskSourceDefFormat(virBufferPtr buf, def->startupPolicy) { switch (def->type) { case VIR_DOMAIN_DISK_TYPE_FILE: - virBufferAddLit(buf," src) virBufferEscapeString(buf, " file='%s'", def->src); if (def->startupPolicy) diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c index 9c5319f..7967101 100644 --- a/src/conf/network_conf.c +++ b/src/conf/network_conf.c @@ -2368,7 +2368,7 @@ virNetworkIpDefFormat(virBufferPtr buf, VIR_FREE(addr); } if (def->prefix > 0) { - virBufferAsprintf(buf," prefix='%u'", def->prefix); + virBufferAsprintf(buf, " prefix='%u'", def->prefix); } virBufferAddLit(buf, ">\n"); virBufferAdjustIndent(buf, 2); @@ -2467,7 +2467,7 @@ virNetworkRouteDefFormat(virBufferPtr buf, VIR_FREE(addr); } if (def->has_prefix) { - virBufferAsprintf(buf," prefix='%u'", def->prefix); + virBufferAsprintf(buf, " prefix='%u'", def->prefix); } if (VIR_SOCKET_ADDR_VALID(&def->gateway)) { char *addr = virSocketAddrFormat(&def->gateway); @@ -2477,7 +2477,7 @@ virNetworkRouteDefFormat(virBufferPtr buf, VIR_FREE(addr); } if (def->has_metric && def->metric > 0) { - virBufferAsprintf(buf," metric='%u'", def->metric); + virBufferAsprintf(buf, " metric='%u'", def->metric); } virBufferAddLit(buf, "/>\n"); diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index 002663f..7cd7742 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -1053,7 +1053,7 @@ virStoragePoolSourceFormat(virBufferPtr buf, size_t i, j; char uuid[VIR_UUID_STRING_BUFLEN]; - virBufferAddLit(buf," \n"); + virBufferAddLit(buf, " \n"); if ((options->flags & VIR_STORAGE_POOL_SOURCE_HOST) && src->nhost) { for (i = 0; i < src->nhost; i++) { virBufferAsprintf(buf, " hosts[i].name); @@ -1067,14 +1067,14 @@ virStoragePoolSourceFormat(virBufferPtr buf, src->ndevice) { for (i = 0; i < src->ndevice; i++) { if (src->devices[i].nfreeExtent) { - virBufferAsprintf(buf," \n", + virBufferAsprintf(buf, " \n", src->devices[i].path); for (j = 0; j < src->devices[i].nfreeExtent; j++) { virBufferAsprintf(buf, " \n", src->devices[i].freeExtents[j].start, src->devices[i].freeExtents[j].end); } - virBufferAddLit(buf," \n"); + virBufferAddLit(buf, " \n"); } else { virBufferAsprintf(buf, " \n", src->devices[i].path); @@ -1084,7 +1084,7 @@ virStoragePoolSourceFormat(virBufferPtr buf, if ((options->flags & VIR_STORAGE_POOL_SOURCE_DIR) && src->dir) - virBufferAsprintf(buf," \n", src->dir); + virBufferAsprintf(buf, " \n", src->dir); if ((options->flags & VIR_STORAGE_POOL_SOURCE_ADAPTER)) { if (src->adapter.type == VIR_STORAGE_POOL_SOURCE_ADAPTER_TYPE_FC_HOST || @@ -1095,24 +1095,25 @@ virStoragePoolSourceFormat(virBufferPtr buf, if (src->adapter.type == VIR_STORAGE_POOL_SOURCE_ADAPTER_TYPE_FC_HOST) { virBufferEscapeString(buf, " parent='%s'", src->adapter.data.fchost.parent); - virBufferAsprintf(buf," wwnn='%s' wwpn='%s'/>\n", + virBufferAsprintf(buf, " wwnn='%s' wwpn='%s'/>\n", src->adapter.data.fchost.wwnn, src->adapter.data.fchost.wwpn); } else if (src->adapter.type == VIR_STORAGE_POOL_SOURCE_ADAPTER_TYPE_SCSI_HOST) { - virBufferAsprintf(buf," name='%s'/>\n", src->adapter.data.name); + virBufferAsprintf(buf, " name='%s'/>\n", src->adapter.data.name); } } if ((options->flags & VIR_STORAGE_POOL_SOURCE_NAME) && src->name) - virBufferAsprintf(buf," %s\n", src->name); + virBufferAsprintf(buf, " %s\n", src->name); if ((options->flags & VIR_STORAGE_POOL_SOURCE_INITIATOR_IQN) && src->initiator.iqn) { - virBufferAddLit(buf," \n"); - virBufferEscapeString(buf," \n", src->initiator.iqn); - virBufferAddLit(buf," \n"); + virBufferAddLit(buf, " \n"); + virBufferEscapeString(buf, " \n", + src->initiator.iqn); + virBufferAddLit(buf, " \n"); } if (options->formatToString) { @@ -1123,40 +1124,40 @@ virStoragePoolSourceFormat(virBufferPtr buf, src->format); return -1; } - virBufferAsprintf(buf," \n", format); + virBufferAsprintf(buf, " \n", format); } if (src->authType == VIR_STORAGE_POOL_AUTH_CHAP || src->authType == VIR_STORAGE_POOL_AUTH_CEPHX) { - virBufferAsprintf(buf," \n", + virBufferAsprintf(buf, " \n", virStoragePoolAuthTypeTypeToString(src->authType), (src->authType == VIR_STORAGE_POOL_AUTH_CHAP ? src->auth.chap.username : src->auth.cephx.username)); - virBufferAddLit(buf," auth.cephx.secret.uuidUsable) { virUUIDFormat(src->auth.cephx.secret.uuid, uuid); - virBufferAsprintf(buf," uuid='%s'", uuid); + virBufferAsprintf(buf, " uuid='%s'", uuid); } if (src->auth.cephx.secret.usage != NULL) { - virBufferAsprintf(buf," usage='%s'", src->auth.cephx.secret.usage); + virBufferAsprintf(buf, " usage='%s'", src->auth.cephx.secret.usage); } - virBufferAddLit(buf,"/>\n"); + virBufferAddLit(buf, "/>\n"); - virBufferAddLit(buf," \n"); + virBufferAddLit(buf, " \n"); } if (src->vendor != NULL) { - virBufferEscapeString(buf," \n", src->vendor); + virBufferEscapeString(buf, " \n", src->vendor); } if (src->product != NULL) { - virBufferEscapeString(buf," \n", src->product); + virBufferEscapeString(buf, " \n", src->product); } - virBufferAddLit(buf," \n"); + virBufferAddLit(buf, " \n"); return 0; } @@ -1181,16 +1182,16 @@ virStoragePoolDefFormat(virStoragePoolDefPtr def) goto cleanup; } virBufferAsprintf(&buf, "\n", type); - virBufferAsprintf(&buf," %s\n", def->name); + virBufferAsprintf(&buf, " %s\n", def->name); virUUIDFormat(def->uuid, uuid); - virBufferAsprintf(&buf," %s\n", uuid); + virBufferAsprintf(&buf, " %s\n", uuid); - virBufferAsprintf(&buf," %llu\n", + virBufferAsprintf(&buf, " %llu\n", def->capacity); - virBufferAsprintf(&buf," %llu\n", + virBufferAsprintf(&buf, " %llu\n", def->allocation); - virBufferAsprintf(&buf," %llu\n", + virBufferAsprintf(&buf, " %llu\n", def->available); if (virStoragePoolSourceFormat(&buf, options, &def->source) < 0) @@ -1200,27 +1201,27 @@ virStoragePoolDefFormat(virStoragePoolDefPtr def) * doesn't have a target */ if (def->type != VIR_STORAGE_POOL_RBD && def->type != VIR_STORAGE_POOL_SHEEPDOG) { - virBufferAddLit(&buf," \n"); + virBufferAddLit(&buf, " \n"); if (def->target.path) - virBufferAsprintf(&buf," %s\n", def->target.path); + virBufferAsprintf(&buf, " %s\n", def->target.path); - virBufferAddLit(&buf," \n"); - virBufferAsprintf(&buf," 0%o\n", + virBufferAddLit(&buf, " \n"); + virBufferAsprintf(&buf, " 0%o\n", def->target.perms.mode); - virBufferAsprintf(&buf," %d\n", + virBufferAsprintf(&buf, " %d\n", (int) def->target.perms.uid); - virBufferAsprintf(&buf," %d\n", + virBufferAsprintf(&buf, " %d\n", (int) def->target.perms.gid); if (def->target.perms.label) - virBufferAsprintf(&buf," \n", + virBufferAsprintf(&buf, " \n", def->target.perms.label); - virBufferAddLit(&buf," \n"); - virBufferAddLit(&buf," \n"); + virBufferAddLit(&buf, " \n"); + virBufferAddLit(&buf, " \n"); } - virBufferAddLit(&buf,"\n"); + virBufferAddLit(&buf, "\n"); if (virBufferError(&buf)) goto no_memory; @@ -1488,7 +1489,7 @@ virStorageVolTargetDefFormat(virStorageVolOptionsPtr options, virBufferAsprintf(buf, " <%s>\n", type); if (def->path) - virBufferAsprintf(buf," %s\n", def->path); + virBufferAsprintf(buf, " %s\n", def->path); if (options->formatToString) { const char *format = (options->formatToString)(def->format); @@ -1498,23 +1499,23 @@ virStorageVolTargetDefFormat(virStorageVolOptionsPtr options, def->format); return -1; } - virBufferAsprintf(buf," \n", format); + virBufferAsprintf(buf, " \n", format); } - virBufferAddLit(buf," \n"); - virBufferAsprintf(buf," 0%o\n", + virBufferAddLit(buf, " \n"); + virBufferAsprintf(buf, " 0%o\n", def->perms.mode); - virBufferAsprintf(buf," %u\n", + virBufferAsprintf(buf, " %u\n", (unsigned int) def->perms.uid); - virBufferAsprintf(buf," %u\n", + virBufferAsprintf(buf, " %u\n", (unsigned int) def->perms.gid); if (def->perms.label) - virBufferAsprintf(buf," \n", + virBufferAsprintf(buf, " \n", def->perms.label); - virBufferAddLit(buf," \n"); + virBufferAddLit(buf, " \n"); if (def->timestamps) { virBufferAddLit(buf, " \n"); @@ -1571,8 +1572,8 @@ virStorageVolDefFormat(virStoragePoolDefPtr pool, return NULL; virBufferAddLit(&buf, "\n"); - virBufferAsprintf(&buf," %s\n", def->name); - virBufferAsprintf(&buf," %s\n", NULLSTR(def->key)); + virBufferAsprintf(&buf, " %s\n", def->name); + virBufferAsprintf(&buf, " %s\n", NULLSTR(def->key)); virBufferAddLit(&buf, " \n"); if (def->source.nextent) { @@ -1599,9 +1600,9 @@ virStorageVolDefFormat(virStoragePoolDefPtr pool, } virBufferAddLit(&buf, " \n"); - virBufferAsprintf(&buf," %llu\n", + virBufferAsprintf(&buf, " %llu\n", def->capacity); - virBufferAsprintf(&buf," %llu\n", + virBufferAsprintf(&buf, " %llu\n", def->allocation); if (virStorageVolTargetDefFormat(options, &buf, @@ -1613,7 +1614,7 @@ virStorageVolDefFormat(virStoragePoolDefPtr pool, &def->backingStore, "backingStore") < 0) goto cleanup; - virBufferAddLit(&buf,"\n"); + virBufferAddLit(&buf, "\n"); if (virBufferError(&buf)) goto no_memory; -- 1.9.0