summaryrefslogtreecommitdiff
path: root/scripts/command-lines.in
blob: 17ba2df17c1be54bc207d7dfa0a8ca7a214137a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
#
# When this file is changed, tools/command-lines.h
# and tools/command-lines-count.h must be regenerated
# with:
#
# scripts/create-commands --output count scripts/command-lines.in > tools/command-lines-count.h
# scripts/create-commands --output struct scripts/command-lines.in > tools/command-lines.h
#

#
# Syntax
#
# A new command has a unique combination of:
# command name, required option args and required
# positional args.
#
# To define a new command, begin a single line with a
# command name, followed by required options/args,
# (e.g. --foo, or --foo val), followed by required
# positional args, (e.g. VG)
#
# After the single line of required elements are lines
# of optional elements:
# OO: <optional --option args>
# OP: <optional positional args>
#
# command_name required_opt_arg ... required_pos_arg ...
# OO: optional_opt_arg, ...
# OP: optional_pos_arg ...
#
# required_opt_arg/optional_opt_arg must begin with the
# long form option name, e.g. --foo.  If the option name
# takes a value, then the type of value is specified,
# e.g. --foo String.
#
# Possible option names are listed in args.h
#
# Use --foo_long to specify that only the long form of
# --foo is accepted by the command.  (This is uncommon.)
#
# Possible option arg types are shown in tools/vals.h,
# e.g. Bool, String, VG, SizeMB.
#
# --option args outside the list of types in vals.h are treated
# as literal (non-variable) strings or numbers.
#
# positional args can be multiple types separated by |, e.g. VG|LV|Tag
#
# If a positional arg is repeatable, it is followed by ..., e.g. VG|LV|Tag ...
#
# LV can have a suffix indicating the LV type, e.g. LV_linear, LV_thinpool.
# LV_raid represents any raidN.  LV_type1_type2_type3 when the LV is
# limited to multiple specific types.
#
# Note that two commands whose required paramters differ only by
# the LV types they accept are ambiguous.  That is, they cannot be
# distinguished by just looking at the command, but require reading
# the VG to find the LV type.  So, command definitions that differ
# only in accepted LV types are not allowed.  It would be best to
# distinguish them by using different option names.
# There are FIXME's below for some of these cases.
#
# VG, LV can have the suffix _new, indicating the named VG or LV
# does not yet exist.
#
# If Select is included in pos_arg, it means that the pos_arg
# may be empty if the --select option is used.
#
# --size and --extents are interchangable, but only --size is used
# in these definitions to keep them simpler.  --extents is
# automatically included and recognized as an alternative to --size.
#
# lvcreate generally requires a VG arg in position 1 and does not
# require the --name option (when --name is omitted, a name is
# generated).  But, all commands of that form have a variant which
# is not defined here, but which is automatically recognized as
# being equivalent.  That variant allows the required VG arg to
# be omitted when --name VG/LV is specified, or when the
# LVM_VG_NAME env var is set and --name LV is specified.
# The lvcreate variants with --name and without a VG arg are
# automatically recognized as an alternative to the defined
# command forms requiring the VG and no --name.
# Also, --thinpool VG/LV or --cachepool VG/LV can be used in
# place of --name to provide the VG name instead of pos 1.
#
# Some options have multiple names, but only one form of the name
# is used in these definitions.  Synonyms will be recognized when
# matching a command to a command definition.
#
# used in definitions below (equivalent but not used in definitions)
# mirrorlog core (not corelog)
# resizeable (resizable or allocation)
# allocatable (allocation)
# activate (available)
# rebuild (raidrebuild)
# syncaction (raidsyncaction)
# writemostly (raidwritemostly)
# minrecoveryrate (raidminrecoveryrate)
# maxrecoveryrate (raidmaxrecoveryrate)
# writebehind (raidwritebehind)
# virtualsize (virtualoriginsize)
#
# metadatacopies/pvmetadatacopies/vgmetadatacopies are not considered
# synonyms for the purpose of command definitions, but each variant is
# specified when it is accepted.
#
# "---" is like a comment line, used to separate text for readability
#
# ID: A unique string identifying the command.  Two commands that do
# the same thing, but are alternate syntaxes can share the same ID,
# in which case the implementation would have to sort out which
# args to look at for the required parameters.  Or, the two commands
# could use differnet IDs, in which case the implementation would
# know where to look for each parameter.
#
# DESC: A description of the command.
#

#
# For efficiency, sets of options can be defined and reused
# in multiple command definitions.
#
# To define a common set of options:
# OO_NAME: --foo, --bar String
#
# To use this set of options, include it on the OO: line, e.g.
# OO: --example, OO_NAME
#
# which is expaneded to
# OO: --example, --foo, --bar String
#
# Including OO_NAME after a command name on the required line
# means that any one of the options is required and the rest
# are optional.  The usage syntax for this case is printed as:
# command (--foo A, --bar B)
#

#
# OO_ALL is included in every command automatically.
# FIXME: add --force and --test to OO_ALL so that all commands will
# accept them even if they are not used?
#
OO_ALL: --commandprofile String, --config String, --debug,
--driverloaded Bool, --help, --profile String, --quiet,
--verbose, --version, --yes

#
# This list only applies to printing the usage text.
# These common options are displayed once at the end of
# a given command's usage.  This is done to avoid excessive
# repetition of common options, which may obscure the more
# interesting and relevant parts of a common prototype.
# This definition is *only* used when generating the command
# usage strings, and is the basis for the division between
# the "usage" and "usage_common" strings. This OO defn does
# not relate to which optional opts are accepted by commands,
# which is defined by the OO line.
#
OO_USAGE_COMMON: OO_ALL, --force, --test, --noudevsync

#
# options for pvs, lvs, vgs, fullreport
#
OO_REPORT: --aligned, --all, --binary, --configreport String, --foreign,
--ignorelockingfailure, --ignoreskippedcluster, --logonly,
--nameprefixes, --noheadings, --nolocking, --nosuffix,
--options String, --partial, --readonly, --reportformat String, --rows,
--select String, --separator String, --shared, --sort String,
--trustcache, --unbuffered, --units Units, --unquoted

#
# options for config, dumpconfig, lvmconfig
#
OO_CONFIG: --atversion String, --typeconfig String, --file String, --ignoreadvanced,
--ignoreunsupported, --ignorelocal, --list, --mergedconfig, --metadataprofile String,
--sinceversion String, --showdeprecated, --showunsupported, --validate, --withsummary,
--withcomments, --withspaces, --unconfigured, --withversions

---

# None of these can function as a required option for lvchange.

OO_LVCHANGE: --autobackup Bool, --force, --ignorelockingfailure,
--ignoremonitoring, --ignoreskippedcluster, --noudevsync,
--reportformat String, --sysinit, --test, --select String

# Any of these can function as a required option for lvchange.
# profile is also part of OO_ALL, but is repeated in OO_LVCHANGE_META
# because it can function as a required opt.

