summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* reporter: global lock needed before process_each_pvdev-dct-process-v25David Teigland2014-10-011-13/+13
| | | | | | | The block of code that acquires the global lock for process_each_pv() was in the wrong location given the way report_type is munged, and does not equal PVS until later in the function.
* toollib: print ignoring voriginZdenek Kabelac2014-10-011-1/+7
| | | | | | | | | | | | When ignoring 'listed' volume, print info message. (So the final command error message is a bit less confusing, i.e. when user tries to deactive virtual origin: > lvchange -an vg/lvol2_vorigin Ignoring virtual origin logical volume vg/lvol2_vorigin. One or more specified logical volume(s) not found. (Reapplied after revert.)
* toollib: process_each_pv workaround for no mda pvsDavid Teigland2014-10-011-13/+26
| | | | | | Add a workaround for a bug somewhere that can cause a pv with no mda to appear in both its real vg and in the orphan vg when not using lvmetad.
* test: add process-each toollib testsDavid Teigland2014-10-014-0/+1933
|
* logging: use flags to enable warningsDavid Teigland2014-10-015-53/+59
| | | | | | | | | | | | | | | The "warnings" arg was used to enable logging of warnings when reading a pv. This arg is turned into a set of flags with the WARN_PV_READ flag matching the existing behavior. A new flag WARN_INCONSISTENT is added that will cause vg_read_internal() to log the "vg is not consistent" warning, and the various callers do not need to log this warning themselves. A new vg_read flag READ_WARN_INCONSISTENT is used from reporting to enable the WARN_INCONSISTENT flag in vg_read_internal.
* vgreduce: use normal process_each_pvDavid Teigland2014-10-013-83/+76
| | | | In the non-repair case.
* toollib: rewrite process_each_pvDavid Teigland2014-10-0111-374/+460
| | | | | | Process pvs by iterating through vgs, then iterating through devs if the command wants to process non-pv devices. The process_single function can always use the vg and pv args.
* toollib: add ENABLE_ALL_DEVS flagDavid Teigland2014-10-012-3/+4
| | | | | | | The ENABLE_ALL_DEVS flag is added to the command structure for commands that should process all devs (pvs and non-pvs) when they call process_each_pv and the command includes the --all arg. This will be used in a later process_each_pv patch.
* toollib: remove unused arg from process_each_lv_in_vgDavid Teigland2014-10-013-4/+2
| | | | | The failed_lvnames arg is no longer used since the cmd_vg replicator wrapper was removed.
* toollib: improve error message in process_each_lv_in_vgDavid Teigland2014-10-011-6/+11
| | | | Include in the error message the lv name args that were not found.
* toollib: rewrite process_each_lvDavid Teigland2014-10-011-297/+334
| | | | | | - Copy the same form as the new process_each_vg. - Replace unused struct cmd_vg and cmd_vg_read() replicator code with struct vg and vg_read() directly.
* toollib: rewrite process_each_vgDavid Teigland2014-10-011-145/+233
| | | | | | | | - Split the collecting of arguments from processing them. - The split allows the two different loops through vgs to be replaced by a single loop. - Replace unused struct cmd_vg and cmd_vg_read() replicator code with struct vg and vg_read() directly.
* toollib: add ALL_VGS_IS_DEFAULT flagDavid Teigland2014-10-012-14/+21
| | | | | | | The ALL_VGS_IS_DEFAULT flag is added to the command structure for commands that should process all vgs when they call process_each_vg or process_each_lv with no args. This will be used in later patches to process_each functions.
* Revert "toollib: print ignoring vorigin"David Teigland2014-10-011-6/+1
| | | | | | This reverts commit 7f4b1e7411d7ff59abe2063db7273fd600e2bf72. will reapply this on top of toollib patch set
* Revert "toollib: refactor skip_dev_dir"David Teigland2014-10-011-31/+31
| | | | This reverts commit b0dde9e8f026ddd6799d6ca534ff9523d633c735.
* Revert "toollib: refactor extract_vgname"David Teigland2014-10-011-34/+37
| | | | This reverts commit 911d6efa51fac96846e109dbff8839cd3fb6cb25.
* Revert "cleanup: rename func"David Teigland2014-10-016-63/+62
| | | | This reverts commit 89e1190ef01943b59207c2093e643a6b06dc9be6.
* Revert "toollib: introduce validate_lvname_param"David Teigland2014-10-012-40/+0
| | | | This reverts commit 0d4baeba18646478e1edb7b26a9f9c74d6add1f5.
* Revert "lvconvert: switch to validate_lvname_param"David Teigland2014-10-011-4/+35
| | | | This reverts commit ad60805ffd6a2a5a52c81bc52d818098f674f44e.
* man: lvmthin mention alternate syntaxDavid Teigland2014-10-011-28/+50
| | | | | Users will probably run across the alternate syntax, so we should explain how it relates to what is used here.
* Revert "Revert "man: lvmcache should use clearer cache pool options""David Teigland2014-10-011-14/+18
| | | | This reverts commit f120c954fc065d67c1aacd5cfba58843eb552b0f.
* filters: refresh filters when lvmetad use is toggledPeter Rajnoha2014-09-307-13/+17
| | | | | | | | | We need to use proper filter chain when we disable lvmetad use explicitly in the code by calling lvmetad_set_active(0) while overriding existing configuration. We need to reinitialize filters in this case so proper filter chain is used. The same applies for the other way round - when we enable lvmetad use explicitly in the code (though this is not yet used).
* filters: use usable device filter and separate lvmetad filter chain so it's ↵Peter Rajnoha2014-09-303-39/+117
| | | | | | | | | | | | | | | | | | | | | | | | not reevaluated for any lvmetad response With this change, the filter chains used look like this now: A) When *lvmetad is not used*: - persistent filter -> regex filter -> sysfs filter -> global regex filter -> type filter -> usable device filter(FILTER_MODE_NO_LVMETAD) -> mpath component filter -> partitioned filter -> md component filter B) When *lvmetad is used* (two separate filter chains): - the lvmetad filter chain used when scanning devs for lvmetad update: sysfs filter -> global regex filter -> type filter -> usable device filter(FILTER_MODE_PRE_LVMETAD) -> mpath component filter -> partitioned filter -> md component filter - the filter chain used for lvmetad responses: persistent filter -> usable device filter(FILTER_MODE_POST_LVMETAD) -> regex filter
* filters: add "usable device" filterPeter Rajnoha2014-09-303-0/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Usable device filter is responsible for filtering out unusable DM devices. The filter has 3 modes of operation: - FILTER_MODE_NO_LVMETAD: When this mode is used, we check DM device usability by looking: - whether device is empty - whether device is blocked - whether device is suspended (only on devices/ignore_suspended_devices=1) - whether device uses an error target - whether device name/uuid is reserved - FILTER_MODE_PRE_LVMETAD: When this mode is used, we check DM device usability by looking: - whether device is empty - whether device is suspended (only on devices/ignore_suspended_devices=1) - whether device uses an error target - whether device name/uuid is reserved - FILTER_MODE_POST_LVMETAD: When this mode is used, we check DM device usability by looking: - whether device is blocked - whether device is suspended (only on devices/ignore_suspended_devices=1) These modes will be used by subsequent patch to create different instances of this filter, depending on lvmetad use.
* refactor: make it possible to select what to check exactly when calling ↵Peter Rajnoha2014-09-306-33/+32
| | | | | | | | | | | | | | | | | device_is_usable fn Currently, there are 5 things that device_is_usable function checks (for DM devices only, of course): - is device empty? - is device blocked? (mirror) - is device suspended? - is device composed of an error target? - is device name/uuid reserved? If answer to any of these questions is "yes", then the device is not usable. This patch just adds possibility to choose what to check for exactly - the device_is_usable function now accepts struct dev_usable_check_params make this selection possible. This is going to be used by subsequent patches.
* conf: Update comments on lvmetad+filters in example.conf.in.Petr Rockai2014-09-301-15/+20
|
* man: lvmthin remove unnecessary fixmeDavid Teigland2014-09-291-6/+0
| | | | | The existing method for single step thin-pool + thin creation makes sense.
* Revert "Revert "man: lvmthin should use clearer thin pool options""David Teigland2014-09-291-19/+31
| | | | | | This reverts commit 17a1869df506a3641d49d52c413b5bc04ec2adc9. We've agreed on the clearer syntax.
* valgrind: don't eat mem with valgrindZdenek Kabelac2014-09-281-0/+3
| | | | | | | | | When compiled with valgrind pool support - don't waste time with preallocation of memory - it just waste of CPU cycles to trace access to this memory. We also may get slightly better estimation about real memory usage during command processing.
* cleanup: drop unused variableZdenek Kabelac2014-09-281-2/+1
|
* lvconvert: switch to validate_lvname_paramZdenek Kabelac2014-09-281-35/+4
| | | | Use new toollib function for validation.
* toollib: introduce validate_lvname_paramZdenek Kabelac2014-09-282-0/+40
| | | | Function for parsing and validating of lvname parameter.
* cleanup: rename funcZdenek Kabelac2014-09-286-62/+63
| | | | | | | Update name of function read_and_validate_major_minor and put it into the right header file toollib.h. (In release update for f09f85d027d8833)
* toollib: refactor extract_vgnameZdenek Kabelac2014-09-281-37/+34
| | | | | | | | | | | Split internals of extract_vgname into _extract_vgname. This common code will be used for other similar function. Reuse skip_dev_dir() instead of less mature coded to skip device dir. Instead of duplicating full vg/lv name - allocate string only vg portion of lv name.
* toollib: refactor skip_dev_dirZdenek Kabelac2014-09-281-31/+31
| | | | Detect dev dir just once.
* Revert "man: lvmcache should use clearer cache pool options"Zdenek Kabelac2014-09-271-18/+14
| | | | | | | | Revert: --cachepool and --thipnpool is the right way they both take arg This is a major difference from --cache and --thin
* Revert "man: lvmthin should use clearer thin pool options"Zdenek Kabelac2014-09-271-31/+19
| | | | | | | | Revert: --cachepool and --thipnpool is the right way they both take arg This is a major difference from --cache and --thin
* man: lvmthin should use clearer thin pool optionsDavid Teigland2014-09-261-19/+31
| | | | | | | | | | | | | Previously, this was the recommended form for creating a thin pool: lvconvert --thinpool VG/ThinDataLV --poolmetadata VG/ThinMetaLV but this is confusing, because --thinpool does not actually take an arg, and is more naturally used to specify an existing thin pool. The new recommended form is: lvconvert --type thin-pool --poolmetadata VG/ThinMetaLV VG/ThinDataLV
* man: lvmcache should use clearer cache pool optionsDavid Teigland2014-09-261-14/+18
| | | | | | | | | | | | | Previously, this was the recommended form for creating a cache pool: lvconvert --cachepool VG/CacheDataLV --poolmetadata VG/CacheMetaLV but this is confusing, because --cachepool does not actually take an arg, and is more natually used to specify an existing cache pool. The new recommended form is: lvconvert --type cache-pool --poolmetadata VG/CacheMetaLV VG/CacheDataLV
* lvchange: missed bits for a8aee7dba2b76Zdenek Kabelac2014-09-241-14/+11
| | | | | | lv_info is not used here any more. This code should have been committed with lv_check_not_in_use API change commit.
* cleanup: Use segtype.h definitions of segment type names wherever possibleHeinz Mauelshagen2014-09-246-33/+34
| | | | | | | | We are not using already defined segement type names where we could. There is a lot of other places in device-mapper and LVM2 we have those hardcoded so we should better finally have a common interface in libdevmapper to avoid this.
* tests: add helper funcionality for using gdbZdenek Kabelac2014-09-241-1/+8
| | | | | | When there is need for using gdb within test suite just prefix command with LVM_DBG and run test in standard shell (for stdin).
* tests: drop * from dmsetupZdenek Kabelac2014-09-241-1/+1
| | | | We cannot use shell expansion for dmsetup here.
* debug: add debug messageZdenek Kabelac2014-09-241-1/+5
| | | | | Since we leave error printing on the called of deactivation, at least put in debug log for this case.
* debug: show stacktrace on error pathZdenek Kabelac2014-09-241-3/+5
|
* debug: drop printing debug trace without labelerZdenek Kabelac2014-09-241-8/+5
| | | | Not having labeller on device is not reason eo generate backtrace in log.
* debug: add missing stack traceZdenek Kabelac2014-09-241-1/+3
|
* debug: monitor_dev_for_events stack traceZdenek Kabelac2014-09-241-6/+17
|
* cleanup: reindentZdenek Kabelac2014-09-242-7/+4
| | | | Save some code lines.
* cleanup: drop duplicate const usageZdenek Kabelac2014-09-241-3/+3
| | | | const char == const char const.