mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-04 09:18:36 +03:00
lvmetad: Make --sysinit suppress connection failure warnings.
This commit is contained in:
parent
9ee071705b
commit
28776b9526
9
lib/cache/lvmetad.c
vendored
9
lib/cache/lvmetad.c
vendored
@ -49,10 +49,15 @@ void lvmetad_init(struct cmd_context *cmd)
|
|||||||
if (_lvmetad.socket_fd >= 0 && !_lvmetad.error) {
|
if (_lvmetad.socket_fd >= 0 && !_lvmetad.error) {
|
||||||
_lvmetad_connected = 1;
|
_lvmetad_connected = 1;
|
||||||
_lvmetad_cmd = cmd;
|
_lvmetad_cmd = cmd;
|
||||||
} else
|
|
||||||
log_warn("WARNING: Failed to connect to lvmetad: %s. Falling back to internal scanning.", strerror(_lvmetad.error));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void lvmetad_warning()
|
||||||
|
{
|
||||||
|
log_warn("WARNING: Failed to connect to lvmetad: %s. Falling back to internal scanning.",
|
||||||
|
strerror(_lvmetad.error));
|
||||||
|
}
|
||||||
|
|
||||||
int lvmetad_active(void)
|
int lvmetad_active(void)
|
||||||
{
|
{
|
||||||
|
4
lib/cache/lvmetad.h
vendored
4
lib/cache/lvmetad.h
vendored
@ -48,6 +48,9 @@ void lvmetad_set_socket(const char *);
|
|||||||
*/
|
*/
|
||||||
int lvmetad_active(void);
|
int lvmetad_active(void);
|
||||||
|
|
||||||
|
/* Print a warning if lvmetad is enabled but we failed to connect. */
|
||||||
|
void lvmetad_warning(void);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Drop connection to lvmetad. A subsequent lvmetad_init() will re-establish
|
* Drop connection to lvmetad. A subsequent lvmetad_init() will re-establish
|
||||||
* the connection (possibly at a different socket path).
|
* the connection (possibly at a different socket path).
|
||||||
@ -137,6 +140,7 @@ int lvmetad_pvscan_all_devs(struct cmd_context *cmd, activation_handler handler)
|
|||||||
# define lvmetad_set_active(a) do { } while (0)
|
# define lvmetad_set_active(a) do { } while (0)
|
||||||
# define lvmetad_set_socket(a) do { } while (0)
|
# define lvmetad_set_socket(a) do { } while (0)
|
||||||
# define lvmetad_active() (0)
|
# define lvmetad_active() (0)
|
||||||
|
# define lvmetad_warning() do { } while (0)
|
||||||
# define lvmetad_set_token(a) do { } while (0)
|
# define lvmetad_set_token(a) do { } while (0)
|
||||||
# define lvmetad_vg_update(vg) (1)
|
# define lvmetad_vg_update(vg) (1)
|
||||||
# define lvmetad_vg_remove(vg) (1)
|
# define lvmetad_vg_remove(vg) (1)
|
||||||
|
@ -876,6 +876,9 @@ static int _get_settings(struct cmd_context *cmd)
|
|||||||
else
|
else
|
||||||
init_ignorelockingfailure(0);
|
init_ignorelockingfailure(0);
|
||||||
|
|
||||||
|
if (!arg_count(cmd, sysinit_ARG))
|
||||||
|
lvmetad_warning();
|
||||||
|
|
||||||
if (arg_count(cmd, nosuffix_ARG))
|
if (arg_count(cmd, nosuffix_ARG))
|
||||||
cmd->current_settings.suffix = 0;
|
cmd->current_settings.suffix = 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user