OO_LVCHANGE_META: --addtag Tag, --deltag Tag,
--alloc Alloc, --contiguous Bool,
--detachprofile, --metadataprofile String, --profile String,
--permission Permission, --readahead Readahead, --setactivationskip Bool,
--errorwhenfull Bool, --discards Discards, --zero Bool,
--cachemode CacheMode, --cachepolicy String, --cachesettings String,
--minrecoveryrate SizeKB, --maxrecoveryrate SizeKB,
--writebehind Number, --writemostly PV

lvchange OO_LVCHANGE_META VG|LV|Tag|Select ...
OO: OO_LVCHANGE
ID: lvchange_properties
DESC: Change a general LV property.

lvchange --resync VG|LV|Tag|Select ...
OO: OO_LVCHANGE
ID: lvchange_resync

lvchange --syncaction String VG|LV|Tag|Select ...
OO: OO_LVCHANGE
ID: lvchange_syncaction

lvchange --rebuild PV VG|LV|Tag|Select ...
OO: OO_LVCHANGE
ID: lvchange_rebuild

lvchange --activate Active VG|LV|Tag|Select ...
OO: --activationmode ActivationMode, --partial, --ignoreactivationskip, OO_LVCHANGE_META, OO_LVCHANGE
ID: lvchange_activate
DESC: Activate or deactivate an LV.

lvchange --refresh VG|LV|Tag|Select ...
OO: --partial, OO_LVCHANGE
ID: lvchange_refresh

lvchange --monitor Bool VG|LV|Tag|Select ...
OO: --poll Bool, OO_LVCHANGE
ID: lvchange_monitor
DESC: Monitor or unmonitor an LV.

lvchange --poll Bool VG|LV|Tag|Select ...
OO: --monitor Bool, OO_LVCHANGE
ID: lvchange_poll

lvchange --persistent Bool VG|LV|Tag|Select ...
OO: --minor Number, --major Number, OO_LVCHANGE
ID: lvchange_persistent

---

OO_LVCONVERT_RAID: --mirrors SNumber, --stripes_long Number,
--stripesize SizeKB, --regionsize SizeMB, --interval Number

OO_LVCONVERT_POOL: --poolmetadata LV, --poolmetadatasize SizeMB,
--poolmetadataspare Bool, --readahead Readahead, --chunksize SizeKB

OO_LVCONVERT: --alloc Alloc, --background, --force, --noudevsync,
--test, --usepolicies

---

# FIXME: lvconvert --merge is an extremely ambiguous command.
# It can do very different operations, but which one depends
# on knowing the LV type.  So, the command doesn't know what
# it's actually doing until quite late, when processing a
# single LV.
#
# Use different option names for different merge operations
# so that we can have different command definitions,
# different behaviors, different optional options, etc:
#
# lvconvert --merge-mirror LV_linear_striped_raid ...
# DESC: Merge LV that was previously split from a mirror.
#
# lvconvert --merge-thin LV_thin
# DESC: Merge thin LV into its origin LV.
#
# lvconvert --merge-snapshot LV_snapshot
# DESC: Merge COW snapshot LV into its origin.
#
# Then we could add VG|Tag to --merge-mirror arg pos 1, because
# "lvconvert --merge VG|Tag" is a terrible command.  It will do
# different operations on each LV it finds, depending on the
# current LV type.

lvconvert --merge LV_linear_striped_raid_thin_snapshot|VG|Tag ...
OO: --background, --interval Number
ID: lvconvert_merge
DESC: Merge LV that was previously split from a mirror.
DESC: Merge thin LV into its origin LV.
DESC: Merge COW snapshot LV into its origin.

---

# FIXME: by using two different positional args, this is the
# single violation of the standard method of using process_each_lv().
# Before calling process_each, it steals the first positional arg
# and adjusts argv/argc so it's not seen by process_each.

lvconvert --type snapshot LV_linear_striped_raid LV_snapshot
OO: --chunksize SizeKB, --zero Bool, OO_LVCONVERT
ID: lvconvert_combine_split_snapshot
DESC: Combine LV with a previously split snapshot LV.

# alternate form of lvconvert --type snapshot
lvconvert --snapshot LV_linear_striped_raid LV_snapshot
OO: --chunksize SizeKB, --zero Bool, OO_LVCONVERT
ID: lvconvert_combine_split_snapshot
DESC: Combine LV with a previously split snapshot LV
DESC: (variant, infers --type snapshot).

---

lvconvert --type thin --thinpool LV LV_linear_striped_raid
OO: --thin, --originname LV_new, --zero Bool, OO_LVCONVERT_POOL, OO_LVCONVERT
ID: lvconvert_to_thin_with_external
DESC: Convert LV to type thin with an external origin.

# alternate form of lvconvert --type thin
lvconvert --thin --thinpool LV LV_linear_striped_raid
OO: --type thin, --originname LV_new, --zero Bool, OO_LVCONVERT_POOL, OO_LVCONVERT
ID: lvconvert_to_thin_with_external
DESC: Convert LV to type thin with an external origin
DESC: (variant, infers --type thin).

---

# FIXME: I don't think --zero applies when creating cache LV,
# but it's used in a test.  Should the test be fixed and
# --zero removed here?

lvconvert --type cache --cachepool LV LV_linear_striped_raid_thinpool
OO: --cache, --cachemode CacheMode, --cachepolicy String,
--cachesettings String, --zero Bool, OO_LVCONVERT_POOL, OO_LVCONVERT
ID: lvconvert_to_cache_vol
DESC: Convert LV to type cache.

# alternate form of lvconvert --type cache
lvconvert --cache --cachepool LV LV_linear_striped_raid_thinpool
OO: --type cache, --cachemode CacheMode, --cachepolicy String,
--cachesettings String, --zero Bool, OO_LVCONVERT_POOL, OO_LVCONVERT
ID: lvconvert_to_cache_vol
DESC: Convert LV to type cache (variant, infers --type cache).

---

# FIXME: stripes is an odd option, but if the pool metadata LV
# is created by the command, that LV is created with the
# specified number of stripes.  Maybe we could separate the
# command definitions for cases where pool metadata LV is
# created and limit the use of stripes to that case?

lvconvert --type thin-pool LV_linear_striped_raid_cache
OO: --stripes_long Number, --stripesize SizeKB,
--discards Discards, --zero Bool, OO_LVCONVERT_POOL, OO_LVCONVERT
ID: lvconvert_to_thinpool
DESC: Convert LV to type thin-pool.

# alternate form of lvconvert --type thin-pool
# deprecated because of non-standard syntax (missing positional arg)
lvconvert --thinpool LV_linear_striped_raid_cache
OO: --stripes_long Number, --stripesize SizeKB,
--discards Discards, --zero Bool, OO_LVCONVERT_POOL, OO_LVCONVERT
ID: lvconvert_to_thinpool
DESC: Convert LV to type thin-pool (variant, use --type thin-pool).

