summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* tests: add lv-ancestry.sh testdev-prajnoha-track-removed-lvsPeter Rajnoha2016-03-031-0/+226
|
* tests: add "get lvh_field" for "lvs -H"Peter Rajnoha2016-03-032-0/+11
|
* lvmdump: also list historical LVs in lvmdumpPeter Rajnoha2016-03-031-1/+1
|
* metadata: automatically remove invalid (dangling) historical LVsPeter Rajnoha2016-03-032-1/+48
| | | | | | Historical LV is valid as long as there is at least one live LV among its ancestors. If we find any invalid (dangling) historical LVs, remove them automatically.
* metadata: also validate historical LVs in VG in vg_validate and ↵Peter Rajnoha2016-03-032-0/+108
| | | | check_lv_segments
* metadata: also look at historical LVs when checking LV name availabilityPeter Rajnoha2016-03-037-23/+67
| | | | | Live LVs and historical LVs are in one namespace and the name needs to be unique in whole VG.
* conf: regenerate example.conf.inPeter Rajnoha2016-03-031-0/+16
|
* conf: add metadata/lvs_history_timeout configuration settingPeter Rajnoha2016-03-033-1/+8
|
* metadata: add vg_strip_outdated_historical_lvs fn and call it during VG readPeter Rajnoha2016-03-032-1/+40
| | | | | | | The vg_strip_outdated_historical_lvs iterates over the list of historical LVs we have and it shoots down the ones which are outdated. Configuration hook to set the timeout will be in subsequent patch.
* commands: lvremove: also process historical LVsPeter Rajnoha2016-03-033-7/+16
|
* metadata: add historical_glv_removePeter Rajnoha2016-03-036-5/+82
|
* conf: add metadata/record_lvs_history configuration settingPeter Rajnoha2016-03-033-2/+10
| | | | | | | | | The metadata/record_lvs_history is global switch which enables or disables recording historical LVs in metadata. If both metadata/record_lvs_history=1 lvm.conf option and --nohistory command switch is used at the same time, the --nohistory prevails.
* commands: lvremove: recognize --nohistory optionPeter Rajnoha2016-03-031-1/+2
|
* metadata: honour 'nohistory' switch when removing thin LVsPeter Rajnoha2016-03-031-4/+11
| | | | | When --nohistory switch is used with lvremove, the LV that is removed is not recorded in metadata as 'historical LV'.
* cmd: add 'nohistory' option and wire it up in cmd_contextPeter Rajnoha2016-03-033-0/+4
| | | | | The --nohistory switch will cause historical LVs to not be recorded in metadata on demand.
* report: add new 'none' lv_layout and 'history' lv_role and mark historical ↵Peter Rajnoha2016-03-031-0/+10
| | | | | | | | | | | | | LVs that way Report proper values for historical LVs in lv_layout and lv_role fields. Any historical LV doesn't have any layout anymore and the role is "history". For example: $ lvs -H -o name,lv_attr,lv_layout,lv_role vg/-lvol1 LV Attr Layout Role -lvol1 ----h----- none public,history
* report: add full_descendants field to display descendants with historyPeter Rajnoha2016-03-033-16/+89
| | | | Same as lv_full_ancestors, but the other way round in the ancestry chain.
* report: add full_ancestors field to display ancestors with historyPeter Rajnoha2016-03-033-14/+76
| | | | | | The lv_full_ancestors reporting field is just like the existing lv_ancestors field but it also takes into account any history and indirect relations recorded.
* report: report historical LV names with '-' prefixPeter Rajnoha2016-03-031-7/+16
| | | | | | | All names for historical LVs are prefixed with '-' character to make clear difference between live and historical LVs. The '-' can't be set by users for live LV names during lvcreate hence we never get into a conflict with the names that user defines for live LVs.
* report: display (h)istorical state in lv_attr fieldPeter Rajnoha2016-03-031-2/+5
| | | | | The 'historical' state is displayed as 5th bit ("state") in the lv_attr field and denoted by new 'h' character.
* report: add lv_historical field to identify historical LVsPeter Rajnoha2016-03-033-0/+11
| | | | | | The lv_historical reporting field is a simple binary field that reports whether an LV is historical one ("historical" value or value of "1" displayed) or not (blank string "" or value of "0" displayed).
* commands: lvs: recognize -H|--history switchPeter Rajnoha2016-03-031-5/+7
| | | | | When lvs command is used together with the -H|--history switch, all historical LVs are reported as well.
* report: display lv_name,lv_uuid,vg_name,lv_time and new lv_time_removed for ↵Peter Rajnoha2016-03-037-10/+72
| | | | historical LVs
* toollib: honour '-H|--history' switch while executing process_each_lv_in_vgPeter Rajnoha2016-03-031-0/+85
| | | | | | | | | | | | | | | | When processing LVs in a VG and when the -H|--history switch is used, make process_each_lv_in_vg to iterate over historical volumes too. For each historical LV, we use dummy struct logical_volume instance with the "this_glv" reference set to a wrapper over proper struct historical_logical_volume representation. This makes it possible to process historical LVs just like normal live LVs (though a dummy one without any segments and all the other fields zeroed and blank) and it also allows for using all historical LV related information via lv->this_glv->historical reference. One can use a simple call to lv_is_historical to make a difference between live and historical LV in all the code that is called by process_each_* fns.
* cmd: add '-H|--history' switch and wire it up in cmd_context and ↵Peter Rajnoha2016-03-036-0/+10
| | | | | | | | | | | | | | processing_handle This patch adds "include_historical_lvs" field to struct cmd_context to make it possible for the command to switch between original funcionality where no historical LVs are processed and functionality where historical LVs are taken into account (and reported or processed further). The switch between these modes is done using the '-H|--history' switch on command line. The include_historical_lvs state is then passed to process_each_* fns using the "include_historical_lvs" field within struct processing_handle.
* metadata: add lv_is_historical fn to test if the LV is historical onePeter Rajnoha2016-03-033-0/+10
|
* metadata: format_text: interconnect historical LVs among each other and also ↵Peter Rajnoha2016-03-031-0/+119
| | | | | | | with live LVs Interconnect historical LVs in an ancestry chain and also connect the first/last one with its live ancestor/descendant if it exists.
* metadata: add support for interconnection of thin pool LV segment with ↵Peter Rajnoha2016-03-036-7/+25
| | | | | | | | indirect origin Add support for making an interconnection between thin LV segment and its indirect origin (which may be historical or live LV) - add a new "indirect_origin" argument to attach_pool_lv function.
* metadata: add find_historical_glv fnPeter Rajnoha2016-03-032-0/+31
| | | | | | The find_historical_glv is helper function that looks up historical LV in struct volume_group's historical_lvs list and returns it if found.
* metadata: format_text: import historical LVsPeter Rajnoha2016-03-031-0/+78
| | | | | Import historical LV list from metadata and add it to struct volume_group's historical_lvs list.
* metadata: format_text: reuse _print_timestamp fnPeter Rajnoha2016-03-031-11/+3
|
* metadata: format_text: also export historical LVsPeter Rajnoha2016-03-033-0/+147
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also export historical LVs when exporting LVM2 metadata. This is list of all historical LVs listed in "historical_logical_volumes" metadata section with all the properties exported for each historical LV. For example, we have this thin snapshot sequence: lvol1 --> lvol2 --> lvol3 \ --> lvol4 We end up with these metadata: logical_volume { ... (lvol1, lvol3 and lvol4 listed here as usual - no change here) ... } historical_logical_volumes { lvol2 { id = "S0Dw1U-v5sF-LwAb-W9SI-pNOF-Madd-5dxSv5" creation_time = 1456919613 # 2016-03-02 12:53:33 +0100 removal_time = 1456919620 # 2016-03-02 12:53:40 +0100 indirect_origin = "lvol1" indirect_descendants = ["lvol3", "lvol4"] } } By removing lvol1 further, we end up with: historical_logical_volumes { lvol2 { id = "S0Dw1U-v5sF-LwAb-W9SI-pNOF-Madd-5dxSv5" creation_time = 1456919613 # 2016-03-02 12:53:33 +0100 removal_time = 1456919620 # 2016-03-02 12:53:40 +0100 indirect_origin = "-lvol1" indirect_descendants = ["lvol3", "lvol4"] } lvol1 { id = "me0mes-aYnK-nRfT-vNlV-UiR1-GP7r-ojbROr" creation_time = 1456919608 # 2016-03-02 12:53:28 +0100 removal_time = 1456919767 # 2016-03-02 12:56:07 +0100 } }
* metadata: create historical LVs when LVs are removed and interconnect with ↵Peter Rajnoha2016-03-032-0/+143
| | | | | | | | | | | | | | live LVs When an LV is being removed, we create an instance of "struct historical_logical_volume" wrapped up in "struct generic_logical_volume". All instances of "struct historical_logical_volume" are then recorded in "historical_lvs" list which is part of "struct volume_group". The "historical LV" is then interconnected with "live LVs" to connect a history chain for the live LV.
* metadata: add add_glv_to_indirect_glvs and remove_glv_from_indirect_glvsPeter Rajnoha2016-03-032-0/+64
| | | | | | | | | | The add_glv_to_indirect_glvs is a helper function that registers a volume represented by struct generic_logical_volume instance ("glv") as an indirect user of another volume ("origin_glv") and vice versa - it also registers the other volume ("origin_glv") as indirect_origin of user volume ("glv"). The remove_glv_from_indirect_glvs does the opposite.
* metadata: add get_or_create_glv and get_or_create_glvlPeter Rajnoha2016-03-032-0/+39
| | | | | | | | | The get_or_create_glv is helper function that retrieves any existing generic_logical_volume wrapper for the LV. If the wrapper does not exist yet, it's created. The get_org_create_glvl is the same as get_or_create_glv but it creates the glv_list wrapper in addition so it can be added to a list.
* metadata: add infrastructure to track LV historyPeter Rajnoha2016-03-037-0/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add new structures and new fields in existing structures to support tracking history of LVs (the LVs which don't exist - the have been removed already): - new "struct historical_logical_volume" This structure keeps information specific to historical LVs (historical LV is very reduced form of struct logical_volume + it contains a few specific fields to track historical LV properties like removal time and connections among other LVs). - new "struct generic_logical_volume" Wrapper for "struct historical_logical_volume" and "struct logical_volume" to make it possible to handle volumes in uniform way, no matter if it's live or historical one. - new "struct glv_list" Wrapper for "struct generic_logical_volume" so it can be added to a list. - new "indirect_glvs" field in "struct logical_volume" List that stores references to all indirect users of this LV - this interconnects live LV with historical descendant LVs or even live descendant LVs. - new "indirect_origin" field in "struct lv_segment" Reference to indirect origin of this segment - this interconnects live LV (segment) with historical ancestor. - new "this_glv" field in "struct logical_volume" This references an existing generic_logical_volume wrapper for this LV, if used. It can be NULL if not needed - which means we're not handling historical LVs at all. - new "historical_lvs" field in "struct volume group List of all historical LVs read from VG metadata.
* tests: drop check for md5sumZdenek Kabelac2016-03-031-2/+0
|
* tests: check kernel_cache_ funcsZdenek Kabelac2016-03-031-22/+30
|
* cleanup: use lv_is_partialZdenek Kabelac2016-03-0310-28/+29
| | | | Check for PARTIAL_LV flag in standard way.
* cleanup: use _field_stringZdenek Kabelac2016-03-031-31/+30
| | | | | Make at least some 'advantage' in use local func and do dereference internally from char pointer and use short list of params.
* man: minor updatesZdenek Kabelac2016-03-033-5/+6
| | | | Minor fixes in few pages.
* man: lvconvert updatesZdenek Kabelac2016-03-032-244/+369
| | | | | Improving style (following lvcreate way). Sorting options alphabetically.
* cache: add kernel_cache_policy optionZdenek Kabelac2016-03-034-0/+18
| | | | | | | Pair kernel_cache_settings with kernel_cache_policy. There is very small chance in error case that the value in table might be differnet from the value stored in metadata so make it 'checkable'.
* WHATS_NEW: [unknown] replaces 'unknown device'David Teigland2016-03-011-0/+1
|
* pvs: replace 'unknown device' with [unknown]David Teigland2016-03-016-1/+23
| | | | A config setting can restore the old string.
* cleanup: missplaced .Zdenek Kabelac2016-03-011-2/+3
| | | | | Remove misplaced '.' after '?' Drop extra 'stack;' after log_debug().
* makefile: handle dm-version-expectedZdenek Kabelac2016-03-011-2/+5
|
* man: fix mising bracesZdenek Kabelac2016-03-012-19/+24
| | | | | | | Fixing some reported issued found by: http://catb.org/~esr/doclifter/bugs.html Reported-by: Eric S. Raymond <esr at thyrsus.com>
* cleanup: indent and dotsZdenek Kabelac2016-03-011-56/+51
|
* coverity: eliminate DEADCODEZdenek Kabelac2016-03-011-4/+2
| | | | | Coverity notice this cannot be NULL: cur = &dms->regions[*cur_r] so avoid NULL checking and simplify form.