From 1248f94a429faa245968a9efe04250f27a53bc18 Mon Sep 17 00:00:00 2001 From: David Teigland Date: Wed, 25 Feb 2015 15:41:15 -0600 Subject: [PATCH] pvscan, vgscan: include foreign vgs with --cache pvscan --cache and vgscan --cache scan devices to refresh lvmetad, and they should also refresh the lvmetad copy of foreign vgs. --- tools/commands.h | 2 +- tools/pvscan.c | 2 ++ tools/vgscan.c | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/commands.h b/tools/commands.h index 5cd7c2d15..719c507b7 100644 --- a/tools/commands.h +++ b/tools/commands.h @@ -616,7 +616,7 @@ xx(lvs, xx(lvscan, "List all logical volumes in all volume groups", - PERMITTED_READ_ONLY | ALL_VGS_IS_DEFAULT | ENABLE_FOREIGN_VGS, + PERMITTED_READ_ONLY | ALL_VGS_IS_DEFAULT, "lvscan\n" "\t[-a|--all]\n" "\t[-b|--blockdevice]\n" diff --git a/tools/pvscan.c b/tools/pvscan.c index 4ab2ff796..a04a4b282 100644 --- a/tools/pvscan.c +++ b/tools/pvscan.c @@ -189,6 +189,8 @@ static int _pvscan_lvmetad(struct cmd_context *cmd, int argc, char **argv) dev_t devno; activation_handler handler = NULL; + cmd->include_foreign_vgs = 1; + /* * Return here immediately if lvmetad is not used. * Also return if locking_type=3 (clustered) as we diff --git a/tools/vgscan.c b/tools/vgscan.c index b3af9bca0..7328a096d 100644 --- a/tools/vgscan.c +++ b/tools/vgscan.c @@ -47,6 +47,8 @@ int vgscan(struct cmd_context *cmd, int argc, char **argv) lvmcache_destroy(cmd, 1, 0); if (arg_count(cmd, cache_long_ARG)) { + cmd->include_foreign_vgs = 1; + if (lvmetad_active()) { if (!lvmetad_pvscan_all_devs(cmd, NULL)) return ECMD_FAILED;