---

# FIXME: I don't think that --cachemode, --cachepolicy, --cachesettings
# are meant to be used when creating a cache pool, but they are used
# in one test.  Should that test be fixed and these options removed?

lvconvert --type cache-pool LV_linear_striped_raid
OO: OO_LVCONVERT_POOL, OO_LVCONVERT,
--cachemode CacheMode, --cachepolicy String, --cachesettings String
ID: lvconvert_to_cachepool
DESC: Convert LV to type cache-pool.

# alternate form of lvconvert --type cache-pool
# deprecated because of non-standard syntax (missing positional arg)
lvconvert --cachepool LV_linear_striped_raid
OO: --type cache-pool, OO_LVCONVERT_POOL, OO_LVCONVERT,
--cachemode CacheMode, --cachepolicy String, --cachesettings String
ID: lvconvert_to_cachepool
DESC: Convert LV to type cache-pool (variant, use --type cache-pool).

---

# FIXME: we should be able to remove LV_mirror from the list of accepted
# LV types, but there are some dubious commands in the test suite that
# fail without it (the tests should be cleaned up to avoid using commands
# that don't make sense.)
#
# FIXME: it would be nice to remove LV_raid1 from the list of accepted
# LV types and let raid1 be covered by just the second definition, but
# unfortunatley lvconvert --type mirror --mirrors N LV_raid1 will
# match the first definition since LV type cannot be used when
# matching command definitions.

lvconvert --type mirror --mirrors SNumber LV_linear_striped_raid1_mirror
OO: --mirrorlog MirrorLog, OO_LVCONVERT_RAID, OO_LVCONVERT
OP: PV ...
ID: lvconvert_to_mirror
DESC: Convert LV to type mirror.

lvconvert --type mirror LV_raid1
OO: --mirrors SNumber, OO_LVCONVERT_RAID, OO_LVCONVERT
OP: PV ...
ID: lvconvert_raid1_to_mirror
DESC: Convert LV from type raid1 to type mirror.

---

# FIXME: by using specific raid levels, e.g. raid1, we could
# specify other required options, e.g. --mirrors.  This may
# help the second fixme...
#
# FIXME: there are two different operations here, and it would
# be nice to split them into to unambiguous command lines:
#
# 1. lvconvert --type raid LV_linear_striped_mirror
#    DESC: Convert LV to type raid.
#
# 2. lvconvert --type raid LV_raid
#    DESC: Change LV raid type.

lvconvert --type raid LV_linear_striped_mirror_raid
OO: OO_LVCONVERT_RAID, OO_LVCONVERT
OP: PV ...
ID: lvconvert_general_to_raid
DESC: Convert LV to type raid.
DESC: Change LV raid type.

---

# FIXME: there are two unique operations here that differ
# by only the LV type, so they have to be defined together.
# We don't know what this command is going to do until after
# the LV is read.  It would be better if the alternate form
# variant were dropped to remove the ambiguity
# (then --type raid1|mirror would be required to change a
# linear or striped LV to raid1|mirror.)
#
# First command definition
# this changes the number of mirror images in a raid1|mirror LV.
# lvconvert --mirrors SNumber LV_raid_mirror
# ID: lvconvert_change_mirror_images
# DESC: Change the number of mirror images in the LV.
#
# Second command definition
# alternate form of: lvconvert --type raid1|mirror LV_linear_striped
# lvconvert --mirrors SNumber LV_linear_striped
# ID: lvconvert_to_raid1_or_mirror
# DESC: Convert LV to type raid1 or mirror
# DESC: (variant, infers --type raid1|mirror).

# first def is unique, second def is alternate form of lvconvert --type raid1|mirror
lvconvert --mirrors SNumber LV_raid_mirror_linear_striped
OO: --type raid1, --type mirror, --mirrorlog MirrorLog, OO_LVCONVERT_RAID, OO_LVCONVERT
OP: PV ...
ID: lvconvert_to_mirrored_or_change_image_count
DESC: Change the number of mirror images in a raid1 or mirror LV.
DESC: Convert a linear or striped LV to type raid1 or mirror
DESC: (variant, infers --type raid1|mirror).

---

lvconvert --type striped LV_raid
OO: OO_LVCONVERT_RAID, OO_LVCONVERT
OP: PV ...
ID: lvconvert_raid_to_striped
DESC: Convert LV to type striped.

---

lvconvert --type linear LV_raid_mirror
OO: OO_LVCONVERT
ID: lvconvert_raid_or_mirror_to_linear
DESC: Convert LV to type linear.

# FIXME: the 'mirrors 0' trick as an alias for linear
# is used inconsistently, confusing things and making
# definitions difficult.

# alternate form of lvconvert --type linear
lvconvert --mirrors 0 LV_raid_mirror
OO: --type linear, --type mirror, OO_LVCONVERT
ID: lvconvert_raid_or_mirror_to_linear
DESC: Convert LV to type linear (variant, infers --type linear).

---

lvconvert --splitmirrors Number --name LV_new LV_raid1_mirror_cache
OO: OO_LVCONVERT
OP: PV ...
ID: lvconvert_split_mirror_images_to_new
DESC: Split images from a raid1 or mirror LV and use them to create a new LV.

lvconvert --splitmirrors Number --trackchanges LV_raid1_cache
OO: OO_LVCONVERT
OP: PV ...
ID: lvconvert_split_mirror_images_and_track
DESC: Split images from a raid1 LV and track changes to origin.

---

# FIXME: use specific option names to distinguish these two
# very different commands, e.g.
#
# lvconvert --repair-pvs LV_raid_mirror
# DESC: Replace failed PVs in a raid or mirror LV.
#
# lvconvert --repair-thinpool LV_thinpool
# DESC: Repair a thin pool.
#
# lvm may want to do different things, or allow different options 
# depending on which operation is being run, but as it stands, it
# cannot do anything operation-specific until after the VG is read
# and the LV type is known.

lvconvert --repair LV_raid_mirror_thinpool
OO: OO_LVCONVERT
ID: lvconvert_repair_pvs_or_thinpool
DESC: Replace failed PVs in a raid or mirror LV.
DESC: Repair a thin pool.

---

lvconvert --replace PV LV_raid
OO: OO_LVCONVERT
OP: PV ...
ID: lvconvert_replace_pv
DESC: Replace specific PV(s) in a raid* LV with another PV.

---

lvconvert --mirrorlog MirrorLog LV_mirror
OO: OO_LVCONVERT
OP: PV ...
ID: lvconvert_change_mirrorlog
DESC: Change the type of log used by LV.

---

lvconvert --splitcache LV_cachepool_cache_thinpool
OO: OO_LVCONVERT
ID: lvconvert_split_and_keep_cachepool
DESC: Separate and preserve a cache pool from a cache LV.

---

