mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
storage: backend: fs: Touch up coding style
virStorageBackendFileSystemRefresh() used "cleanup" label just for error exits and didn't meet libvirt's standard for braces in one case.
This commit is contained in:
parent
15213d1e5d
commit
9f20d6a56d
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user