mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 19:41:16 +00:00
util: Rename virFileWaitForDevices
The function is actually in virutil.c, but prototyped in virfile.h. This patch fixes that by renaming the function to virWaitForDevices, adding the prototype in virutil.h and libvirt_private.syms, and then changing the callers to use the new name. Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
a7ce03c736
commit
97e0d3c3c9
@ -1650,7 +1650,6 @@ virFileStripSuffix;
|
|||||||
virFileTouch;
|
virFileTouch;
|
||||||
virFileUnlock;
|
virFileUnlock;
|
||||||
virFileUpdatePerm;
|
virFileUpdatePerm;
|
||||||
virFileWaitForDevices;
|
|
||||||
virFileWrapperFdClose;
|
virFileWrapperFdClose;
|
||||||
virFileWrapperFdFree;
|
virFileWrapperFdFree;
|
||||||
virFileWrapperFdNew;
|
virFileWrapperFdNew;
|
||||||
@ -2760,6 +2759,7 @@ virTristateSwitchTypeFromString;
|
|||||||
virTristateSwitchTypeToString;
|
virTristateSwitchTypeToString;
|
||||||
virUpdateSelfLastChanged;
|
virUpdateSelfLastChanged;
|
||||||
virValidateWWN;
|
virValidateWWN;
|
||||||
|
virWaitForDevices;
|
||||||
|
|
||||||
|
|
||||||
# util/viruuid.h
|
# util/viruuid.h
|
||||||
|
@ -548,7 +548,7 @@ find_new_device(virConnectPtr conn, const char *wwnn, const char *wwpn)
|
|||||||
|
|
||||||
while ((now - start) < LINUX_NEW_DEVICE_WAIT_TIME) {
|
while ((now - start) < LINUX_NEW_DEVICE_WAIT_TIME) {
|
||||||
|
|
||||||
virFileWaitForDevices();
|
virWaitForDevices();
|
||||||
|
|
||||||
dev = nodeDeviceLookupSCSIHostByWWN(conn, wwnn, wwpn, 0);
|
dev = nodeDeviceLookupSCSIHostByWWN(conn, wwnn, wwpn, 0);
|
||||||
|
|
||||||
|
@ -426,7 +426,7 @@ virStorageBackendDiskRefreshPool(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|||||||
VIR_FREE(pool->def->source.devices[0].freeExtents);
|
VIR_FREE(pool->def->source.devices[0].freeExtents);
|
||||||
pool->def->source.devices[0].nfreeExtent = 0;
|
pool->def->source.devices[0].nfreeExtent = 0;
|
||||||
|
|
||||||
virFileWaitForDevices();
|
virWaitForDevices();
|
||||||
|
|
||||||
if (!virFileExists(pool->def->source.devices[0].path)) {
|
if (!virFileExists(pool->def->source.devices[0].path)) {
|
||||||
virReportError(VIR_ERR_INVALID_ARG,
|
virReportError(VIR_ERR_INVALID_ARG,
|
||||||
@ -450,7 +450,7 @@ virStorageBackendDiskStartPool(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|||||||
virStoragePoolFormatDiskTypeToString(pool->def->source.format);
|
virStoragePoolFormatDiskTypeToString(pool->def->source.format);
|
||||||
const char *path = pool->def->source.devices[0].path;
|
const char *path = pool->def->source.devices[0].path;
|
||||||
|
|
||||||
virFileWaitForDevices();
|
virWaitForDevices();
|
||||||
|
|
||||||
if (!virFileExists(path)) {
|
if (!virFileExists(path)) {
|
||||||
virReportError(VIR_ERR_INVALID_ARG,
|
virReportError(VIR_ERR_INVALID_ARG,
|
||||||
@ -859,7 +859,7 @@ virStorageBackendDiskCreateVol(virConnectPtr conn,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
/* wait for device node to show up */
|
/* wait for device node to show up */
|
||||||
virFileWaitForDevices();
|
virWaitForDevices();
|
||||||
|
|
||||||
/* Blow away free extent info, as we're about to re-populate it */
|
/* Blow away free extent info, as we're about to re-populate it */
|
||||||
VIR_FREE(pool->def->source.devices[0].freeExtents);
|
VIR_FREE(pool->def->source.devices[0].freeExtents);
|
||||||
|
@ -98,7 +98,7 @@ virStorageBackendISCSIGetHostNumber(const char *sysfs_path,
|
|||||||
|
|
||||||
VIR_DEBUG("Finding host number from '%s'", sysfs_path);
|
VIR_DEBUG("Finding host number from '%s'", sysfs_path);
|
||||||
|
|
||||||
virFileWaitForDevices();
|
virWaitForDevices();
|
||||||
|
|
||||||
if (virDirOpen(&sysdir, sysfs_path) < 0)
|
if (virDirOpen(&sysdir, sysfs_path) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
@ -831,7 +831,7 @@ virStorageBackendLogicalRefreshPool(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|||||||
virCommandPtr cmd = NULL;
|
virCommandPtr cmd = NULL;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
virFileWaitForDevices();
|
virWaitForDevices();
|
||||||
|
|
||||||
/* Get list of all logical volumes */
|
/* Get list of all logical volumes */
|
||||||
if (virStorageBackendLogicalFindLVs(pool, NULL) < 0)
|
if (virStorageBackendLogicalFindLVs(pool, NULL) < 0)
|
||||||
@ -925,7 +925,7 @@ virStorageBackendLogicalDeleteVol(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|||||||
|
|
||||||
virCheckFlags(0, -1);
|
virCheckFlags(0, -1);
|
||||||
|
|
||||||
virFileWaitForDevices();
|
virWaitForDevices();
|
||||||
|
|
||||||
lvchange_cmd = virCommandNewArgList(LVCHANGE, "-aln", vol->target.path, NULL);
|
lvchange_cmd = virCommandNewArgList(LVCHANGE, "-aln", vol->target.path, NULL);
|
||||||
lvremove_cmd = virCommandNewArgList(LVREMOVE, "-f", vol->target.path, NULL);
|
lvremove_cmd = virCommandNewArgList(LVREMOVE, "-f", vol->target.path, NULL);
|
||||||
|
@ -262,7 +262,7 @@ virStorageBackendMpathRefreshPool(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|||||||
|
|
||||||
pool->def->allocation = pool->def->capacity = pool->def->available = 0;
|
pool->def->allocation = pool->def->capacity = pool->def->available = 0;
|
||||||
|
|
||||||
virFileWaitForDevices();
|
virWaitForDevices();
|
||||||
|
|
||||||
virStorageBackendGetMaps(pool);
|
virStorageBackendGetMaps(pool);
|
||||||
|
|
||||||
|
@ -347,7 +347,7 @@ createVport(virConnectPtr conn,
|
|||||||
VPORT_CREATE) < 0)
|
VPORT_CREATE) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
virFileWaitForDevices();
|
virWaitForDevices();
|
||||||
|
|
||||||
/* Creating our own VPORT didn't leave enough time to find any LUN's,
|
/* Creating our own VPORT didn't leave enough time to find any LUN's,
|
||||||
* so, let's create a thread whose job it is to call the FindLU's with
|
* so, let's create a thread whose job it is to call the FindLU's with
|
||||||
|
@ -4017,7 +4017,7 @@ virStorageBackendSCSIFindLUs(virStoragePoolObjPtr pool,
|
|||||||
|
|
||||||
VIR_DEBUG("Discovering LUs on host %u", scanhost);
|
VIR_DEBUG("Discovering LUs on host %u", scanhost);
|
||||||
|
|
||||||
virFileWaitForDevices();
|
virWaitForDevices();
|
||||||
|
|
||||||
if (virDirOpen(&devicedir, device_path) < 0)
|
if (virDirOpen(&devicedir, device_path) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -292,8 +292,6 @@ int virFileOpenTty(int *ttymaster,
|
|||||||
|
|
||||||
char *virFileFindMountPoint(const char *type);
|
char *virFileFindMountPoint(const char *type);
|
||||||
|
|
||||||
void virFileWaitForDevices(void);
|
|
||||||
|
|
||||||
/* NB: this should be combined with virFileBuildPath */
|
/* NB: this should be combined with virFileBuildPath */
|
||||||
# define virBuildPath(path, ...) \
|
# define virBuildPath(path, ...) \
|
||||||
virBuildPathInternal(path, __VA_ARGS__, NULL)
|
virBuildPathInternal(path, __VA_ARGS__, NULL)
|
||||||
|
@ -1582,7 +1582,7 @@ virSetUIDGIDWithCaps(uid_t uid, gid_t gid, gid_t *groups, int ngroups,
|
|||||||
|
|
||||||
|
|
||||||
#if defined(UDEVADM) || defined(UDEVSETTLE)
|
#if defined(UDEVADM) || defined(UDEVSETTLE)
|
||||||
void virFileWaitForDevices(void)
|
void virWaitForDevices(void)
|
||||||
{
|
{
|
||||||
# ifdef UDEVADM
|
# ifdef UDEVADM
|
||||||
const char *const settleprog[] = { UDEVADM, "settle", NULL };
|
const char *const settleprog[] = { UDEVADM, "settle", NULL };
|
||||||
@ -1603,7 +1603,7 @@ void virFileWaitForDevices(void)
|
|||||||
ignore_value(virRun(settleprog, &exitstatus));
|
ignore_value(virRun(settleprog, &exitstatus));
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
void virFileWaitForDevices(void)
|
void virWaitForDevices(void)
|
||||||
{}
|
{}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -51,6 +51,8 @@ int virSetUIDGIDWithCaps(uid_t uid, gid_t gid, gid_t *groups, int ngroups,
|
|||||||
unsigned long long capBits,
|
unsigned long long capBits,
|
||||||
bool clearExistingCaps);
|
bool clearExistingCaps);
|
||||||
|
|
||||||
|
void virWaitForDevices(void);
|
||||||
|
|
||||||
int virScaleInteger(unsigned long long *value, const char *suffix,
|
int virScaleInteger(unsigned long long *value, const char *suffix,
|
||||||
unsigned long long scale, unsigned long long limit)
|
unsigned long long scale, unsigned long long limit)
|
||||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
|
||||||
|
Loading…
Reference in New Issue
Block a user