lvconvert --uncache LV_cache_thinpool
OO: OO_LVCONVERT
ID: lvconvert_split_and_delete_cachepool
DESC: Separate and remove a cache pool from a cache LV.

---

lvconvert --splitsnapshot LV_snapshot
OO: OO_LVCONVERT
ID: lvconvert_split_cow_snapshot
DESC: Separate a COW snapshot from its origin LV.

---

# FIXME: add a new option defining this operation, e.g. --poll-mirror
# The purpose of this command is not entirely clear.

lvconvert LV_mirror
ID: lvconvert_poll_mirror
DESC: Poll LV to collapse resync layers.

---

# FIXME: add a new option defining this operation, e.g. --swapmetadata

lvconvert --poolmetadata LV LV_thinpool_cachepool
ID: lvconvert_swap_pool_metadata
DESC: Swap metadata LV in a thin pool or cache pool (temporary command).

---

# --extents is not specified; it's an automatic alternative for --size

OO_LVCREATE: --addtag Tag, --alloc Alloc, --autobackup Bool, --activate Active,
--contiguous Bool, --ignoreactivationskip, --ignoremonitoring, --major Number,
--metadataprofile String, --minor Number, --monitor Bool, --name String, --nosync,
--noudevsync, --permission Permission, --persistent Bool, --readahead Readahead,
--reportformat String, --setactivationskip Bool, --test, --wipesignatures Bool,
--zero Bool

OO_LVCREATE_CACHE: --cachemode CacheMode, --cachepolicy String, --cachesettings String

OO_LVCREATE_POOL: --poolmetadatasize SizeMB, --poolmetadataspare Bool, --chunksize SizeKB

# FIXME: it's silly to include --mirrors 0 here. Fix the tests to not use
# --mirrors 0 in commands that do not accept any non-zero --mirrors
# option, and then remove this.  Accepting an option, only so that the
# option's value can invalidate the use of the option is not general
# practice.

OO_LVCREATE_THIN: --discards Discards, --errorwhenfull Bool, --mirrors 0

OO_LVCREATE_RAID: --mirrors SNumber, --stripes Number, --stripesize SizeKB,
--regionsize SizeMB, --minrecoveryrate SizeKB, --maxrecoveryrate SizeKB

---

lvcreate --type error --size SizeMB VG
OO: OO_LVCREATE
ID: lvcreate_error_vol
DESC: Create an LV that returns errors when used.

---

lvcreate --type zero --size SizeMB VG
OO: OO_LVCREATE
ID: lvcreate_zero_vol
DESC: Create an LV that returns zeros when read.

---

# FIXME: consider removing the --mirrors 0, --stripes 1 options
# and just reporting an error (or ignoring) if mirrors or stripes
# options are given.

lvcreate --type linear --size SizeMB VG
OO: --mirrors 0, --stripes 1, OO_LVCREATE
OP: PV ...
ID: lvcreate_linear
DESC: Create a linear LV.

lvcreate --size SizeMB VG
OO: --type linear, --mirrors 0, --stripes 1, OO_LVCREATE
OP: PV ...
ID: lvcreate_linear
DESC: Create a linear LV  (default --type linear).
DESC: When --name is omitted, the name is generated.

---

lvcreate --type striped --size SizeMB VG
OO: --stripes Number, --stripesize SizeKB, OO_LVCREATE
OP: PV ...
ID: lvcreate_striped
DESC: Create a striped LV.

lvcreate --stripes Number --size SizeMB VG
OO: --type striped, --stripesize SizeKB, OO_LVCREATE
OP: PV ...
ID: lvcreate_striped
DESC: Create a striped LV (infers --type striped).

---

lvcreate --type mirror --size SizeMB VG
OO: --mirrors SNumber, --mirrorlog MirrorLog, --regionsize SizeMB, --stripes Number, OO_LVCREATE
OP: PV ...
ID: lvcreate_mirror
DESC: Create a mirror LV.

# alternate form of lvcreate --type raid1|mirror
lvcreate --mirrors SNumber --size SizeMB VG
OO: --type raid1, --type mirror, --mirrorlog MirrorLog, --stripes Number, OO_LVCREATE_RAID, OO_LVCREATE
OP: PV ...
ID: lvcreate_mirror
DESC: Create a raid1 or mirror LV (variant, infers --type raid1|mirror).

---

lvcreate --type raid --size SizeMB VG
OO: OO_LVCREATE_RAID, OO_LVCREATE
OP: PV ...
ID: lvcreate_raid_any
DESC: Create a raid LV (a specific raid level must be used, e.g. raid1.)

---

# FIXME: the LV created by these commands actually has type linear or striped,
# not snapshot as specified by the command.  If LVs never have type
# snapshot, perhaps "snapshot" should not be considered an LV type, but
# another new LV property?

lvcreate --type snapshot --size SizeMB LV
OO: --snapshot, --chunksize SizeKB, OO_LVCREATE
OP: PV ...
ID: lvcreate_cow_snapshot
DESC: Create a COW snapshot LV from an origin LV.

# alternate form of lvcreate --type snapshot
lvcreate --snapshot --size SizeMB LV
OO: --type snapshot, --stripes Number, --stripesize SizeKB,
--chunksize SizeKB, OO_LVCREATE
OP: PV ...
ID: lvcreate_cow_snapshot
DESC: Create a COW snapshot LV from an origin LV
DESC: (infers --type snapshot).

# If this snapshot+striped command was merged with lvcreate_cow_snapshot
# by adding --stripes in OO, then this command would be difficult to
# distiguish from lvcreate_striped based on required options.  But, it may
# work if command matching used optional options to score matches rather
# than only using required options.

lvcreate --type snapshot --stripes Number --size SizeMB LV
OO: --snapshot, --stripes Number, --stripesize SizeKB,
--chunksize SizeKB, OO_LVCREATE
OP: PV ...
ID: lvcreate_striped_cow_snapshot
DESC: Create a striped COW snapshot LV from an origin LV.

# alternate form of lvcreate --type snapshot --stripes
lvcreate --snapshot --stripes Number --size SizeMB LV
OO: --type snapshot, --stripes Number, --stripesize SizeKB,
--chunksize SizeKB, OO_LVCREATE
OP: PV ...
ID: lvcreate_striped_cow_snapshot
DESC: Create a striped COW snapshot LV from an origin LV
DESC: (infers --type snapshot).

---

lvcreate --type snapshot --size SizeMB --virtualsize SizeMB VG
OO: --snapshot, --chunksize SizeKB, OO_LVCREATE
OP: PV ...
ID: lvcreate_cow_snapshot_with_virtual_origin
DESC: Create a sparse COW snapshot LV of a virtual origin LV.

# alternate form of lvcreate --type snapshot
lvcreate --snapshot --size SizeMB --virtualsize SizeMB VG
OO: --type snapshot, --chunksize SizeKB, OO_LVCREATE
OP: PV ...
ID: lvcreate_cow_snapshot_with_virtual_origin
DESC: Create a sparse COW snapshot LV of a virtual origin LV
DESC: (infers --type snapshot).

