diff options
author | David Teigland <teigland@redhat.com> | 2015-02-25 10:44:42 -0600 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2015-02-25 10:53:52 -0600 |
commit | 8668a9e81c5bde921c9c8e6ba1162c5d4f7ffbe5 (patch) | |
tree | ba9e53cd24b9cdf0820ad1342f16ae390e9f85ed /tools/lvmcmdline.c | |
parent | 4ff9abd01f60e3bfe433da5596078a12fb49f9eb (diff) | |
download | lvm2-8668a9e81c5bde921c9c8e6ba1162c5d4f7ffbe5.tar.gz |
systemid: silently ignore foreign vgs unless named
A foreign VG should be silently ignored by a reporting/display
command like 'vgs'. If the reporting/display command specifies
a foreign VG by name on the command line, it should produce an
error message.
Scanning commands pvscan/vgscan/lvscan are always allowed to
read and update caches from all PVs, including those that belong
to foreign VGs.
Other non-report/display/scan commands always ignore a foreign
VG, or report an error if they attempt to use a foreign VG.
vgimport should always invalidate the lvmetad cache because
lvmetad likely holds a pre-vgexported copy of the VG.
(This is unrelated to using foreign VGs; the pre-vgexported
VG may have had no system_id at all.)
Diffstat (limited to 'tools/lvmcmdline.c')
-rw-r--r-- | tools/lvmcmdline.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c index b38039bae..7a1118376 100644 --- a/tools/lvmcmdline.c +++ b/tools/lvmcmdline.c @@ -1075,9 +1075,9 @@ static int _get_settings(struct cmd_context *cmd) init_ignorelockingfailure(0); cmd->ignore_clustered_vgs = arg_is_set(cmd, ignoreskippedcluster_ARG); - cmd->include_foreign_vgs = - ((cmd->command->flags & NEEDS_FOREIGN_VGS) || arg_is_set(cmd, foreign_ARG)) ? 1 : 0; - + cmd->error_foreign_vgs = cmd->command->flags & ENABLE_FOREIGN_VGS ? 0 : 1; + cmd->include_foreign_vgs = arg_is_set(cmd, foreign_ARG) ? 1 : 0; + if (!arg_count(cmd, sysinit_ARG)) lvmetad_connect_or_warn(); |