]> xenbits.xensource.com Git - libvirt.git/commitdiff
storage: backend: fs: Touch up coding style
authorPeter Krempa <pkrempa@redhat.com>
Mon, 14 Jul 2014 13:28:01 +0000 (15:28 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 16 Jul 2014 09:42:51 +0000 (11:42 +0200)
virStorageBackendFileSystemRefresh() used "cleanup" label just for error
exits and didn't meet libvirt's standard for braces in one case.

src/storage/storage_backend_fs.c

index 55ed1be0741cc4228bfc08cbf48e02c7b1eb5930..906d0efd4afaa58016842669162ef197305f3899 100644 (file)
@@ -840,7 +840,7 @@ virStorageBackendFileSystemRefresh(virConnectPtr conn ATTRIBUTE_UNUSED,
         virReportSystemError(errno,
                              _("cannot open path '%s'"),
                              pool->def->target.path);
-        goto cleanup;
+        goto error;
     }
 
     while ((direrr = virDirRead(dir, &ent, pool->def->target.path)) > 0) {
@@ -849,20 +849,20 @@ virStorageBackendFileSystemRefresh(virConnectPtr conn ATTRIBUTE_UNUSED,
         int backingStoreFormat;
 
         if (VIR_ALLOC(vol) < 0)
-            goto cleanup;
+            goto error;
 
         if (VIR_STRDUP(vol->name, ent->d_name) < 0)
-            goto cleanup;
+            goto error;
 
         vol->type = VIR_STORAGE_VOL_FILE;
         vol->target.format = VIR_STORAGE_FILE_RAW; /* Real value is filled in during probe */
         if (virAsprintf(&vol->target.path, "%s/%s",
                         pool->def->target.path,
                         vol->name) == -1)
-            goto cleanup;
+            goto error;
 
         if (VIR_STRDUP(vol->key, vol->target.path) < 0)
-            goto cleanup;
+            goto error;
 
         if ((ret = virStorageBackendProbeTarget(&vol->target,
                                                 &backingStore,
@@ -881,8 +881,9 @@ virStorageBackendFileSystemRefresh(virConnectPtr conn ATTRIBUTE_UNUSED,
                  * break virStorageVolTargetDefFormat() generating the line
                  * <format type='...'/>. */
                 backingStoreFormat = VIR_STORAGE_FILE_RAW;
-            } else
-                goto cleanup;
+            } else {
+                goto error;
+            }
         }
 
         /* directory based volume */
@@ -891,7 +892,7 @@ virStorageBackendFileSystemRefresh(virConnectPtr conn ATTRIBUTE_UNUSED,
 
         if (backingStore != NULL) {
             if (VIR_ALLOC(vol->target.backingStore) < 0)
-                goto cleanup;
+                goto error;
 
             vol->target.backingStore->path = backingStore;
             vol->target.backingStore->format = backingStoreFormat;
@@ -906,10 +907,10 @@ virStorageBackendFileSystemRefresh(virConnectPtr conn ATTRIBUTE_UNUSED,
 
 
         if (VIR_APPEND_ELEMENT(pool->volumes.objs, pool->volumes.count, vol) < 0)
-            goto cleanup;
+            goto error;
     }
     if (direrr < 0)
-        goto cleanup;
+        goto error;
     closedir(dir);
 
     if (statvfs(pool->def->target.path, &sb) < 0) {
@@ -926,7 +927,7 @@ virStorageBackendFileSystemRefresh(virConnectPtr conn ATTRIBUTE_UNUSED,
 
     return 0;
 
cleanup:
error:
     if (dir)
         closedir(dir);
     virStorageVolDefFree(vol);