---

lvcreate --type thin-pool --size SizeMB VG
OO: --thinpool LV_new, OO_LVCREATE_POOL, OO_LVCREATE_THIN, OO_LVCREATE,
--stripes Number, --stripesize SizeKB
OP: PV ...
ID: lvcreate_thinpool
DESC: Create a thin pool.

# alternate form of lvcreate --type thin-pool
lvcreate --thin --size SizeMB VG
OO: --type thin-pool, OO_LVCREATE_POOL, OO_LVCREATE_THIN, OO_LVCREATE,
--stripes Number, --stripesize SizeKB
OP: PV ...
ID: lvcreate_thinpool
DESC: Create a thin pool (variant, infers --type thin-pool).

# alternate form of lvcreate --type thin-pool
lvcreate --size SizeMB --thinpool LV_new VG
OO: --thin, --type thin-pool, OO_LVCREATE_POOL, OO_LVCREATE_THIN, OO_LVCREATE,
--stripes Number, --stripesize SizeKB
OP: PV ...
ID: lvcreate_thinpool
DESC: Create a thin pool named by the --thinpool arg
DESC: (variant, infers --type thin-pool).

---

lvcreate --type cache-pool --size SizeMB VG
OO: OO_LVCREATE_POOL, OO_LVCREATE_CACHE, OO_LVCREATE
OP: PV ...
ID: lvcreate_cachepool
DESC: Create a cache pool.

# alternate form of lvcreate --type cache-pool
lvcreate --cache --size SizeMB VG
OO: --type cache-pool, OO_LVCREATE_POOL, OO_LVCREATE_CACHE, OO_LVCREATE
OP: PV ...
ID: lvcreate_cachepool
DESC: Create a cache pool (variant, infers --type cache-pool).

# alternate form of lvcreate --type cache-pool
lvcreate --type cache-pool --size SizeMB --cachepool LV_new VG
OO: OO_LVCREATE_POOL, OO_LVCREATE_CACHE, OO_LVCREATE
OP: PV ...
ID: lvcreate_cachepool
DESC: Create a cache pool named by the --cachepool arg
DESC: (variant, uses --cachepool in place of --name).

---

lvcreate --type thin --virtualsize SizeMB --thinpool LV_thinpool
OO: --thin, OO_LVCREATE_POOL, OO_LVCREATE_THIN, OO_LVCREATE
OP: VG
ID: lvcreate_thin_vol
DESC: Create a thin LV in a thin pool.

# alternate form of lvcreate --type thin
lvcreate --type thin --virtualsize SizeMB LV_thinpool
OO: --thin, OO_LVCREATE_THIN, OO_LVCREATE
ID: lvcreate_thin_vol
DESC: Create a thin LV in a thin pool named in arg pos 1
DESC: (variant, also see --thinpool).

# alternate form of lvcreate --type thin
lvcreate --virtualsize SizeMB --thinpool LV_thinpool
OO: --type thin, --thin, OO_LVCREATE_THIN, OO_LVCREATE
OP: VG
ID: lvcreate_thin_vol
DESC: Create a thin LV in a thin pool (variant, infers --type thin).

# alternate form of lvcreate --type thin
lvcreate --virtualsize SizeMB LV_thinpool
OO: --type thin, --thin, OO_LVCREATE_THIN, OO_LVCREATE
ID: lvcreate_thin_vol
DESC: Create a thin LV in the thin pool named in arg pos 1
DESC: (variant, infers --type thin, also see --thinpool).

---

# FIXME: in addition to confusing and unpredictable,
# this jumble of variations of the same thing is inconsistent:
# lvcreate --thin LV_thin and lvcreate --snapshot LV_thin
# are the same command, both creating a thin snapshot,
# but lvcreate --thin --snapshot LV_thin does not.

lvcreate --type thin LV_thin
OO: --thin, OO_LVCREATE_THIN, OO_LVCREATE
ID: lvcreate_thin_snapshot
DESC: Create a thin LV that is a snapshot of an existing thin LV.

# alternate form of lvcreate --type thin
lvcreate --thin LV_thin
OO: --type thin, OO_LVCREATE_THIN, OO_LVCREATE
ID: lvcreate_thin_snapshot
DESC: Create a thin LV that is a snapshot of an existing thin LV
DESC: (infers --type thin).

# alternate form of lvcreate --type thin LV_thin
lvcreate --snapshot LV_thin
OO: --type thin, OO_LVCREATE_THIN, OO_LVCREATE
ID: lvcreate_thin_snapshot
DESC: Create a thin LV that is a snapshot of an existing thin LV
DESC: (infers --type thin).

lvcreate --type thin --thinpool LV_thinpool LV
OO: OO_LVCREATE_POOL, OO_LVCREATE_THIN, OO_LVCREATE
ID: lvcreate_thin_snapshot_of_external
DESC: Create a thin LV that is a snapshot of an external origin LV.

# alternate form of lvcreate --type thin --thinpool LV_thinpool LV
lvcreate --snapshot --thinpool LV_thinpool LV
OO: --type thin, OO_LVCREATE_THIN, OO_LVCREATE
ID: lvcreate_thin_snapshot_of_external
DESC: Create a thin LV that is a snapshot of an external origin LV
DESC: (infers --type thin).

---

# stripes option is not intuitive when creating a thin LV,
# but here it applies to creating the new thin pool that
# is used for the thin LV

lvcreate --type thin --virtualsize SizeMB --size SizeMB --thinpool LV_new
OO: OO_LVCREATE_POOL, OO_LVCREATE_THIN, OO_LVCREATE,
--stripes Number, --stripesize SizeKB
OP: PV ...
ID: lvcreate_thin_vol_with_thinpool
DESC: Create a thin LV, first creating a thin pool for it,
DESC: where the new thin pool is named by the --thinpool arg.

# alternate form of lvcreate --type thin
lvcreate --thin --virtualsize SizeMB --size SizeMB --thinpool LV_new
OO: --type thin, OO_LVCREATE_POOL, OO_LVCREATE_THIN, OO_LVCREATE,
--stripes Number, --stripesize SizeKB
OP: PV ...
ID: lvcreate_thin_vol_with_thinpool
DESC: Create a thin LV, first creating a thin pool for it,
DESC: where the new thin pool is named by the --thinpool arg,
DESC: (variant, infers --type thin).

lvcreate --type thin --virtualsize SizeMB --size SizeMB LV_new
OO: OO_LVCREATE_POOL, OO_LVCREATE_THIN, OO_LVCREATE,
--stripes Number, --stripesize SizeKB
OP: PV ...
ID: lvcreate_thin_vol_with_thinpool
DESC: Create a thin LV, first creating a thin pool for it,
DESC: where the new thin pool is named in arg pos 1.

