render / rpms / libvirt

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