mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-30 17:45:23 +00:00
storage: don't shadow global 'wait' declaration
Rename the 'wait' parameter to 'loop'.
This silences the warning:
storage/storage_backend.c:1348:34: error: declaration of 'wait' shadows
a global declaration [-Werror=shadow]
and fixes the build with -Werror.
--
Note: loop is pool backwards.
(cherry picked from commit b326765c80
)
This commit is contained in:
parent
bd098c1143
commit
03bf498f2c
@ -1339,13 +1339,13 @@ virStorageBackendDetectBlockVolFormatFD(virStorageVolTargetPtr target,
|
|||||||
* Typically target.path is one of the /dev/disk/by-XXX dirs
|
* Typically target.path is one of the /dev/disk/by-XXX dirs
|
||||||
* with stable paths.
|
* with stable paths.
|
||||||
*
|
*
|
||||||
* If 'wait' is true, we use a timeout loop to give dynamic paths
|
* If 'loop' is true, we use a timeout loop to give dynamic paths
|
||||||
* a change to appear.
|
* a change to appear.
|
||||||
*/
|
*/
|
||||||
char *
|
char *
|
||||||
virStorageBackendStablePath(virStoragePoolObjPtr pool,
|
virStorageBackendStablePath(virStoragePoolObjPtr pool,
|
||||||
const char *devpath,
|
const char *devpath,
|
||||||
bool wait)
|
bool loop)
|
||||||
{
|
{
|
||||||
DIR *dh;
|
DIR *dh;
|
||||||
struct dirent *dent;
|
struct dirent *dent;
|
||||||
@ -1376,7 +1376,7 @@ virStorageBackendStablePath(virStoragePoolObjPtr pool,
|
|||||||
reopen:
|
reopen:
|
||||||
if ((dh = opendir(pool->def->target.path)) == NULL) {
|
if ((dh = opendir(pool->def->target.path)) == NULL) {
|
||||||
opentries++;
|
opentries++;
|
||||||
if (wait && errno == ENOENT && opentries < 50) {
|
if (loop && errno == ENOENT && opentries < 50) {
|
||||||
usleep(100 * 1000);
|
usleep(100 * 1000);
|
||||||
goto reopen;
|
goto reopen;
|
||||||
}
|
}
|
||||||
@ -1415,7 +1415,7 @@ virStorageBackendStablePath(virStoragePoolObjPtr pool,
|
|||||||
VIR_FREE(stablepath);
|
VIR_FREE(stablepath);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wait && ++retry < 100) {
|
if (loop && ++retry < 100) {
|
||||||
usleep(100 * 1000);
|
usleep(100 * 1000);
|
||||||
goto retry;
|
goto retry;
|
||||||
}
|
}
|
||||||
|
@ -131,7 +131,7 @@ virStorageBackendDetectBlockVolFormatFD(virStorageVolTargetPtr target,
|
|||||||
|
|
||||||
char *virStorageBackendStablePath(virStoragePoolObjPtr pool,
|
char *virStorageBackendStablePath(virStoragePoolObjPtr pool,
|
||||||
const char *devpath,
|
const char *devpath,
|
||||||
bool wait);
|
bool loop);
|
||||||
|
|
||||||
typedef int (*virStorageBackendListVolRegexFunc)(virStoragePoolObjPtr pool,
|
typedef int (*virStorageBackendListVolRegexFunc)(virStoragePoolObjPtr pool,
|
||||||
char **const groups,
|
char **const groups,
|
||||||
|
Loading…
Reference in New Issue
Block a user