lvcreate --thin --virtualsize SizeMB --size SizeMB LV_new
OO: --type thin, OO_LVCREATE_POOL, OO_LVCREATE_THIN, OO_LVCREATE,
--stripes Number, --stripesize SizeKB
OP: PV ...
ID: lvcreate_thin_vol_with_thinpool
DESC: Create a thin LV, first creating a thin pool for it,
DESC: where the new thin pool is named in arg pos 1,
DESC: (variant, infers --type thin).

lvcreate --type thin --virtualsize SizeMB --size SizeMB VG
OO: OO_LVCREATE_POOL, OO_LVCREATE_THIN, OO_LVCREATE,
--stripes Number, --stripesize SizeKB
OP: PV ...
ID: lvcreate_thin_vol_with_thinpool
DESC: Create a thin LV, first creating a thin pool for it.

---

lvcreate --size SizeMB --virtualsize SizeMB VG
OO: --type thin, --type snapshot, --thin, --snapshot, OO_LVCREATE_POOL, OO_LVCREATE_THIN, OO_LVCREATE,
--stripes Number, --stripesize SizeKB
OP: PV ...
ID: lvcreate_thin_vol_with_thinpool_or_sparse_snapshot
DESC: Create a thin LV, first creating a thin pool for it
DESC: (infers --type thin).
DESC: Create a sparse snapshot of a virtual origin LV
DESC: (infers --type snapshot).
DESC: Infers --type thin or --type snapshot according to
DESC: confing setting sparse_segtype_default.

---

# stripes option is not intuitive when creating a cache LV,
# but here it applies to creating the new origin that
# is used to create the cache LV

lvcreate --type cache --size SizeMB --cachepool LV_cachepool VG
OO: --cache, OO_LVCREATE_POOL, OO_LVCREATE_CACHE, OO_LVCREATE,
--stripes Number, --stripesize SizeKB
OP: PV ...
ID: lvcreate_cache_vol_with_new_origin
DESC: Create a cache LV, first creating a new origin LV,
DESC: then combining it with the existing cache pool named
DESC: by the --cachepool arg.

# alternate form of lvcreate --type cache
lvcreate --size SizeMB --cachepool LV_cachepool VG
OO: --type cache, --cache, OO_LVCREATE_CACHE, OO_LVCREATE,
--stripes Number, --stripesize SizeKB
OP: PV ...
ID: lvcreate_cache_vol_with_new_origin
DESC: Create a cache LV, first creating a new origin LV,
DESC: then combining it with the existing cache pool named
DESC: by the --cachepool arg (variant, infers --type cache).

# alternate form of lvcreate --type cache
lvcreate --type cache --size SizeMB LV_cachepool
OO: --cache, OO_LVCREATE_POOL, OO_LVCREATE_CACHE, OO_LVCREATE,
--stripes Number, --stripesize SizeKB
OP: PV ...
ID: lvcreate_cache_vol_with_new_origin
DESC: Create a cache LV, first creating a new origin LV,
DESC: then combining it with the existing cache pool named
DESC: by in arg pos 1 (variant, also use --cachepool).

# This is a ridiculously crazy command which nobody could
# understand.  It should be be eliminated.  It does two different
# things depending on whether LV in pos 1 is a cachepool LV
# or not.  Both variations are unnecessary.
#
# 1. If LV is a cachepool, then it's an alternate form of
#    an already crazy command above:
#
# # alternate form for lvcreate_cache_vol_with_new_origin
# lvcreate --cache --size SizeMB LV_cachepool
# OO: --type cache, --cache, OO_LVCREATE_CACHE, OO_LVCREATE, --stripes Number, --stripesize SizeKB
# OP: PV ...
# ID: lvcreate_cache_vol_with_new_origin
# DESC: Create a cache LV, first creating a new origin LV,
# DESC: then combining it with the existing cache pool named
# DESC: in arg pos 1 (variant, infers --type cache,
# DESC: also use --cachepool).
#
# If LV is not a cachepool, then it's a disguised lvconvert:
#
# # FIXME: this should be done by lvconvert, and this command removed
# lvcreate --type cache --size SizeMB LV
# OO: OO_LVCREATE_POOL, OO_LVCREATE_CACHE, OO_LVCREATE
# OP: PV ...
# ID: lvcreate_convert_to_cache_vol_with_cachepool
# DESC: Convert the specified LV to type cache after creating a new
# DESC: cache pool LV to use (use lvconvert).
#
# Note that stripes are accepted by the first and not by the
# second, but it's not possible to validate this until after
# the LV type is known.
#
# So, to define this syntax we have to combine both of
# those variants, each crazy on it's own, into one.

# def1: alternate form of lvcreate --type cache, or
# def2: FIXME: it should be done by lvconvert.
lvcreate --cache --size SizeMB LV
OO: OO_LVCREATE_CACHE, OO_LVCREATE, --stripes Number, --stripesize SizeKB
OP: PV ...
ID: lvcreate_cache_vol_with_new_origin_or_convert_to_cache_vol_with_cachepool
DESC: When LV is a cache pool, create a cache LV,
DESC: first creating a new origin LV, then combining it with
DESC: the existing cache pool named in arg pos 1
DESC: (variant, infers --type cache, also use --cachepool).
DESC: When LV is not a cache pool, convert the specified LV
DESC: to type cache after creating a new cache pool LV to use
DESC: (use lvconvert).

---

lvdisplay
OO: --aligned, --all, --binary, --colon, --columns,
--configreport String, --foreign, --history, --ignorelockingfailure,
--ignoreskippedcluster, --logonly, --maps, --noheadings,
--nosuffix, --options String, --sort String, --partial, --readonly,
--reportformat String, --segments, --select String, --separator String,
--shared, --unbuffered, --units Units
OP: VG|LV|Tag ...
ID: lvdisplay_general

---

# --extents is not specified; it's an automatic alternative for --size

lvextend --size SizeMB LV
OO: --alloc Alloc, --autobackup Bool, --force, --mirrors SNumber,
--nofsck, --nosync, --noudevsync, --reportformat String, --resizefs,
--stripes Number, --stripesize SizeKB, --test, --poolmetadatasize SizeMB
OP: PV ...
ID: lvextend_by_size

lvextend LV PV ...
OO: --alloc Alloc, --autobackup Bool, --force, --mirrors SNumber,
--nofsck, --nosync, --noudevsync,
--reportformat String, --resizefs, --stripes Number, --stripesize SizeKB,
--test
ID: lvextend_by_pv

lvextend --poolmetadatasize SizeMB LV_thinpool
OO: --alloc Alloc, --autobackup Bool, --force, --mirrors SNumber,
--nofsck, --nosync, --noudevsync,
--reportformat String, --stripes Number, --stripesize SizeKB,
--test
OP: PV ...
ID: lvextend_pool_metadata_by_size

