mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
Indent top-level labels by one space in src/storage/
This commit is contained in:
parent
b69f99229c
commit
3eda88e94c
@ -248,7 +248,7 @@ virStorageBackendCopyToFD(virStorageVolDefPtr vol,
|
||||
}
|
||||
inputfd = -1;
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
VIR_FORCE_CLOSE(inputfd);
|
||||
|
||||
VIR_FREE(zerobuf);
|
||||
@ -326,7 +326,7 @@ virStorageBackendCreateBlockFrom(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
fd = -1;
|
||||
|
||||
ret = 0;
|
||||
cleanup:
|
||||
cleanup:
|
||||
VIR_FORCE_CLOSE(fd);
|
||||
|
||||
return ret;
|
||||
@ -403,7 +403,7 @@ createRawFile(int fd, virStorageVolDefPtr vol,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -453,7 +453,7 @@ virStorageBackendCreateRaw(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
/* createRawFile already reported the exact error. */
|
||||
ret = -1;
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
VIR_FORCE_CLOSE(fd);
|
||||
return ret;
|
||||
}
|
||||
@ -553,7 +553,7 @@ virStorageGenerateQcowEncryption(virConnectPtr conn,
|
||||
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
if (secret != NULL) {
|
||||
if (ret != 0 &&
|
||||
conn->secretDriver->secretUndefine != NULL)
|
||||
@ -653,7 +653,7 @@ virStorageBackendQemuImgSupportsCompat(const char *qemuimg)
|
||||
if (strstr(output, "\ncompat "))
|
||||
ret = true;
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
virCommandFree(cmd);
|
||||
VIR_FREE(output);
|
||||
return ret;
|
||||
@ -699,7 +699,7 @@ virStorageBackendQEMUImgBackingFormat(const char *qemuimg)
|
||||
ret = QEMU_IMG_BACKING_FORMAT_NONE;
|
||||
}
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
virCommandFree(cmd);
|
||||
VIR_FREE(help);
|
||||
return ret;
|
||||
@ -761,9 +761,9 @@ virStorageBackendCreateQemuImgOpts(char **opts,
|
||||
*opts = virBufferContentAndReset(&buf);
|
||||
return 0;
|
||||
|
||||
no_memory:
|
||||
no_memory:
|
||||
virReportOOMError();
|
||||
error:
|
||||
error:
|
||||
virBufferFreeAndReset(&buf);
|
||||
return -1;
|
||||
}
|
||||
@ -1010,7 +1010,7 @@ virStorageBackendCreateQemuImg(virConnectPtr conn,
|
||||
ret = virStorageBackendCreateExecCommand(pool, vol, cmd);
|
||||
|
||||
virCommandFree(cmd);
|
||||
cleanup:
|
||||
cleanup:
|
||||
VIR_FREE(create_tool);
|
||||
return ret;
|
||||
}
|
||||
|
@ -426,7 +426,7 @@ virStorageBackendDiskBuildPool(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
ret = virCommandRun(cmd, NULL);
|
||||
}
|
||||
|
||||
error:
|
||||
error:
|
||||
virCommandFree(cmd);
|
||||
return ret;
|
||||
}
|
||||
@ -674,7 +674,7 @@ virStorageBackendDiskCreateVol(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
|
||||
res = 0;
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
VIR_FREE(partFormat);
|
||||
virCommandFree(cmd);
|
||||
return res;
|
||||
@ -758,7 +758,7 @@ virStorageBackendDiskDeleteVol(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
}
|
||||
|
||||
rc = 0;
|
||||
cleanup:
|
||||
cleanup:
|
||||
VIR_FREE(devpath);
|
||||
virCommandFree(cmd);
|
||||
return rc;
|
||||
|
@ -180,10 +180,10 @@ virStorageBackendProbeTarget(virStorageVolTargetPtr target,
|
||||
|
||||
goto cleanup;
|
||||
|
||||
error:
|
||||
error:
|
||||
VIR_FORCE_CLOSE(fd);
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
virStorageFileFreeMetadata(meta);
|
||||
VIR_FREE(header);
|
||||
return ret;
|
||||
@ -237,7 +237,7 @@ virStorageBackendFileSystemNetFindPoolSourcesFunc(char **const groups,
|
||||
src->format = VIR_STORAGE_POOL_NETFS_NFS;
|
||||
|
||||
ret = 0;
|
||||
cleanup:
|
||||
cleanup:
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -452,7 +452,7 @@ virStorageBackendFileSystemMount(virStoragePoolObjPtr pool)
|
||||
goto cleanup;
|
||||
|
||||
ret = 0;
|
||||
cleanup:
|
||||
cleanup:
|
||||
virCommandFree(cmd);
|
||||
VIR_FREE(src);
|
||||
return ret;
|
||||
@ -510,7 +510,7 @@ virStorageBackendFileSystemUnmount(virStoragePoolObjPtr pool)
|
||||
goto cleanup;
|
||||
|
||||
ret = 0;
|
||||
cleanup:
|
||||
cleanup:
|
||||
virCommandFree(cmd);
|
||||
return ret;
|
||||
}
|
||||
@ -621,7 +621,7 @@ virStorageBackendFileSystemProbe(const char *device,
|
||||
ret = FILESYSTEM_PROBE_ERROR;
|
||||
}
|
||||
|
||||
error:
|
||||
error:
|
||||
VIR_FREE(libblkid_format);
|
||||
|
||||
if (probe != NULL) {
|
||||
@ -724,7 +724,7 @@ virStorageBackendMakeFileSystem(virStoragePoolObjPtr pool,
|
||||
ret = virStorageBackendExecuteMKFS(device, format);
|
||||
}
|
||||
|
||||
error:
|
||||
error:
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -816,7 +816,7 @@ virStorageBackendFileSystemBuild(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
error:
|
||||
error:
|
||||
VIR_FREE(parent);
|
||||
return ret;
|
||||
}
|
||||
|
@ -143,7 +143,7 @@ virStorageBackendGlusterOpen(virStoragePoolObjPtr pool)
|
||||
|
||||
return ret;
|
||||
|
||||
error:
|
||||
error:
|
||||
virStorageBackendGlusterClose(ret);
|
||||
return NULL;
|
||||
}
|
||||
@ -220,7 +220,7 @@ virStorageBackendGlusterSetMetadata(virStorageBackendGlusterStatePtr state,
|
||||
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -321,7 +321,7 @@ virStorageBackendGlusterRefreshVol(virStorageBackendGlusterStatePtr state,
|
||||
*volptr = vol;
|
||||
vol = NULL;
|
||||
ret = 0;
|
||||
cleanup:
|
||||
cleanup:
|
||||
virStorageFileFreeMetadata(meta);
|
||||
virStorageVolDefFree(vol);
|
||||
if (fd)
|
||||
@ -401,7 +401,7 @@ virStorageBackendGlusterRefreshPool(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
pool->def->allocation = pool->def->capacity - pool->def->available;
|
||||
|
||||
ret = 0;
|
||||
cleanup:
|
||||
cleanup:
|
||||
if (dir)
|
||||
glfs_closedir(dir);
|
||||
virStorageBackendGlusterClose(state);
|
||||
@ -466,7 +466,7 @@ virStorageBackendGlusterVolDelete(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
virStorageBackendGlusterClose(state);
|
||||
return ret;
|
||||
}
|
||||
@ -569,7 +569,7 @@ virStorageFileBackendGlusterInit(virStorageFilePtr file)
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
error:
|
||||
VIR_FREE(priv->volname);
|
||||
glfs_fini(priv->vol);
|
||||
VIR_FREE(priv);
|
||||
|
@ -119,7 +119,7 @@ virStorageBackendISCSIGetHostNumber(const char *sysfs_path,
|
||||
}
|
||||
|
||||
closedir(sysdir);
|
||||
out:
|
||||
out:
|
||||
return retval;
|
||||
}
|
||||
|
||||
@ -217,7 +217,7 @@ virStorageBackendISCSIFindPoolSources(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
if (!(ret = virStoragePoolSourceListFormat(&list)))
|
||||
goto cleanup;
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
if (list.sources) {
|
||||
for (i = 0; i < ntargets; i++) {
|
||||
VIR_FREE(list.sources[i].hosts);
|
||||
@ -356,7 +356,7 @@ virStorageBackendISCSISetAuth(const char *portal,
|
||||
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
virObjectUnref(secret);
|
||||
VIR_FREE(secret_value);
|
||||
return ret;
|
||||
@ -411,7 +411,7 @@ virStorageBackendISCSIStartPool(virConnectPtr conn,
|
||||
}
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
VIR_FREE(portal);
|
||||
VIR_FREE(session);
|
||||
return ret;
|
||||
@ -435,7 +435,7 @@ virStorageBackendISCSIRefreshPool(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
|
||||
return 0;
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
VIR_FREE(session);
|
||||
return -1;
|
||||
}
|
||||
@ -457,7 +457,7 @@ virStorageBackendISCSIStopPool(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
goto cleanup;
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
VIR_FREE(portal);
|
||||
return ret;
|
||||
}
|
||||
|
@ -262,7 +262,7 @@ virStorageBackendLogicalMakeVol(char **const groups,
|
||||
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
VIR_FREE(regex);
|
||||
VIR_FREE(reg);
|
||||
VIR_FREE(vars);
|
||||
@ -330,7 +330,7 @@ virStorageBackendLogicalFindLVs(virStoragePoolObjPtr pool,
|
||||
goto cleanup;
|
||||
|
||||
ret = 0;
|
||||
cleanup:
|
||||
cleanup:
|
||||
virCommandFree(cmd);
|
||||
return ret;
|
||||
}
|
||||
@ -394,7 +394,7 @@ virStorageBackendLogicalFindPoolSourcesFunc(char **const groups,
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
error:
|
||||
VIR_FREE(pvname);
|
||||
VIR_FREE(vgname);
|
||||
|
||||
@ -558,7 +558,7 @@ virStorageBackendLogicalBuildPool(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
virCommandFree(vgcmd);
|
||||
return ret;
|
||||
}
|
||||
@ -613,7 +613,7 @@ virStorageBackendLogicalRefreshPool(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
virCommandFree(cmd);
|
||||
if (ret < 0)
|
||||
virStoragePoolObjClearVols(pool);
|
||||
@ -669,7 +669,7 @@ virStorageBackendLogicalDeletePool(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
cmd = NULL;
|
||||
}
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
virCommandFree(cmd);
|
||||
return ret;
|
||||
}
|
||||
@ -703,7 +703,7 @@ virStorageBackendLogicalDeleteVol(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
cleanup:
|
||||
cleanup:
|
||||
virCommandFree(lvchange_cmd);
|
||||
virCommandFree(lvremove_cmd);
|
||||
return ret;
|
||||
|
@ -66,7 +66,7 @@ virStorageBackendMpathUpdateVolTargetInfo(virStorageVolTargetPtr target,
|
||||
goto out;
|
||||
|
||||
ret = 0;
|
||||
out:
|
||||
out:
|
||||
VIR_FORCE_CLOSE(fd);
|
||||
return ret;
|
||||
}
|
||||
@ -107,7 +107,7 @@ virStorageBackendMpathNewVol(virStoragePoolObjPtr pool,
|
||||
pool->def->allocation += vol->allocation;
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
|
||||
if (ret != 0)
|
||||
virStorageVolDefFree(vol);
|
||||
@ -155,7 +155,7 @@ virStorageBackendIsMultipath(const char *dev_name)
|
||||
ret = 1;
|
||||
}
|
||||
|
||||
out:
|
||||
out:
|
||||
if (dmt != NULL) {
|
||||
dm_task_destroy(dmt);
|
||||
}
|
||||
@ -189,7 +189,7 @@ virStorageBackendGetMinorNumber(const char *dev_name, uint32_t *minor)
|
||||
*minor = info.minor;
|
||||
ret = 0;
|
||||
|
||||
out:
|
||||
out:
|
||||
if (dmt != NULL)
|
||||
dm_task_destroy(dmt);
|
||||
|
||||
@ -242,7 +242,7 @@ virStorageBackendCreateVols(virStoragePoolObjPtr pool,
|
||||
} while (next);
|
||||
|
||||
retval = 0;
|
||||
out:
|
||||
out:
|
||||
return retval;
|
||||
}
|
||||
|
||||
@ -278,7 +278,7 @@ virStorageBackendGetMaps(virStoragePoolObjPtr pool)
|
||||
|
||||
virStorageBackendCreateVols(pool, names);
|
||||
|
||||
out:
|
||||
out:
|
||||
if (dmt != NULL) {
|
||||
dm_task_destroy(dmt);
|
||||
}
|
||||
|
@ -226,7 +226,7 @@ static int virStorageBackendRBDOpenRADOSConn(virStorageBackendRBDStatePtr ptr,
|
||||
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
VIR_FREE(secret_value);
|
||||
VIR_FREE(rados_key);
|
||||
|
||||
@ -318,7 +318,7 @@ static int volStorageBackendRBDRefreshVolInfo(virStorageVolDefPtr vol,
|
||||
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
rbd_close(image);
|
||||
return ret;
|
||||
}
|
||||
@ -414,7 +414,7 @@ static int virStorageBackendRBDRefreshPool(virConnectPtr conn,
|
||||
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
VIR_FREE(names);
|
||||
virStorageBackendRBDCloseRADOSConn(&ptr);
|
||||
return ret;
|
||||
@ -454,7 +454,7 @@ static int virStorageBackendRBDDeleteVol(virConnectPtr conn,
|
||||
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
virStorageBackendRBDCloseRADOSConn(&ptr);
|
||||
return ret;
|
||||
}
|
||||
@ -545,7 +545,7 @@ virStorageBackendRBDBuildVol(virConnectPtr conn,
|
||||
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
virStorageBackendRBDCloseRADOSConn(&ptr);
|
||||
return ret;
|
||||
}
|
||||
@ -573,7 +573,7 @@ static int virStorageBackendRBDRefreshVol(virConnectPtr conn,
|
||||
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
virStorageBackendRBDCloseRADOSConn(&ptr);
|
||||
return ret;
|
||||
}
|
||||
@ -617,7 +617,7 @@ static int virStorageBackendRBDResizeVol(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
if (image != NULL)
|
||||
rbd_close(image);
|
||||
virStorageBackendRBDCloseRADOSConn(&ptr);
|
||||
|
@ -97,7 +97,7 @@ getDeviceType(uint32_t host,
|
||||
|
||||
VIR_DEBUG("Device type is %d", *type);
|
||||
|
||||
out:
|
||||
out:
|
||||
VIR_FREE(type_path);
|
||||
return retval;
|
||||
}
|
||||
@ -128,7 +128,7 @@ virStorageBackendSCSIUpdateVolTargetInfo(virStorageVolTargetPtr target,
|
||||
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
VIR_FORCE_CLOSE(fd);
|
||||
|
||||
return ret;
|
||||
@ -164,7 +164,7 @@ virStorageBackendSCSISerial(const char *dev)
|
||||
}
|
||||
|
||||
#ifdef WITH_UDEV
|
||||
cleanup:
|
||||
cleanup:
|
||||
virCommandFree(cmd);
|
||||
#endif
|
||||
|
||||
@ -258,9 +258,9 @@ virStorageBackendSCSINewLun(virStoragePoolObjPtr pool,
|
||||
|
||||
goto out;
|
||||
|
||||
free_vol:
|
||||
free_vol:
|
||||
virStorageVolDefFree(vol);
|
||||
out:
|
||||
out:
|
||||
VIR_FREE(devpath);
|
||||
return retval;
|
||||
}
|
||||
@ -309,7 +309,7 @@ getNewStyleBlockDevice(const char *lun_path,
|
||||
|
||||
closedir(block_dir);
|
||||
|
||||
out:
|
||||
out:
|
||||
VIR_FREE(block_path);
|
||||
return retval;
|
||||
}
|
||||
@ -341,7 +341,7 @@ getOldStyleBlockDevice(const char *lun_path ATTRIBUTE_UNUSED,
|
||||
VIR_DEBUG("Block device is '%s'", *block_device);
|
||||
}
|
||||
|
||||
out:
|
||||
out:
|
||||
return retval;
|
||||
}
|
||||
|
||||
@ -388,7 +388,7 @@ getBlockDevice(uint32_t host,
|
||||
|
||||
closedir(lun_dir);
|
||||
|
||||
out:
|
||||
out:
|
||||
VIR_FREE(lun_path);
|
||||
return retval;
|
||||
}
|
||||
@ -448,7 +448,7 @@ processLU(virStoragePoolObjPtr pool,
|
||||
|
||||
VIR_FREE(type_path);
|
||||
|
||||
out:
|
||||
out:
|
||||
VIR_FREE(block_device);
|
||||
return retval;
|
||||
}
|
||||
@ -537,9 +537,9 @@ virStorageBackendSCSITriggerRescan(uint32_t host)
|
||||
}
|
||||
|
||||
VIR_FORCE_CLOSE(fd);
|
||||
free_path:
|
||||
free_path:
|
||||
VIR_FREE(path);
|
||||
out:
|
||||
out:
|
||||
VIR_DEBUG("Rescan of host %d complete", host);
|
||||
return retval;
|
||||
}
|
||||
@ -663,7 +663,7 @@ deleteVport(virStoragePoolSourceAdapter adapter)
|
||||
goto cleanup;
|
||||
|
||||
ret = 0;
|
||||
cleanup:
|
||||
cleanup:
|
||||
VIR_FREE(name);
|
||||
return ret;
|
||||
}
|
||||
@ -704,7 +704,7 @@ virStorageBackendSCSICheckPool(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
*isActive = virFileExists(path);
|
||||
|
||||
ret = 0;
|
||||
cleanup:
|
||||
cleanup:
|
||||
VIR_FREE(path);
|
||||
VIR_FREE(name);
|
||||
return ret;
|
||||
@ -734,7 +734,7 @@ virStorageBackendSCSIRefreshPool(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
virStorageBackendSCSIFindLUs(pool, host);
|
||||
|
||||
ret = 0;
|
||||
out:
|
||||
out:
|
||||
VIR_FREE(name);
|
||||
return ret;
|
||||
}
|
||||
|
@ -135,7 +135,7 @@ virStorageBackendSheepdogAddVolume(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
error:
|
||||
virStorageVolDefFree(vol);
|
||||
return -1;
|
||||
}
|
||||
@ -178,7 +178,7 @@ virStorageBackendSheepdogRefreshAllVol(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
virCommandFree(cmd);
|
||||
virStringFreeList(lines);
|
||||
virStringFreeList(cells);
|
||||
@ -205,7 +205,7 @@ virStorageBackendSheepdogRefreshPool(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
goto cleanup;
|
||||
|
||||
ret = virStorageBackendSheepdogRefreshAllVol(conn, pool);
|
||||
cleanup:
|
||||
cleanup:
|
||||
virCommandFree(cmd);
|
||||
VIR_FREE(output);
|
||||
return ret;
|
||||
@ -276,7 +276,7 @@ virStorageBackendSheepdogBuildVol(virConnectPtr conn,
|
||||
goto cleanup;
|
||||
|
||||
ret = 0;
|
||||
cleanup:
|
||||
cleanup:
|
||||
virCommandFree(cmd);
|
||||
return ret;
|
||||
}
|
||||
@ -371,7 +371,7 @@ virStorageBackendSheepdogRefreshVol(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
|
||||
VIR_FREE(vol->target.path);
|
||||
ignore_value(VIR_STRDUP(vol->target.path, vol->name));
|
||||
cleanup:
|
||||
cleanup:
|
||||
virCommandFree(cmd);
|
||||
return ret;
|
||||
}
|
||||
|
@ -188,7 +188,7 @@ storageStateInitialize(bool privileged,
|
||||
storageDriverUnlock(driverState);
|
||||
return 0;
|
||||
|
||||
error:
|
||||
error:
|
||||
VIR_FREE(base);
|
||||
storageDriverUnlock(driverState);
|
||||
storageStateCleanup();
|
||||
@ -285,7 +285,7 @@ storagePoolLookupByUUID(virConnectPtr conn,
|
||||
ret = virGetStoragePool(conn, pool->def->name, pool->def->uuid,
|
||||
NULL, NULL);
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
if (pool)
|
||||
virStoragePoolObjUnlock(pool);
|
||||
return ret;
|
||||
@ -315,7 +315,7 @@ storagePoolLookupByName(virConnectPtr conn,
|
||||
ret = virGetStoragePool(conn, pool->def->name, pool->def->uuid,
|
||||
NULL, NULL);
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
if (pool)
|
||||
virStoragePoolObjUnlock(pool);
|
||||
return ret;
|
||||
@ -344,7 +344,7 @@ storagePoolLookupByVolume(virStorageVolPtr vol)
|
||||
ret = virGetStoragePool(vol->conn, pool->def->name, pool->def->uuid,
|
||||
NULL, NULL);
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
if (pool)
|
||||
virStoragePoolObjUnlock(pool);
|
||||
return ret;
|
||||
@ -529,7 +529,7 @@ storageConnectFindStoragePoolSources(virConnectPtr conn,
|
||||
|
||||
ret = backend->findPoolSources(conn, srcSpec, flags);
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -553,7 +553,7 @@ static int storagePoolIsActive(virStoragePoolPtr pool)
|
||||
|
||||
ret = virStoragePoolObjIsActive(obj);
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
if (obj)
|
||||
virStoragePoolObjUnlock(obj);
|
||||
return ret;
|
||||
@ -578,7 +578,7 @@ static int storagePoolIsPersistent(virStoragePoolPtr pool)
|
||||
|
||||
ret = obj->configFile ? 1 : 0;
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
if (obj)
|
||||
virStoragePoolObjUnlock(obj);
|
||||
return ret;
|
||||
@ -638,7 +638,7 @@ storagePoolCreateXML(virConnectPtr conn,
|
||||
ret = virGetStoragePool(conn, pool->def->name, pool->def->uuid,
|
||||
NULL, NULL);
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
virStoragePoolDefFree(def);
|
||||
if (pool)
|
||||
virStoragePoolObjUnlock(pool);
|
||||
@ -688,7 +688,7 @@ storagePoolDefineXML(virConnectPtr conn,
|
||||
ret = virGetStoragePool(conn, pool->def->name, pool->def->uuid,
|
||||
NULL, NULL);
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
virStoragePoolDefFree(def);
|
||||
if (pool)
|
||||
virStoragePoolObjUnlock(pool);
|
||||
@ -745,7 +745,7 @@ storagePoolUndefine(virStoragePoolPtr obj)
|
||||
pool = NULL;
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
if (pool)
|
||||
virStoragePoolObjUnlock(pool);
|
||||
storageDriverUnlock(driver);
|
||||
@ -799,7 +799,7 @@ storagePoolCreate(virStoragePoolPtr obj,
|
||||
pool->active = 1;
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
if (pool)
|
||||
virStoragePoolObjUnlock(pool);
|
||||
return ret;
|
||||
@ -842,7 +842,7 @@ storagePoolBuild(virStoragePoolPtr obj,
|
||||
goto cleanup;
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
if (pool)
|
||||
virStoragePoolObjUnlock(pool);
|
||||
return ret;
|
||||
@ -904,7 +904,7 @@ storagePoolDestroy(virStoragePoolPtr obj)
|
||||
}
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
if (pool)
|
||||
virStoragePoolObjUnlock(pool);
|
||||
storageDriverUnlock(driver);
|
||||
@ -960,7 +960,7 @@ storagePoolDelete(virStoragePoolPtr obj,
|
||||
VIR_INFO("Deleting storage pool '%s'", pool->def->name);
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
if (pool)
|
||||
virStoragePoolObjUnlock(pool);
|
||||
return ret;
|
||||
@ -1021,7 +1021,7 @@ storagePoolRefresh(virStoragePoolPtr obj,
|
||||
}
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
if (pool)
|
||||
virStoragePoolObjUnlock(pool);
|
||||
storageDriverUnlock(driver);
|
||||
@ -1063,7 +1063,7 @@ storagePoolGetInfo(virStoragePoolPtr obj,
|
||||
info->available = pool->def->available;
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
if (pool)
|
||||
virStoragePoolObjUnlock(pool);
|
||||
return ret;
|
||||
@ -1100,7 +1100,7 @@ storagePoolGetXMLDesc(virStoragePoolPtr obj,
|
||||
|
||||
ret = virStoragePoolDefFormat(def);
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
if (pool)
|
||||
virStoragePoolObjUnlock(pool);
|
||||
return ret;
|
||||
@ -1134,7 +1134,7 @@ storagePoolGetAutostart(virStoragePoolPtr obj,
|
||||
}
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
if (pool)
|
||||
virStoragePoolObjUnlock(pool);
|
||||
return ret;
|
||||
@ -1196,7 +1196,7 @@ storagePoolSetAutostart(virStoragePoolPtr obj,
|
||||
}
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
if (pool)
|
||||
virStoragePoolObjUnlock(pool);
|
||||
storageDriverUnlock(driver);
|
||||
@ -1237,7 +1237,7 @@ storagePoolNumOfVolumes(virStoragePoolPtr obj)
|
||||
ret++;
|
||||
}
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
if (pool)
|
||||
virStoragePoolObjUnlock(pool);
|
||||
return ret;
|
||||
@ -1410,7 +1410,7 @@ storageVolLookupByName(virStoragePoolPtr obj,
|
||||
ret = virGetStorageVol(obj->conn, pool->def->name, vol->name, vol->key,
|
||||
NULL, NULL);
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
if (pool)
|
||||
virStoragePoolObjUnlock(pool);
|
||||
return ret;
|
||||
@ -1452,7 +1452,7 @@ storageVolLookupByKey(virConnectPtr conn,
|
||||
virReportError(VIR_ERR_NO_STORAGE_VOL,
|
||||
_("no storage vol with matching key %s"), key);
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
storageDriverUnlock(driver);
|
||||
return ret;
|
||||
}
|
||||
@ -1545,7 +1545,7 @@ storageVolLookupByPath(virConnectPtr conn,
|
||||
}
|
||||
}
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
VIR_FREE(cleanpath);
|
||||
storageDriverUnlock(driver);
|
||||
return ret;
|
||||
@ -1628,7 +1628,7 @@ storageVolDelete(virStorageVolPtr obj,
|
||||
}
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
if (pool)
|
||||
virStoragePoolObjUnlock(pool);
|
||||
return ret;
|
||||
@ -1756,7 +1756,7 @@ storageVolCreateXML(virStoragePoolPtr obj,
|
||||
volobj = NULL;
|
||||
voldef = NULL;
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
virObjectUnref(volobj);
|
||||
virStorageVolDefFree(voldef);
|
||||
VIR_FREE(buildvoldef);
|
||||
@ -1933,7 +1933,7 @@ storageVolCreateXMLFrom(virStoragePoolPtr obj,
|
||||
ret = volobj;
|
||||
volobj = NULL;
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
virObjectUnref(volobj);
|
||||
virStorageVolDefFree(newvol);
|
||||
if (pool)
|
||||
@ -2002,7 +2002,7 @@ storageVolDownload(virStorageVolPtr obj,
|
||||
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
if (pool)
|
||||
virStoragePoolObjUnlock(pool);
|
||||
|
||||
@ -2089,7 +2089,7 @@ storageVolUpload(virStorageVolPtr obj,
|
||||
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
if (pool)
|
||||
virStoragePoolObjUnlock(pool);
|
||||
|
||||
@ -2199,7 +2199,7 @@ storageVolResize(virStorageVolPtr obj,
|
||||
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
if (pool)
|
||||
virStoragePoolObjUnlock(pool);
|
||||
|
||||
@ -2303,7 +2303,7 @@ storageWipeExtent(virStorageVolDefPtr vol,
|
||||
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -2395,7 +2395,7 @@ storageVolWipeInternal(virStorageVolDefPtr def,
|
||||
}
|
||||
}
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
virCommandFree(cmd);
|
||||
VIR_FREE(writebuf);
|
||||
VIR_FORCE_CLOSE(fd);
|
||||
@ -2464,7 +2464,7 @@ storageVolWipePattern(virStorageVolPtr obj,
|
||||
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
if (pool) {
|
||||
virStoragePoolObjUnlock(pool);
|
||||
}
|
||||
@ -2533,7 +2533,7 @@ storageVolGetInfo(virStorageVolPtr obj,
|
||||
info->allocation = vol->allocation;
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
if (pool)
|
||||
virStoragePoolObjUnlock(pool);
|
||||
return ret;
|
||||
@ -2589,7 +2589,7 @@ storageVolGetXMLDesc(virStorageVolPtr obj,
|
||||
|
||||
ret = virStorageVolDefFormat(pool->def, vol);
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
if (pool)
|
||||
virStoragePoolObjUnlock(pool);
|
||||
|
||||
@ -2634,7 +2634,7 @@ storageVolGetPath(virStorageVolPtr obj)
|
||||
|
||||
ignore_value(VIR_STRDUP(ret, vol->target.path));
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
if (pool)
|
||||
virStoragePoolObjUnlock(pool);
|
||||
return ret;
|
||||
@ -2658,7 +2658,7 @@ storageConnectListAllStoragePools(virConnectPtr conn,
|
||||
virConnectListAllStoragePoolsCheckACL, flags);
|
||||
storageDriverUnlock(driver);
|
||||
|
||||
cleanup:
|
||||
cleanup:
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -2779,7 +2779,7 @@ virStorageFileInitInternal(int type,
|
||||
|
||||
return file;
|
||||
|
||||
error:
|
||||
error:
|
||||
VIR_FREE(file->path);
|
||||
virDomainDiskHostDefFree(file->nhosts, file->hosts);
|
||||
VIR_FREE(file);
|
||||
|
Loading…
x
Reference in New Issue
Block a user