summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* generate man pagesdev-dct-cmd-defs86David Teigland2017-02-13122-6584/+1054
|
* args: use arg parsing function for region sizeDavid Teigland2017-02-1310-66/+67
| | | | | Consolidate the validation of the region size arg in a new arg parsing function.
* lvconvert: remove code for changing region sizeDavid Teigland2017-02-131-12/+4
| | | | from the generic raid type conversion code.
* lvconvert: add command to change region size of a raid LVDavid Teigland2017-02-137-1/+33
|
* vgchange: fix uint32 parsing of logicalvolume argDavid Teigland2017-02-132-5/+5
|
* commands: recognize raid variationsDavid Teigland2017-02-132-11/+7
|
* commands: move command def parsing into lvm binaryDavid Teigland2017-02-1313-3535/+2847
| | | | It was previously done at build time by the ccmd binary.
* lvconvert: remove unused codeDavid Teigland2017-02-131-39/+7
| | | | For "split" which is not an alias for splitmirrors.
* args: split is a synonym for splitcacheDavid Teigland2017-02-133-33/+31
| | | | also tidy the other synonyms
* man: lvmthin updatesDavid Teigland2017-02-131-12/+9
| | | | | Some minor changes to some of the command syntaxes to use more standard forms.
* ccmd: split into multiple filesDavid Teigland2017-02-136-3174/+3238
|
* command struct: remove command name refsDavid Teigland2017-02-138-30/+26
| | | | | | | Change run time access to the command_name struct cmd->cname instead of indirectly through cmd->command->cname. This removes the two run time fields from struct command.
* command.h comment tidyingDavid Teigland2017-02-131-8/+6
|
* lvm shell: clear argv for each commandDavid Teigland2017-02-131-1/+4
|
* help: accept positional argsDavid Teigland2017-02-131-0/+1
| | | | lvm help <commandname> ...
* fix lvmcmdline warningDavid Teigland2017-02-131-20/+20
| | | | declaration of ‘usage’ shadows a globa
* man lvm: remove optionsDavid Teigland2017-02-131-255/+3
| | | | all options are now included in commands
* args: add man page descriptionsDavid Teigland2017-02-134-268/+1611
|
* args: use uint32 arg for maxphysicalvolumesDavid Teigland2017-02-134-4/+6
|
* lvconvert: remove unused codeDavid Teigland2017-02-131-1731/+325
|
* lvconvert: use command defs for raid/mirror typesDavid Teigland2017-02-134-797/+323
| | | | | | | | | | All lvconvert functionality has been moved out of the previous monolithic lvconvert code, except conversions related to raid/mirror/striped/linear. This switches that remaining code to be based on command defs, and standard process_each_lv arg processing. This final switch results in quite a bit of dead code that is also removed.
* tests: use swapmetadataDavid Teigland2017-02-135-33/+33
| | | | and some other pool/cache/thin related changes
* lvconvert: use command defs for mergemirrorsDavid Teigland2017-02-135-40/+111
| | | | | and route the generic --merge to one of the specific merge functions
* toollib: find VG name in option values when neededDavid Teigland2017-02-134-2/+162
|
* lvconvert: use command defs for thin/cache/pool creationDavid Teigland2017-02-1310-74/+1394
| | | | Everything related to thin and cache.
* lvconvert: add startpoll command using command defDavid Teigland2017-02-136-18/+86
| | | | | | This is a new explicit version of 'lvconvert LV' which has been an obscure way of triggering polling to be restarted on an LV that was previously converted.
* lvconvert: snapshot: use command definitionsDavid Teigland2017-02-1310-140/+277
| | | | | | | Lift all the snapshot utilities (merge, split, combine) out of the monolithic lvconvert implementation, using the command definitions. The old code associated with these commands is now unused and will be removed separately.
* lvconvert: remove unused calls for repair and replaceDavid Teigland2017-02-131-227/+10
| | | | | repair and replace are no longer called from the monolithic lvconvert code, so remove the unused code.
* lvconvert: repair and replace: use command definitionsDavid Teigland2017-02-134-18/+330
| | | | | | | This lifts the lvconvert --repair and --replace commands out of the monolithic lvconvert implementation. The previous calls into repair/replace can no longer be reached and will be removed in a separate commit.
* lvchange: make use of command definitionsDavid Teigland2017-02-134-452/+430
| | | | | | Reorganize the lvchange code to take advantage of the command definition, and remove the validation that is done by the command definintion rules.
* process_each_lv: add check_single_lv functionDavid Teigland2017-02-1311-15/+38
| | | | | | | | | | | | | | | | | The new check_single_lv() function is called prior to the existing process_single_lv(). If the check function returns 0, the LV will not be processed. The check_single_lv function is meant to be a standard method to validate the combination of specific command + specific LV, and decide if the combination is allowed. The check_single function can be used by anything that calls process_each_lv. As commands are migrated to take advantage of command definitions, each command definition gets its own entry point which calls process_each for itself, passing a pair of check_single/process_single functions which can be specific to the narrowly defined command def.
* commands: new method for defining commandsDavid Teigland2017-02-1327-1836/+7305
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | . 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.
* lvmlockd: test mode doesn't workDavid Teigland2017-02-131-0/+5
| | | | | | The --test option is not yet compatible with shared VGs because changes are made in lvmlockd that cannot be reversed or faked.
* tests: updateZdenek Kabelac2017-02-131-10/+8
|
* tests: fix dev pathZdenek Kabelac2017-02-132-33/+34
| | | | | | Use proper device path for test devices. Use mkfs.ext4 and drop 'echo y|' to it. Use smaller device size to consume less memory and CPU time.
* cleanup: use matching signed number comparationZdenek Kabelac2017-02-136-8/+8
|
* cleanup: use matching const typeZdenek Kabelac2017-02-132-6/+6
|
* cleanup: use fall throughZdenek Kabelac2017-02-132-1/+6
| | | | gcc gets 'selective' on having commented fall through case.
* cleanup: fix warning about shadowed declarationZdenek Kabelac2017-02-133-5/+6
| | | | Avoid shadowing lv_size as lv_size() is already defined function in lv.h
* cleanup: use proper printf specifierZdenek Kabelac2017-02-131-1/+1
|
* config: update docZdenek Kabelac2017-02-132-1/+4
|
* dmeventd: limit thin_command usageZdenek Kabelac2017-02-131-18/+29
| | | | | | Require usable command string to begining with '/' So 'thin_command = "/some/path/command"' is the only supported variant to internal 'lvm' command.
* coverity: fix double freeZdenek Kabelac2017-02-121-1/+1
| | | | Do not try to free hist_arg twice.
* coverity: fix mem leak on error path in dm statsZdenek Kabelac2017-02-121-1/+3
| | | | Free allocated resouces on error path.
* coverity: remove unneeded header filesZdenek Kabelac2017-02-113-3/+0
|
* cleanup: drop double const specifierZdenek Kabelac2017-02-111-4/+6
| | | | | Remove duplicated 'const' specifier. Reindent.
* mem: add extra mem pages for pthread stackZdenek Kabelac2017-02-115-3/+5
| | | | | | | | | Some archs can use even 64K pages and then lvm2 runs into trouble if the stack is 'too small' to fit extra page capturing stack overwrite. So when lvm2 limits stack - add extra mem page - be it 4K or 64K. Relates to ppc64le bug: https://bugzilla.redhat.com/1387279
* lvconvert: remove test codeHeinz Mauelshagen2017-02-101-4/+2
| | | | | | | Remove allocate_pvs from raid_manip.c:_region_size_change_request() API and lv_extend() using it added for temporary test purpose. Related: rhbz1366296
* lvconvert: add region size checksHeinz Mauelshagen2017-02-102-26/+51
| | | | | | | | | Add: - region size checks to raid_manip.c types array and supporting functions - tests to lvconvert-raid-takeover.sh to check bogus "lvconvert --type --regionsize N " requests Related: rhbz1366296
* test: lvresize-raid.sh missing conditionalHeinz Mauelshagen2017-02-101-2/+3
| | | | | | Test missed to check for raid0 present in the kernel. Related: rhbz1366296