lvextend --usepolicies LV_thinpool_snapshot
OO: --alloc Alloc, --autobackup Bool, --force, --mirrors SNumber,
--nofsck, --nosync, --noudevsync,
--reportformat String, --resizefs,
--test
ID: lvextend_by_policy

---

lvmconfig
OO: OO_CONFIG
ID: lvmconfig_general

---

lvreduce --size SizeMB LV
OO: --autobackup Bool, --force, --nofsck, --noudevsync,
--reportformat String, --resizefs, --test
ID: lvreduce_general

---

lvremove VG|LV|Tag|Select ...
OO: --autobackup Bool, --force, --nohistory, --noudevsync,
--reportformat String, --select String, --test
ID: lvremove_general

---

lvrename VG LV LV_new
OO: --autobackup Bool, --noudevsync, --reportformat String, --test
ID: lvrename_vg_lv_lv

lvrename LV LV_new
OO: --autobackup Bool, --noudevsync, --reportformat String, --test
ID: lvrename_lv_lv

---

lvresize --size SizeMB LV
OO: --alloc Alloc, --autobackup Bool, --force,
--nofsck, --nosync, --noudevsync, --reportformat String, --resizefs,
--stripes Number, --stripesize SizeKB, --test, --poolmetadatasize SizeMB
OP: PV ...
ID: lvresize_by_size
DESC: Resize an LV by a specified size.

lvresize LV PV ...
OO: --alloc Alloc, --autobackup Bool, --force,
--nofsck, --nosync, --noudevsync,
--reportformat String, --resizefs, --stripes Number, --stripesize SizeKB,
--test
ID: lvresize_by_pv
DESC: Resize an LV by a specified PV.

lvresize --poolmetadatasize SizeMB LV_thinpool
OO: --alloc Alloc, --autobackup Bool, --force,
--nofsck, --nosync, --noudevsync,
--reportformat String, --stripes Number, --stripesize SizeKB,
--test
OP: PV ...
ID: lvresize_pool_metadata_by_size
DESC: Resize the metadata SubLV of a pool LV.

---

lvs
OO: --history, --segments, OO_REPORT
OP: VG|LV|Tag ...
ID: lvs_general

---

lvscan
OO: --all, --blockdevice, --ignorelockingfailure, --partial,
--readonly, --reportformat String, --cache_long
ID: lvscan_general

---

# None of these can function as a required option for pvchange.
OO_PVCHANGE: --autobackup Bool, --force, --ignoreskippedcluster,
--reportformat String, --test, --uuid

# Any of these can function as a required option for pvchange.
OO_PVCHANGE_META: --allocatable Bool, --addtag Tag, --deltag Tag,
--uuid, --metadataignore Bool

pvchange OO_PVCHANGE_META --all
OO: OO_PVCHANGE
ID: pvchange_properties_all

pvchange OO_PVCHANGE_META PV|Select ...
OO: --select String, OO_PVCHANGE
ID: pvchange_properties_some

---

pvresize PV ...
OO: --setphysicalvolumesize SizeMB, --reportformat String, --test
ID: pvresize_general

---

pvck PV ...
OO: --labelsector Number
ID: pvck_general

---

# Use --uuidstr here which will be converted to uuidstr_ARG
# which is actually --uuid string on the command line.

pvcreate PV ...
OO: --dataalignment SizeKB, --dataalignmentoffset SizeKB, --bootloaderareasize SizeMB,
--force, --test, --labelsector Number, --metadatatype MetadataType,
--pvmetadatacopies Number, --metadatacopies MetadataCopies, --metadatasize SizeMB,
--metadataignore Bool, --norestorefile, --setphysicalvolumesize SizeMB,
--reportformat String, --restorefile String, --uuidstr String, --zero Bool
ID: pvcreate_general

---

pvdisplay
OO: --aligned, --all, --binary, --colon, --columns, --configreport String,
--foreign, --ignorelockingfailure, --ignoreskippedcluster,
--logonly, --maps, --noheadings, --nosuffix, --options String,
--readonly, --reportformat String, --select String, --separator String, --shared,
--short, --sort String, --unbuffered, --units Units
OP: PV|Tag ...
ID: pvdisplay_general

---

pvmove PV
OO: --abort, --alloc Alloc, --atomic, --autobackup Bool, --background,
--interval Number, --name LV, --noudevsync, --reportformat String, --test
OP: PV ...
ID: pvmove_one

pvmove
OO: --abort, --background, --test
ID: pvmove_any

---

pvremove PV ...
OO: --force, --reportformat String, --test
ID: pvremove_general

---

pvs
OO: --segments, OO_REPORT
OP: PV|Tag ...
ID: pvs_general

---

pvscan
OO: --ignorelockingfailure, --reportformat String, --exported, --novolumegroup,
--short, --uuid
ID: pvscan_show

pvscan --cache_long
OO: --ignorelockingfailure, --reportformat String, --background,
--activate Active, --major Number, --minor Number,
OP: PV|String ...
ID: pvscan_cache

---

vgcfgbackup
OO: --file String, --foreign, --ignorelockingfailure, --partial, --readonly,
--reportformat String
OP: VG ...
ID: vgcfgbackup_general

---

vgcfgrestore VG
OO: --file String, --force_long, --list, --metadatatype MetadataType, --test
ID: vgcfgrestore_by_vg

vgcfgrestore --list --file String
ID: vgcfgrestore_by_file

---

# None of these can function as a required option for vgchange.

OO_VGCHANGE: --autobackup Bool, --ignoremonitoring, --ignoreskippedcluster,
--noudevsync, --reportformat String, --select String, --test, --force

# Any of these can function as a required option for vgchange.
# profile is also part of OO_ALL, but is repeated in OO_VGCHANGE_META
# because it can function as a required opt.

OO_VGCHANGE_META: --addtag Tag, --deltag Tag,
--logicalvolume Number, --maxphysicalvolumes Number, --alloc Alloc, --uuid,
--clustered Bool, --metadatacopies MetadataCopies, --vgmetadatacopies MetadataCopies,
--physicalextentsize SizeMB, --resizeable Bool, --systemid String, --locktype LockType,
--profile String, --detachprofile, --metadataprofile String,

vgchange OO_VGCHANGE_META
OO: OO_VGCHANGE
OP: VG|Tag ...
ID: vgchange_properties

vgchange --monitor Bool
OO: --sysinit, --ignorelockingfailure, --poll Bool, OO_VGCHANGE_META, OO_VGCHANGE
OP: VG|Tag ...
ID: vgchange_monitor

vgchange --poll Bool
OO: --ignorelockingfailure, OO_VGCHANGE_META, OO_VGCHANGE
OP: VG|Tag ...
ID: vgchange_poll

vgchange --activate Active
OO: --activationmode ActivationMode, --ignoreactivationskip, --partial, --sysinit,
--ignorelockingfailure, --monitor Bool, --poll Bool, OO_VGCHANGE_META, OO_VGCHANGE
OP: VG|Tag ...
ID: vgchange_activate

