summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* lvmcache: check pv_in_use for duplicatesdev-dct-duplicate-pv-in-useDavid Teigland2016-06-0211-28/+67
| | | | | | | | It's possible for one duplicate to be used by a VG and another not, e.g. the PV is cloned, and then one of the PVs is used for vgcreate. In this case, the duplicate code should prefer the PV that is used by a VG.
* man: lvmconfig: add note about --type diff and --mergedconfigPeter Rajnoha2016-06-021-0/+1
|
* lvmconfig: fix lvmconfig --type diff to display complete diff if config ↵Peter Rajnoha2016-06-022-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cascade used If configuration consists of several sources in config cascade ("config cascade" defined in man lvmconfig(8)), lvmconfig displayed only difference from defaults of the topmost config in the cascade. Fix lvmconfig to display complete difference, considering all the configuration in the cascade. For example, before this patch: (use_lvmetad=0 set in lvm.conf which differs from defaults) $ lvmconfig --type diff global { use_lvmetad=0 } (compact_output=1 set on cmd line) $ lvmconfig --type diff --config report/compact_output=1 report { compact_output=1 } (headings=0 set in profile) $ lvmconfig --type diff --commandprofile test report { headings=0 } (difference in topmost configuration source is displayed) $ lvmconfig --type diff --commandprofile test --config report/compact_output=1 report { compact_output=1 } With this patch applied (the config cascade is merged before looking for difference from defaults in configuration): $ lvmconfig --type diff global { use_lvmetad=0 } $ lvmconfig --type diff --config report/compact_output=1 report { compact_output=1 } global { use_lvmetad=0 } $ lvmconfig --type diff --profile test report { headings=0 } global { use_lvmetad=0 } $ lvmconfig --type diff --profile test --config report/compact_output=1 report { headings=0 compact_output=1 } global { use_lvmetad=0 }
* make: add generated parts of lvmdbusd to DISTCLEAN_TARGETS for make distcleanPeter Rajnoha2016-06-022-0/+4
|
* cleanup: use display_nameZdenek Kabelac2016-06-012-5/+4
|
* tests: check losetup -P is correctly handledZdenek Kabelac2016-06-011-0/+63
| | | | Validate pvcreate will not overwrite partitioned loop device.
* tests: extend prepare_loopZdenek Kabelac2016-06-011-3/+4
| | | | Treat args after size as 'extra' params for losetup.
* devices: handle partscan loop devicesZdenek Kabelac2016-06-013-0/+45
| | | | | | | | | Treat loop device created with 'losetup -P' as regular partitioned device - so if it has partition table, prevent its usage in commands like 'pvcreate'. Before 'pvcreate /dev/loop0' could have erased and formated as PV, after this patch, device is filtered out and cannot be used.
* coverity: fix warnings about missing return value check for sscanfPeter Rajnoha2016-05-312-8/+8
| | | | | | | All the variables for sscanf in lvmlockctl.c and lvmlockd-sanlock.c are zeroed before sscanf call so the failure is detected by seeing the zero value instead of proper one in subsequent code - so use (void) for sscanf calls to ignore return value here.
* coverity: missing check for id_write_format return valuePeter Rajnoha2016-05-315-11/+22
|
* coverity: blkdeactivate: separate format and args for printf and declare and ↵Peter Rajnoha2016-05-311-3/+5
| | | | assign separately to avoid masking return values
* coverity: fix possible resource leak of descendants_buffer in ↵Peter Rajnoha2016-05-312-1/+2
| | | | _print_historical_lv fn
* tests: add dmstats to CLEAN_TARGETS for make cleanPeter Rajnoha2016-05-311-1/+1
|
* toollib: properly reset selection handle on selection failure in ↵Peter Rajnoha2016-05-311-12/+12
| | | | select_match_{pv,vg,lv}
* report: fix lvm devtypes internal error if -S is used with field name from ↵Peter Rajnoha2016-05-302-5/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pvs/vgs/lvs Before this fix, when reporting 'lvm devtypes', the report was initialized with incorrect reserved values - the ones used for pvs/vgs/lvs report were used instead of NULL value (because devtypes doesn't have any reserved values). For example, trying to (incorrectly) use lv_name for the -S|--select with lvm devtypes which doesn't have this field at all: Before this patch (internal error issued): $ lvm devtypes -S 'lv_name=lvol0' Internal error: _check_reserved_values_supported: field-specific reserved value of type 0x0 for field not supported Internal error: dm_report_init_with_selection: trying to register unsupported reserved value type, skipping report selection DevType MaxParts Description aoe 16 ATA over Ethernet ataraid 16 ATA Raid bcache 1 bcache block device cache ... With this patch applied (correct error displayed about unrecognized selection field): $ lvm devtypes -S 'lv_name=lvol0' Device Types Fields ------------------- devtype_name - Name of Device Type exactly as it appears in /proc/devices. [string] devtype_max_partitions - Maximum number of partitions. (How many device minor numbers get reserved for each device.) [number] devtype_description - Description of Device Type. [string] Special Fields -------------- selected - Set if item passes selection criteria. [number] help - Show help. [unselectable number] ? - Show help. [unselectable number] Unrecognised selection field: lv_name Selection syntax error at 'lv_name=lvol0'. Use 'help' for selection to get more help.
* toollib: simplify internal selection calls for non-reporting toolsPeter Rajnoha2016-05-304-48/+34
| | | | | Some of the variables were set superfluously - we can just use existing "struct processing_handle" which includes "struct selection_handle".
* tests: check thin is not flushed for statusZdenek Kabelac2016-05-271-0/+4
| | | | | We finally approach a moment where we generally avoid flushing thin-pool with every lvs command...
* snapshot: for invalid snapshot show 100%Zdenek Kabelac2016-05-271-1/+3
| | | | | Recent commit 92eba53a797a011d1ce6fbd7bef88eab41af2072 started to report empty "" data usage of invalid snapshot, restore 100% to be shown.
* tests: stacked snapshot mergeZdenek Kabelac2016-05-271-0/+85
|
* tests: check cache_mode change on cachepoolZdenek Kabelac2016-05-271-0/+20
|
* debug: use display_lvnameZdenek Kabelac2016-05-272-18/+21
|
* cache: add log_error on error pathZdenek Kabelac2016-05-272-7/+18
| | | | | Validate and report error when lv_cache_status is called for inactive LV, or pending delete or unused cache_pool.
* report: convert more options to use single statusZdenek Kabelac2016-05-273-66/+29
| | | | | | | | | | | | | | Convert fields into using a single status ioctl call per LV. This is a bit tricky since when there are more complicated stacks, at this moment its undefined which values should be shown. It's clear we need to cache more then single ioctl per LV, but also we need to define more explicitely relation between reported values for snapshots. This patch is not a final state, rather a transitional step. It should not be giving more 'worst' values then previous many-ioctl-calls-per-lv solution.
* snapshot: use seg_status for attrsZdenek Kabelac2016-05-271-7/+5
|
* lv: introduce lvseg_percent_with_info_and_seg_statusZdenek Kabelac2016-05-273-0/+92
| | | | | | | | | Add function to obtain percentage value for cache lv_seg_status. This API is rather evolving 'middle' step as the ultimate goal is segment API fuctionality. But first we need to be clear at reporting level which values are needed to be reported for which LVs and segments.
* lvstatus: enhance seg_status to handle snapshotZdenek Kabelac2016-05-273-12/+50
| | | | | | | | | | | | | | | | | | | | | | Add more code to properly store status for snapshot segment maintaining lvm2 fiction of COW and snapshot internal volumes. The key issue here is however not though-through reporting logic - as there is no single answer for whole line state. It not counting with layer and we may need few more ioctl to cover all reporting needs depending upon what is actually needed. In reality we need to 'cache' more ioctl status queries for individual LVs and their segments (so they checked at most once). The other 'hard' topic for conversion is mirror segment handling. Also we definitelly need to relocate some logic into segment's methods, yet it might be complex as we have not clear border between targets. TODO: define more clearly how are reporting fields defined in case we 'stack' volumes like - cache of stacked thin LV snapshot origin.
* refresh: call resume after failing suspendZdenek Kabelac2016-05-272-3/+5
| | | | | | | lv_refresh_suspend_resume() has escaped with fail ret code after failing suspend and could have left many volumes in suspend state. So always unconditionally call resume also when suspend has failed.
* cleanup: drop cmd and constify lv for lv_refresh_suspend_resume()Zdenek Kabelac2016-05-275-6/+8
| | | | | Like with most other lv_manip* functions take just LV arg and get cmd from embeded pointer when needed.
* cleanup: substract integersZdenek Kabelac2016-05-271-2/+2
| | | | | Instead of doing float arithmetic, do integer math first and convert result to float.
* cache: enhance lv_cache_wait_for_cleanZdenek Kabelac2016-05-272-12/+16
| | | | Handle passthrough mode when checking cache mode state explicitely.
* cache: call status only on cache pool in useZdenek Kabelac2016-05-274-5/+7
| | | | Check show cache status only for cache pool in use.
* setup_task: add with_flushZdenek Kabelac2016-05-274-38/+30
| | | | | | | | | | | To get better control when flushing is used add extra arg when setting up dm task. By default now check dm device status without flush. (At this moment this should effect only thin and cache volumes). Also switch dev_manager_thin_pool_status() to use more readable 'flush' parameter instead of 'no_flush'.
* snapshot: check merging_cow is cowZdenek Kabelac2016-05-272-1/+7
| | | | | | | Check first the LV is cow before even checking it's a merging COW. Note: previosly merging_cow was also merging origin, so without this explicit check it used to return '1' also when passed LV has been merging origin.
* report: fix report copy_percent valueZdenek Kabelac2016-05-272-1/+2
| | | | | | | | | | When mirror/raid called copy_percent function to return, when 100% was supposed to be returned, wrong float 100.0 value could have been reported back instead of dm_percent_t DM_PERCENT_100. There is broken API somewhere, since the function here rely on actively being modifid VG content even when doing 'lvs' operation. (extents_copies)
* Revert "libdm: trace missing settings"Alasdair G Kergon2016-05-272-13/+3
| | | | | | | | | | | | | This reverts commit 8fd886f735125de4b3e32fc0a188af0192a0d173. This was a deliberate omission because logging token-by-token metadata parsing greatly increases the amount of logging for hardly any benefit. In general, only LVM config file settings need to be logged, and in places where it's considered important to log particular elements of metadata that should be done using specific log_* lines. This area can be revisited.
* WHATS_NEW: include recent changesDavid Teigland2016-05-261-0/+3
|
* vgreduce: use process_each_vgdev-dct-use-process-eachDavid Teigland2016-05-252-79/+62
|
* lvconvert: use process_each_lvDavid Teigland2016-05-259-78/+76
| | | | | | In the same way that process_each_vg() can be passed a single VG name to process, also allow process_each_lv() to be passed a single VG name and LV name to process.
* raid: Revert _lv_extend_layered_lv non-raid0 area_multiple.Alasdair G Kergon2016-05-241-1/+2
|
* refactor: split _report fn further into init and config partPeter Rajnoha2016-05-241-56/+67
|
* metadata: Tidy merge.cAlasdair G Kergon2016-05-241-3/+5
|
* raid10: Fix new use of area multiple calc.Alasdair G Kergon2016-05-241-1/+1
|
* raid0: Standardise meta_areas checks before access.Alasdair G Kergon2016-05-239-19/+21
|
* test: lvmetad-disabledDavid Teigland2016-05-231-1/+1
|
* test: lvmetad-pvscan-filterDavid Teigland2016-05-231-6/+24
| | | | update for pvscan changes
* pvscan: use process_each_vg for autoactivateDavid Teigland2016-05-2311-284/+334
| | | | | | | | | | | | | | | | | | | | | | | This refactors the code for autoactivation. Previously, as each PV was found, it would be sent to lvmetad, and the VG would be autoactivated using a non-standard VG processing function (the "activation_handler") called via a function pointer from within the lvmetad notification path. Now, any scanning that the command needs to do (scanning only the named device args, or scanning all devices when there are no args), is done first, before any activation is attempted. During the scans, the VG names are saved. After scanning is complete, process_each_vg is used to do autoactivation of the saved VG names. This makes pvscan activation much more similar to activation done with vgchange or lvchange. The separate autoactivate phase also means that if lvmetad is disabled (either before or during the scan), the command can continue with the activation step by simply not using lvmetad and reverting to disk scanning to do the activation.
* toollib: add vg name list arg to process_each_vgDavid Teigland2016-05-2318-25/+37
|
* raid0: Add raid0 segment type.Alasdair G Kergon2016-05-2310-70/+168
| | | | | This remains experimental and quite restrictive so should only be used for testing at this stage. (E.g. lvreduce is not supported.)
* tools: improve error message about VG name and selectDavid Teigland2016-05-191-1/+1
|
* tests: test change of cache modeZdenek Kabelac2016-05-191-0/+71
|