summaryrefslogtreecommitdiffstats
path: root/tools/lvmcmdline.c
Commit message (Collapse)AuthorAgeFilesLines
* cleanup: drop unneeded included header filesZdenek Kabelac2012-08-231-3/+0
| | | | | This headers were not resolving anything used for compiled .c files. Remove unused util.c file.
* thin: use discards as plural rather than singularAlasdair G Kergon2012-08-071-5/+5
| | | | Global change from --discard to --discards, as that feels more natural.
* args: increase major:minor limit to 4095:1048575Peter Rajnoha2012-08-061-32/+29
| | | | | | | | | Remove the limit for major and minor number arguments used while specifying persistent numbers via -My --major <major> --minor <minor> option which was set to 255 before. Follow the kernel limit instead which is 12 bits for major and 20 bits for minor number (kernel >= 2.6 and LVM formats that does not have FMT_RESTRICTED_LVIDS - so still keep the old limit of 255 for lvm1 format).
* thin: add discard support for thin poolZdenek Kabelac2012-07-181-0/+13
| | | | | | | | Add arg support for discard. Add discard ignore, nopassdown, passdown (=default) support. Flags could be set per pool. lvcreate [--discard {ignore|no_passdown|passdown}] vg/thinlv
* activate: add autoactivation hooksPeter Rajnoha2012-06-281-0/+6
| | | | | | | | | | | | | | | | Define an 'activation_handler' that gets called automatically on PV appearance/disappearance while processing the lvmetad_pv_found and lvmetad_pv_gone functions that are supposed to update the lvmetad state based on PV availability state. For now, the actual support is for PV appearance only, leaving room for PV disappearance support as well (which is a more complex problem to solve as this needs to count with possible device stack). Add a new activation change mode - CHANGE_AAY exposed as '--activate ay/-aay' argument ('activate automatically'). Factor out the vgchange activation functionality for use in other tools (like pvscan...).
* args: add --activate synonym for --available argPeter Rajnoha2012-06-281-2/+3
| | | | | | | | We're refererring to 'activation' all over the code and we're talking about 'LVs being activated' all the time so let's use 'activation/activate' everywhere for clarity and consistency (still providing the old 'available' keyword as a synonym for backward compatibility with existing environments).
* spacingAlasdair Kergon2012-04-111-1/+1
|
* Fix a regression in handling --major/--minor arguments to lvcreate & lvchange,Petr Rockai2012-03-161-1/+16
| | | | by allowing arg_int_value to be used with groupable options.
* Fix error path for create_toolcontextZdenek Kabelac2012-03-121-1/+4
| | | | | | | Never return unfinished toolcontext - since error path is hit on various stages of initialization we cannot leave it partially uninitialized, since we would need to spread many more test across the code for config_valid. Instead return NULL and properly release udev library resources as well.
* Switch pvscan --cache major:minor to --major --minor.Alasdair Kergon2012-03-061-0/+5
|
* Log sys errorsZdenek Kabelac2012-03-011-3/+6
|
* Initialize dmeventd monitoring for every commandZdenek Kabelac2012-02-151-0/+6
| | | | | | | | | | Read lvm.conf setting for monitoring for each command. So we should not activate monitoring if the default compilation is set to monitor during lvconvert commnads. Patch also removes check for clustered VG and allows to disable monitoring for clustered VG with the assumption, the problem with monitoring and dmeventd flag passing for INGNORE is already fixed.
* Handle all succefull values from open()Zdenek Kabelac2012-02-131-1/+1
|
* Only use built-in stack size in clvmd - ignore lvm.conf.Alasdair Kergon2011-12-081-1/+1
|
* Fix command line option decodingZdenek Kabelac2011-09-161-2/+2
| | | | | | | | | LVM has huge set of options now - it's approaching 60 short-arg less options and we get interesting case of misdetection for 'merge' option which has been put into the middle of options with 'short_arg' - thus certainly past 65. (ASCII 'A'). To avoid confusion of short_arg with long_opt number - add '128' to all such non-short-arg options.
* Move cascade inside libdm etc.Alasdair Kergon2011-09-021-9/+7
| | | | | | Makes dumpconfig whole-section output wrong in a different way from before, but we should be able to merge cft_cmdline properly into cmd->cft now and remove cascade.
* Add 'empty' commandZdenek Kabelac2011-08-041-0/+1
| | | | Using empty command ';' here makes the code look nicer.
* Remove self assigment which has no effectZdenek Kabelac2011-08-041-2/+1
| | | | Just a tiny code cleanup found by analyzer.
* Move _set_lvm_fallback into toolcontext, fix string comparison (/devtestAlasdair Kergon2011-06-271-49/+3
| | | | | matched /dev) and note that function should go anyway as it can be overriding a valid config.
* Disable udev fallback by default and add activation/udev_fallback to lvm.conf.Peter Rajnoha2011-06-171-2/+5
| | | | | | | | | | | | | | | | | | | We've used udev fallback code till now to check whether udev created/removed the entries in /dev correctly and if not, a repair was done (giving a warning messagea about that). This patch adds a possibility to enable this additional check and subsequent fallback only when required (debugging purposes mostly) and trust udev completely. So let's disable the fallback code by default and add a new configuration option "activation/udev_fallback". (The original code for creating the nodes will still be used in case the device directory that is set in lvm.conf differs from the one that udev uses and also when activation/udev_rules is set to 0 - otherwise we would end up with no nodes/symlinks at all)
* When glibc needs buffers for line buffering of input and output buffers, itPetr Rockai2011-05-071-1/+1
| | | | | | | | | | | | allocates these buffers in such way it adds memory page for each such buffer and size of unlock memory check will mismatch by 1 or 2 pages. This happens when we print or read lines without '\n' so these buffers are used. To avoid this extra allocation, use setvbuf to set these bufffers ahead. Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com> Reviewed-by: Milan Broz <mbroz@redhat.com> Reviewed-by: Petr Rockai <prockai@redhat.com>
* Use common udev_get_dev_dir() to get current device directory managed by udev.Peter Rajnoha2011-04-221-4/+1
|
* Obtain device list from udev by default if LVM2 is compiled with udev support.Peter Rajnoha2011-04-221-0/+4
| | | | | | | | | | | | | | Also, add a new 'obtain_device_list_from_udev' setting to lvm.conf with which we can turn this feature on or off if needed. If set, the cache of block device nodes with all associated symlinks will be constructed out of the existing udev database content. This avoids using and opening any inapplicable non-block devices or subdirectories found in the device directory. This setting is applied to udev-managed device directory only, other directories will be scanned fully. LVM2 needs to be compiled with udev support for this setting to take effect. N.B. Any device node or symlink not managed by udev in udev directory will be ignored with this setting on.
* Require libudev >= 143 when compiling with udev support.Peter Rajnoha2011-04-221-1/+0
| | | | | Old versions of libudev < 143 were experimental and unstable. Require recent and stable versions only (version 143 is old enough anyway).
* Fix some unmatching sign comparation gcc warningsZdenek Kabelac2011-04-081-1/+1
| | | | Simple replacement for unsigned type - usually in for() loops.
* Do not log backtrace for correctly processed commandZdenek Kabelac2011-01-131-2/+5
|
* Remove dead store in lvm_run_commandZdenek Kabelac2010-12-201-2/+2
| | | | Variable 'ret' is not read before its next assignment.
* Test return value from read() and close() for an error.Zdenek Kabelac2010-12-201-6/+10
|
* Refactor the percent (mirror sync, snapshot usage) handling code to usePetr Rockai2010-11-301-1/+1
| | | | fixed-point values instead of a combination of a float value and an enum.
* Remove dead assignment in lvm2_mainZdenek Kabelac2010-11-291-1/+0
| | | | | 'alias' is not read again in this code path. Also 'alias' is already equal to 0 in this place.
* Add missing destrustion of cmd_contextZdenek Kabelac2010-11-241-2/+4
| | | | Lvm1 fallback code missed to destroy cmd_context in error path.
* Remove tag length restriction and allow / = ! : # & characters.Alasdair Kergon2010-11-171-1/+1
|
* Support repetition of --addtag and --deltag arguments.Alasdair Kergon2010-11-111-155/+181
| | | | | Add infrastructure for specific cmdline arguments to be repeated in groups. Split the_args cmdline arguments and values into arg_props and arg_values.
* Add global/metadata_read_only to use unrepaired metadata in read-only cmds.Alasdair Kergon2010-10-251-0/+7
|
* Fix memory leak of config_treeZdenek Kabelac2010-09-301-0/+4
| | | | Adding missing destroy_config_tree() for cft_override if it has been allocated.
* Use __attribute__ consistently throughout.Alasdair Kergon2010-07-091-22/+22
|
* Fix --[vg]metadatacopies arg processingAlasdair Kergon2010-06-301-18/+11
|
* Update partial mode warning message.Alasdair Kergon2010-06-301-2/+1
|
* Allow 'all' and 'unmanaged' values for --vgmetadatacopies.Dave Wysochanski2010-06-281-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | Allowing an 'all' and 'unmanaged' value is more intuitive, and provides a simple way for users to get back to original LVM behavior of metadata written to all PVs in the volume group. If the user requests "--vgmetadatacopies unmanaged", this instructs LVM not to manage the ignore bits to achieve a specific number of metadata copies in the volume group. The user is free to use "pvchange --metadataignore" to control the mdas on a per-PV basis. If the user requests "--vgmetadatacopies all", this instructs LVM to do 2 things: 1) clear all ignore bits, and 2) set the "unmanaged" policy going forward. Internally, we use the special MAX_UINT32 value to indicate 'all'. This 'just' works since it's the largest value possible for the field and so all 'ignore' bits on all mdas in the VG will get cleared inside _vg_metadata_balance(). However, after we've called the _vg_metadata_balance function, we check for the special 'all' value, and if set, we write the "unmanaged" value into the metadata. As such, the 'all' value is never written to disk. Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
* Ensure --metadatacopies parameter gets interpreted based on command.Dave Wysochanski2010-06-281-2/+7
| | | | | | | | | | | | | | | | Now that we have both --pvmetadatacopies and --vgmetadatacopies, we need to make sure --metadatacopies gets interpreted correctly. For pv commands, --metadatacopies should imply --pvmetadatacopies, and for vg commands, --vgmetadatacopies. Note: this will change the behavior of vgcreate with --metadatacopies to be a synonym for --vgmetadatacopies. Previously, --metadatacopies would apply to any PVs given with vgcreate that needed an implicit pvcreate. As a result, one small change is needed to one of the nightly tests - t-vgcreate-usage. Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
* Add new --sysinit option for vgchange and lvchange.Peter Rajnoha2010-05-061-2/+2
| | | | | | A shortcut for --ignorelockingfailure, --ignoremonitoring, --poll n options and LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES environment variable used all at once in initialisation scripts (e.g. rc.sysinit or initrd).
* Suppress duplicate error messages about read failures and missing devices.Petr Rockai2010-05-051-0/+1
|
* And be consistent with return code as well (previous commit).Peter Rajnoha2010-04-301-1/+1
|
* Don't run any complex initialisation for the "version" lvm2 command.Peter Rajnoha2010-04-301-0/+4
| | | | | | | We can use it even in read-only environment where a try to initialise file-based locking fails (not to mention other processing related with lvm2 init). Simply, we want to output the version only, nothing else. And this should always work.
* Remove no-longer-used arg_ptr_value.Alasdair Kergon2010-04-291-22/+8
| | | | Fix -M and --type to use strings not pointers that change on config refresh.
* UDEV_SYNC_SUPPORT, not UDEV_SYNC!Peter Rajnoha2010-03-231-1/+1
|
* Strictly require libudev if udev_sync is used.Peter Rajnoha2010-03-231-2/+2
| | | | | | | | This prevents some confusion when libudev was not found so udev_sync was disabled automatically. Configure was successful though giving only a tiny warning. Also, if "dmsetup udevcreatecookie" is used, never return 0x000000 as a result if udev is not running and keep the output blank.
* Don't use LVM_UDEV_DISABLE_CHECKING environment variable anymore.Peter Rajnoha2010-02-151-8/+42
| | | | | Set the state automatically based on udev and libdevmapper dev path comparison. If these paths differ, disable udev checking.
* Add %ORIGIN support to lv{create,extend,reduce,resize} --extents optionMike Snitzer2010-02-031-0/+3
| | | | | | | | | | | Allow the number of logical extents to be expressed (for a snapshot) as a percentage of the total space in the Origin Logical Volume with the suffix %ORIGIN. Update the relevant man pages accordingly. Eliminate inconsistencies between the man pages and tools/commands.h Signed-off-by: Mike Snitzer <snitzer@redhat.com>
* Move error message to locking constructor and printMilan Broz2010-01-221-2/+0
| | | | | | | | more descriptive message if locking fails instead of "Locking type -1 initialisation failed." Use read-only locking instead of misleading ignorelocking option in message.