vgchange --refresh
OO: --sysinit, --ignorelockingfailure, --monitor Bool, --poll Bool, OO_VGCHANGE_META, OO_VGCHANGE
OP: VG|Tag ...
ID: vgchange_refresh

vgchange --lockstart
OO: --lockopt String, OO_VGCHANGE_META, OO_VGCHANGE
OP: VG|Tag ...
ID: vgchange_lockstart

vgchange --lockstop
OO: --lockopt String, OO_VGCHANGE_META, OO_VGCHANGE
OP: VG|Tag ...
ID: vgchange_lockstop

---

vgck
OO: --reportformat String
OP: VG|Tag ...
ID: vgck_general

---

vgconvert VG ...
OO: --force, --test, --labelsector Number, --bootloaderareasize SizeMB,
--metadatatype MetadataType, --pvmetadatacopies Number,
--metadatasize SizeMB, --reportformat String
ID: vgconvert_general

---

vgcreate VG_new PV ...
OO: --addtag Tag, --alloc Alloc, --autobackup Bool, --clustered Bool, --maxlogicalvolumes Number,
--maxphysicalvolumes Number, --metadataprofile String, --metadatatype MetadataType,
--physicalextentsize SizeMB, --test, --force, --zero Bool, --labelsector Number,
--metadatasize SizeMB, --pvmetadatacopies Number, --reportformat String, --metadatacopies MetadataCopies,
--vgmetadatacopies MetadataCopies, --dataalignment SizeKB, --dataalignmentoffset SizeKB,
--shared, --systemid String, --locktype LockType, --lockopt String
ID: vgcreate_general

---

vgdisplay
OO: --activevolumegroups, --aligned, --binary, --colon, --columns,
--configreport String, --foreign, --ignorelockingfailure,
--ignoreskippedcluster, --logonly, --noheadings, --nosuffix,
--options String, --partial, --readonly, --reportformat String, --select String,
--shared, --short, --separator String, --sort String, --unbuffered, --units Units
OP: VG|Tag ...
ID: vgdisplay_general

---

OO_VGEXPORT: --reportformat String, --test

vgexport VG|Tag|Select ...
OO: --select String, OO_VGEXPORT
ID: vgexport_some

vgexport --all
OO: OO_VGEXPORT
ID: vgexport_all

---

vgextend VG PV ...
OO: --autobackup Bool, --test,
--force, --zero Bool, --labelsector Number, --metadatatype MetadataType,
--metadatasize SizeMB, --pvmetadatacopies Number,
--metadataignore Bool, --dataalignment SizeKB, --dataalignmentoffset SizeKB,
--reportformat String, --restoremissing
ID: vgextend_general

---

OO_VGIMPORT: --force, --reportformat String, --test

vgimport VG|Tag|Select ...
OO: --select String, OO_VGIMPORT
ID: vgimport_some

vgimport --all
OO: OO_VGIMPORT
ID: vgimport_all

---

vgimportclone PV ...
OO: --basevgname VG, --test, --import
ID: vgimportclone_general

---

vgmerge VG VG
OO: --autobackup Bool, --list, --test
ID: vgmerge_general

---

vgmknodes
OO: --ignorelockingfailure, --refresh, --reportformat String
OP: VG|LV|Tag ...
ID: vgmknodes_general

---

OO_VGREDUCE: --autobackup Bool, --force, --reportformat String, --test

vgreduce VG PV ...
OO: OO_VGREDUCE
ID: vgreduce_by_pv

vgreduce --all VG
OO: OO_VGREDUCE
ID: vgreduce_all

vgreduce --removemissing VG
OO: --mirrorsonly, OO_VGREDUCE
ID: vgreduce_missing

---

vgremove VG|Tag|Select ...
OO: --force, --noudevsync, --reportformat String, --select String, --test
ID: vgremove_general

---

vgrename VG VG_new
OO: --autobackup Bool, --force, --reportformat String, --test
ID: vgrename_by_name

vgrename String VG_new
OO: --autobackup Bool, --force, --reportformat String, --test
ID: vgrename_by_uuid

---

vgs
OO: OO_REPORT
OP: VG|Tag ...
ID: vgs_general

---

vgscan
OO: --cache_long, --ignorelockingfailure, --mknodes, --notifydbus,
--partial, --reportformat String
ID: vgscan_general

---

OO_VGSPLIT: --autobackup Bool, --test

OO_VGSPLIT_NEW: --alloc Alloc, --clustered Bool,
--maxlogicalvolumes Number, --maxphysicalvolumes Number,
--metadatatype MetadataType, --vgmetadatacopies MetadataCopies

# FIXME: it would be nice to have separate definitions
# for the cases where the destination VG exists or is new,
# but when choosing the command definition, we don't yet
# know if the destination VG exists or not.  So to do this
# we'd need a command option to specify if the VG is new.
#
# this won't work:
#   vgsplit VG VG PV
#   ID: vgsplit_by_pv_to_existing
#
#   vgsplit VG VG_new PV ...
#   ID: vgsplit_by_pv_to_new
#
# but this could:
#   vgsplit VG VG PV
#   ID: vgsplit_by_pv_to_existing
#
#   vgsplit --create-new VG VG_new PV ...
#   ID: vgsplit_by_pv_to_new
#
# Then the OO_VGSPLIT_NEW options could be
# included in the second case but not the first.

vgsplit VG VG PV ...
OO: OO_VGSPLIT, OO_VGSPLIT_NEW
ID: vgsplit_by_pv

vgsplit --name LV VG VG
OO: OO_VGSPLIT, OO_VGSPLIT_NEW
ID: vgsplit_by_lv

---

# built-in and deprecated commands

config
OO: OO_CONFIG
OP: String ...
ID: lvmconfig_general

dumpconfig
OO: OO_CONFIG
OP: String ...
ID: lvmconfig_general

devtypes
OO: --aligned, --binary, --nameprefixes, --noheadings,
--nosuffix, --options String, --reportformat String, --rows,
--select String, --separator String, --sort String, --unbuffered, --unquoted
ID: devtypes_general

fullreport
OO: OO_REPORT
OP: VG ...
ID: fullreport_general

lastlog
OO: --reportformat String, --select String
ID: lastlog_general

lvpoll --polloperation String LV ...
OO: --abort, --autobackup Bool, --handlemissingpvs, --interval Number, --test
ID: lvpoll_general

formats
ID: formats_general

help
ID: help_general

version
ID: version_general

pvdata
ID: pvdata_general

segtypes
ID: segtypes_general

systemid
ID: systemid_general

tags
ID: tags_general

lvmchange
ID: lvmchange_general

lvmdiskscan
OO: --lvmpartition, --readonly
ID: lvmdiskscan_general

lvmsadc
ID: lvmsadc_general

lvmsar
OO: --full, --stdin
ID: lvmsar_general