diff options
Diffstat (limited to 'tools/vgscan.c')
-rw-r--r-- | tools/vgscan.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/tools/vgscan.c b/tools/vgscan.c index 4e12914..99124ef 100644 --- a/tools/vgscan.c +++ b/tools/vgscan.c @@ -19,9 +19,9 @@ static int vgscan_single(struct cmd_context *cmd, const char *vg_name, struct volume_group *vg, void *handle __attribute__((unused))) { - log_print("Found %svolume group \"%s\" using metadata type %s", - vg_is_exported(vg) ? "exported " : "", vg_name, - vg->fid->fmt->name); + log_print_unless_silent("Found %svolume group \"%s\" using metadata type %s", + vg_is_exported(vg) ? "exported " : "", vg_name, + vg->fid->fmt->name); check_current_backup(vg); @@ -42,10 +42,23 @@ int vgscan(struct cmd_context *cmd, int argc, char **argv) return ECMD_FAILED; } - persistent_filter_wipe(cmd->filter); + if (cmd->filter->wipe) + cmd->filter->wipe(cmd->filter); lvmcache_destroy(cmd, 1); - log_print("Reading all physical volumes. This may take a while..."); + if (arg_count(cmd, cache_ARG)) { + if (lvmetad_active()) { + if (!lvmetad_pvscan_all_devs(cmd, NULL)) + return ECMD_FAILED; + } + else { + log_error("Cannot proceed since lvmetad is not active."); + unlock_vg(cmd, VG_GLOBAL); + return ECMD_FAILED; + } + } + + log_print_unless_silent("Reading all physical volumes. This may take a while..."); maxret = process_each_vg(cmd, argc, argv, 0, NULL, &vgscan_single); |