1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-23 21:34:54 +03:00

storage: Rename UpdateVolInfoFlags to UpdateVolInfo

And drop the original UpdateVolInfo. Makes it a bit easier to follow
the function usage.

And change the int parameter to an explicit bool.
This commit is contained in:
Cole Robinson 2014-03-30 18:27:14 -04:00
parent 968aae48c9
commit 16d75d19fc
5 changed files with 11 additions and 18 deletions

View File

@ -1338,9 +1338,9 @@ virStorageBackendUpdateVolTargetInfo(virStorageVolTargetPtr target,
}
int
virStorageBackendUpdateVolInfoFlags(virStorageVolDefPtr vol,
int withCapacity,
unsigned int openflags)
virStorageBackendUpdateVolInfo(virStorageVolDefPtr vol,
bool withCapacity,
unsigned int openflags)
{
int ret;
@ -1359,13 +1359,6 @@ virStorageBackendUpdateVolInfoFlags(virStorageVolDefPtr vol,
return 0;
}
int virStorageBackendUpdateVolInfo(virStorageVolDefPtr vol,
int withCapacity)
{
return virStorageBackendUpdateVolInfoFlags(vol, withCapacity,
VIR_STORAGE_VOL_OPEN_DEFAULT);
}
/*
* virStorageBackendUpdateVolTargetInfoFD:
* @target: target definition ptr of volume to update

View File

@ -138,10 +138,8 @@ int virStorageBackendVolOpenCheckMode(const char *path, struct stat *sb,
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
int virStorageBackendUpdateVolInfo(virStorageVolDefPtr vol,
int withCapacity);
int virStorageBackendUpdateVolInfoFlags(virStorageVolDefPtr vol,
int withCapacity,
unsigned int openflags);
bool withCapacity,
unsigned int openflags);
int virStorageBackendUpdateVolTargetInfo(virStorageVolTargetPtr target,
unsigned long long *allocation,
unsigned long long *capacity,

View File

@ -113,7 +113,8 @@ virStorageBackendDiskMakeDataVol(virStoragePoolObjPtr pool,
}
/* Refresh allocation/capacity/perms */
if (virStorageBackendUpdateVolInfo(vol, 1) < 0)
if (virStorageBackendUpdateVolInfo(vol, true,
VIR_STORAGE_VOL_OPEN_DEFAULT) < 0)
return -1;
/* set partition type */

View File

@ -1180,8 +1180,8 @@ virStorageBackendFileSystemVolRefresh(virConnectPtr conn,
int ret;
/* Refresh allocation / permissions info in case its changed */
ret = virStorageBackendUpdateVolInfoFlags(vol, 0,
VIR_STORAGE_VOL_FS_OPEN_FLAGS);
ret = virStorageBackendUpdateVolInfo(vol, false,
VIR_STORAGE_VOL_FS_OPEN_FLAGS);
if (ret < 0)
return ret;

View File

@ -149,7 +149,8 @@ virStorageBackendLogicalMakeVol(char **const groups,
if (!vol->key && VIR_STRDUP(vol->key, groups[2]) < 0)
goto cleanup;
if (virStorageBackendUpdateVolInfo(vol, 1) < 0)
if (virStorageBackendUpdateVolInfo(vol, true,
VIR_STORAGE_VOL_OPEN_DEFAULT) < 0)
goto cleanup;
nextents = 1;