summaryrefslogtreecommitdiff
path: root/tools/commands.h
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2016-02-11 12:37:36 -0600
committerDavid Teigland <teigland@redhat.com>2016-05-06 09:00:00 -0500
commitd3d13e134af15611c3f12107aa1627b12110a974 (patch)
tree2091603a65b29199adfdc835c5c6a5865ce1e3a7 /tools/commands.h
parent8b7a78c728be3b9af698dae9344d01752c4cf615 (diff)
downloadlvm2-d3d13e134af15611c3f12107aa1627b12110a974.tar.gz
lvmcache: process duplicate PVs directly
Previously, duplicate PVs were processed as a side effect of processing the "chosen" PV in lvmcache. The duplicate PV would be hacked into lvmcache temporarily in place of the chosen PV. In the old way, we had to always process the "chosen" PV device, even if a duplicate of it was named on the command line. This meant we were processing a different device than was asked for. This could be worked around by naming multiple duplicate devs on the command line in which case they were swapped in and out of lvmcache for processing. Now, the duplicate devs are processed directly in their own processing loop. This means we can remove the old hacks related to processing dups as a side effect of processing the chosen device. We can now simply process the device that was named on the command line. When the same PVID exists on two or more devices, one device is preferred and used in the VG, and the others are duplicates and are not used in the VG. The preferred device exists in lvmcache as usual. The duplicates exist in a specical list of unused duplicate devices. The duplicate devs have the "d" attribute and the "duplicate" reporting field displays "duplicate" for them. 'pvs' warns about duplicates, but the formal output only includes the single preferred PV. 'pvs -a' has the same warnings, and the duplicate devs are included in the output. 'pvs <path>' has the same warnings, and displays the named device, whether it is preferred or a duplicate.
Diffstat (limited to 'tools/commands.h')
-rw-r--r--tools/commands.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/commands.h b/tools/commands.h
index f49e57f22..7b32835ea 100644
--- a/tools/commands.h
+++ b/tools/commands.h
@@ -824,7 +824,7 @@ xx(pvdata,
xx(pvdisplay,
"Display various attributes of physical volume(s)",
- CACHE_VGMETADATA | PERMITTED_READ_ONLY | ENABLE_ALL_DEVS | LOCKD_VG_SH,
+ CACHE_VGMETADATA | PERMITTED_READ_ONLY | ENABLE_ALL_DEVS | ENABLE_DUPLICATE_DEVS | LOCKD_VG_SH,
"pvdisplay\n"
"\t[-c|--colon]\n"
"\t[--commandprofile ProfileName]\n"
@@ -933,7 +933,7 @@ xx(pvremove,
xx(pvs,
"Display information about physical volumes",
- CACHE_VGMETADATA | PERMITTED_READ_ONLY | ALL_VGS_IS_DEFAULT | ENABLE_ALL_DEVS | LOCKD_VG_SH,
+ CACHE_VGMETADATA | PERMITTED_READ_ONLY | ALL_VGS_IS_DEFAULT | ENABLE_ALL_DEVS | ENABLE_DUPLICATE_DEVS | LOCKD_VG_SH,
"pvs\n"
"\t[-a|--all]\n"
"\t[--aligned]\n"