summaryrefslogtreecommitdiff
path: root/tools/vals.h
Commit message (Collapse)AuthorAgeFilesLines
* args: recognize 'json_std' for --reportformat cmd line argPeter Rajnoha2022-08-111-1/+1
|
* tools: correct units descriptionZdenek Kabelac2021-04-191-1/+1
| | | | | Option --units takes also [Number] to express size in configurable units.
* man: writecache missed for --typeZdenek Kabelac2021-03-301-1/+1
| | | | Add missing writecache type into man pages.
* Revert "pvck: dump headers_only to skip metadata text"David Teigland2020-05-291-1/+1
| | | | | | This reverts commit 5410dd5441aa827b381ff64dfc6be6e4589d87a1. Accidental push.
* pvck: dump headers_only to skip metadata textDavid Teigland2020-05-281-1/+1
| | | | | | | | pvck --dump headers reads the metadata text area to compute the text metadata checksum to compare with the mda_header checksum. The new header_only will skip reading the metadata text and not validate the mda_header checksum.
* pvck: show specific dump option valuesDavid Teigland2019-12-101-0/+1
|
* pvck: repair headers and metadataDavid Teigland2019-11-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To write a new/repaired pv_header and label_header: pvck --repairtype pv_header --file <file> <device> This uses the metadata input file to find the PV UUID, device size, and data offset. To write new/repaired metadata text and mda_header: pvck --repairtype metadata --file <file> <device> This requires a good pv_header which points to one or two metadata areas. Any metadata areas referenced by the pv_header are updated with the specified metadata and a new mda_header. "--settings mda_num=1|2" can be used to select one mda to repair. To combine all header and metadata repairs: pvck --repair --file <file> <device> It's best to use a raw metadata file as input, that was extracted from another PV in the same VG (or from another metadata area on the same PV.) pvck will also accept a metadata backup file, but that will produce metadata that is not identical to other metadata copies on other PVs and other areas. So, when using a backup file, consider using it to update metadata on all PVs/areas. To get a raw metadata file to use for the repair, see pvck --dump metadata|metadata_search. List all instances of metadata from the metadata area: pvck --dump metadata_search <device> Save one instance of metadata at the given offset to the specified file (this file can be used for repair): pvck --dump metadata_search --file <file> --settings "metadata_offset=<off>" <device>
* vdo: document types vdo and vdo-poolZdenek Kabelac2019-01-281-1/+1
|
* Remove lvm1 and pool disk formatsDavid Teigland2018-04-301-2/+2
| | | | | | | | | | | There are likely more bits of code that can be removed, e.g. lvm1/pool-specific bits of code that were identified using FMT flags. The vgconvert command can likely be reduced further. The lvm1-specific config settings should probably have some other fields set for proper deprecation.
* cleanup: add _mb_ to regiosize optionZdenek Kabelac2018-04-201-1/+1
| | | | Just like with others mentions default unit in function name.
* commands: use correct relative signs with mirror optionDavid Teigland2017-03-101-1/+2
| | | | | | | | As was recently done with relative signes for sizes/extents, limit the signs used with the mirrors option, e.g. lvcreate --mirrors now does not accept or advertise an optional minus sign with the value. lvconvert --mirrors accepts +|-.
* cache: allow to specify cachemetadataformatZdenek Kabelac2017-03-101-0/+1
| | | | | | | OO_LVCREATE_CACHE accepts --cachemetadataformat. Support new option --cachemetadataformat auto|1|2 for caching. Word 'auto' can be also be given as '0'.
* commands: clean up and unify signed option value handlingDavid Teigland2017-03-081-6/+7
| | | | | | | | | | | | | | | | | | | | | | | Add new values for different sign variations, resulting in: size_VAL no sign accepted ssize_VAL accepts + or - psize_VAL accepts + nsize_VAL accpets - extents_VAL no sign accepted sextents_VAL accepts + or - pextents_VAL accepts + nextents_VAL accepts - Depending on the command being run, change the option values for --size, --extents, --poolmetadatasize to use the appropriate value from above. lvcreate uses no sign (but accepts + and ignores it). lvresize accepts +|- for a relative change. lvextend accepts + for a relative change. lvreduce accepts - for a relative change.
* commands: combine duplicate arrays for opt and valDavid Teigland2017-03-081-1/+1
| | | | | | command.c and lvmcmdline.c each had a full array defining all options and values. This duplication was not removed when the command.c code was merged into the run time.
* man/help: rework extents and size outputDavid Teigland2017-03-031-2/+2
| | | | | | | | | | Clean up and correct the details around --extents and --size. lvcreate/lvresize/lvreduce/lvextend all now display the extents option in usages. The Size and Number value variables for --size and --extents are now displayed without the [+|-] prefix for lvcreate.
* args: in cachemode option fix passthrough valueDavid Teigland2017-03-031-1/+1
|
* lvcreate/lvresize: the --size option accepts signed valuesDavid Teigland2017-03-021-1/+3
| | | | | | | | | | | | | | | | | | | There was confusion in the code about whether or not the --size option accepted a sign. Make it consistent and clear that it does. This exposes a new problem in that an option can only accept one value type, e.g. --size can only accept a signed number, it cannot accept a positive or negative number for some commands and reject negative numbers for others. In practice, lvcreate accepts only positive --size values and lvresize accepts positive or negative --size values. There is currently no way to encode this difference. Until that is fixed, the man page output is hacked to avoid printing the [+|-] prefix for sizes in lvcreate.
* man: use Size variable for a number with unitDavid Teigland2017-02-241-11/+11
| | | | | Define a separate variable type Size to represent a number that takes an optional UNIT.
* man/help: change syntax to UNITDavid Teigland2017-02-231-5/+5
| | | | | | | | | | | | (Change to recent commit 3f4ecaf8c2.) Use --foo Number[k|UNIT] to indicate that the default units of the number is k, but other units listed below are also accepted. Previously, underlined/italic Unit was used, like other of variables, but this UNIT is more like a shortcut than an actual variable.
* man/help: improve the style of units indicatorDavid Teigland2017-02-221-6/+6
| | | | | | | | | | | | | | | We use --foo Number[k|Units] to indicate that the default units of the number is k, but other units listed below are also accepted. Capitalize and underline Units so it is consistent with other variables, and reference it at the end. Technically, the k should be bold, but this tends to make the text visually hard to read because of the excessive highlights scattered everywhere. So it's left normal text for now (it's unlikely to confuse anyone.)
* man/help: print general raid type as "raid"David Teigland2017-02-201-1/+1
| | | | | Instead of printing "raid*". There are already notes mentioning that "raid" refers to "raid<N>"
* man/help: show recently added r|R unitDavid Teigland2017-02-171-1/+1
|
* man/help: use separator in units listDavid Teigland2017-02-141-1/+1
| | | | h|H|b|B|... instead of hHbB...
* args: use arg parsing function for region sizeDavid Teigland2017-02-131-0/+5
| | | | | Consolidate the validation of the region size arg in a new arg parsing function.
* args: use uint32 arg for maxphysicalvolumesDavid Teigland2017-02-131-0/+1
|
* commands: new method for defining commandsDavid Teigland2017-02-131-0/+136
. Define a prototype for every lvm command. . Match every user command with one definition. . Generate help text and man pages from them. The new file command-lines.in defines a prototype for every unique lvm command. A unique lvm command is a unique combination of: command name + required option args + required positional args. Each of these prototypes also includes the optional option args and optional positional args that the command will accept, a description, and a unique string ID for the definition. Any valid command will match one of the prototypes. Here's an example of the lvresize command definitions from command-lines.in, there are three unique lvresize commands: lvresize --size SizeMB LV OO: --alloc Alloc, --autobackup Bool, --force, --nofsck, --nosync, --noudevsync, --reportformat String, --resizefs, --stripes Number, --stripesize SizeKB, --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 ID: lvresize_by_pv DESC: Resize an LV by specified PV extents. FLAGS: SECONDARY_SYNTAX lvresize --poolmetadatasize SizeMB LV_thinpool OO: --alloc Alloc, --autobackup Bool, --force, --nofsck, --nosync, --noudevsync, --reportformat String, --stripes Number, --stripesize SizeKB OP: PV ... ID: lvresize_pool_metadata_by_size DESC: Resize a pool metadata SubLV by a specified size. The three commands have separate definitions because they have different required parameters. Required parameters are specified on the first line of the definition. Optional options are listed after OO, and optional positional args are listed after OP. This data is used to generate corresponding command definition structures for lvm in command-lines.h. usage/help output is also auto generated, so it is always in sync with the definitions. Every user-entered command is compared against the set of command structures, and matched with one. An error is reported if an entered command does not have the required parameters for any definition. The closest match is printed as a suggestion, and running lvresize --help will display the usage for each possible lvresize command. The prototype syntax used for help/man output includes required --option and positional args on the first line, and optional --option and positional args enclosed in [ ] on subsequent lines. command_name <required_opt_args> <required_pos_args> [ <optional_opt_args> ] [ <optional_pos_args> ] Command definitions that are not to be advertised/suggested have the flag SECONDARY_SYNTAX. These commands will not be printed in the normal help output. Man page prototypes are also generated from the same original command definitions, and are always in sync with the code and help text. Very early in command execution, a matching command definition is found. lvm then knows the operation being done, and that the provided args conform to the definition. This will allow lots of ad hoc checking/validation to be removed throughout the code. Each command definition can also be routed to a specific function to implement it. The function is associated with an enum value for the command definition (generated from the ID string.) These per-command-definition implementation functions have not yet been created, so all commands currently fall back to the existing per-command-name implementation functions. Using per-command-definition functions will allow lots of code to be removed which tries to figure out what the command is meant to do. This is currently based on ad hoc and complicated option analysis. When using the new functions, what the command is doing is already known from the associated command definition.