summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* report: add ancestors_full and descendants_full reporting fieldsdev-prajnoha-full-ancestors-descendantsPeter Rajnoha2015-05-083-8/+83
| | | | | | In contrast to ancestors and descendants fields, the *_full counterparts also count with indirect origins in case thin snapshot LV was removed from the middle of the snapshot chain.
* thin: track removed and indirect origin for thin snapshotsPeter Rajnoha2015-05-081-2/+66
| | | | Wire it up.
* thin: add supporting infrastructure for tracking snapshot chain even if ↵Peter Rajnoha2015-05-088-1/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | there's a gap Thin snapshots can be chained. If we remove LVs in the middle of the chain, we would still like to know what was the original chain and hence we'd like to know from which thin LVs an LV descended. Normally we track only direct origin through seg->origin pointer (snapshot -> origin path) and through lv->segs_using_this_lv for the other way round (origin -> snapshots path). This patch add seg->indirect_origin and lv->indirect_segs_using_this_lv to track the dependency even if the chain is broken somewhere in the middle. Actual implementation of the removal and proper setting of the new fields and structures will be subject to subsequent patches - this patch adds only the infrastructure for making this extended dependency tracking possible. For example, let's consider this thin snapshot chain: LV1 -- LV2 -- LV3 -- LV4 After removing LV 2, we end up with: LV1 LV3 -- LV4 This patch adds support for recording the gap that resulted from removing the LV in thin snapshot chain (removed LVs are prefixed with '!' here): ____________ / \ LV1 !LV2 LV3 -- LV4 The !LV2 is the removed LV - recorded in lv->removed_ancestors list (LV3 holds this list in this situation). The LV3 also records LV1 as its indirect origin. After removing LV3, we end up with: _____________________ / \ LV1 !LV2 !LV3 LV4 In terms of the new fields/structures, we end up with: LV4->removed_ancestor_lv_names = [ "LV2", "LV3" ] first_seg(LV4)->origin = NULL first_seg(LV4)->indirect_origin = LV1 LV1->indirect_segs_using_this_lv = [ first_seg(LV4) ] ==== A little bit more complex example: LV1 -- LV2 -- LV3 -- LV4 \ --------------- LV5 -- LV6 Then after removing the LV2, we end up with: _____________________ /__________ \ // \ \ LV1 !LV2 LV3 -- LV4 \ \ LV5 -- LV6 Then after removing the LV5, we end up with: ____________________________ /__________ \ // \ \ LV1 !LV2 LV3 -- LV4 \ \ !LV5 LV6 LV3->removed_ancestor_lv_names = [ "LV2" ] first_seg(LV3)->origin = NULL first_seg(LV3)->indirect_origin = LV1 LV6->removed_ancestor_lv_names = [ "LV5" ] first_seg(LV6)->origin = NULL first_seg(LV6)->indirect_origin = LV1 LV1->indirect_segs_using_this_lv = [ first_seg(LV3), first_seg(LV6) ]
* refactor: rename _out_tags fn to _out_list and use it for string lists in ↵Peter Rajnoha2015-05-081-11/+12
| | | | general
* cleanup: remove unused tags.c filePeter Rajnoha2015-05-082-22/+0
|
* refactor: rename alloc_printed_tags fn to _alloc_printed_str_list and use it ↵Peter Rajnoha2015-05-083-44/+42
| | | | for string lists in general
* refactor: rename read_tags fn to _read_str_list and use it for string lists ↵Peter Rajnoha2015-05-083-25/+25
| | | | in general
* man: Fix recursive lvm-config man page.Alasdair G Kergon2015-05-072-1/+2
|
* Python: Improve lv property test coverageTony Asleson2015-05-061-3/+53
| | | | | | | | | | Improve the python unit test case to cover all of the properties of a LV and the properties of a LV segment. In addition we also add a 'tag' to the lv so that we can retrieve it using the 'lv_tags' property to ensure that this works as expected. Signed-off-by: Tony Asleson <tasleson@redhat.com>
* lvm2app: Correct missing string propertiesTony Asleson2015-05-061-1/+1
| | | | | | | | | | | | | | | Synopsis: STR_LIST needs to be treated as STR for properties. For any lvm property that was internally 'typed' as a string list we were failing to return a string in the property API. This was due to the fact that for the properties to work the value needs to either be evaulated as a string or a number. This change corrects the macro used to build the memory array of structures so that the string bitfield is set as needed to ensure that the value is a string. https://bugzilla.redhat.com/show_bug.cgi?id=1139920 Signed-off-by: Tony Asleson <tasleson@redhat.com>
* python: Check for NULL value before constructing string propertyTony Asleson2015-05-061-1/+5
| | | | | | | | | When retrieving a property value that is a string, if the character pointer in C was NULL, we would segfault. This change checks for non-null before creating a python string representation. In the case where the character pointer is NULL we will return a python 'None' for the value. Signed-off-by: Tony Asleson <tasleson@redhat.com>
* python: Build correct python value for numerical propertyTony Asleson2015-05-061-3/+8
| | | | | | | | | | | | | | | With the lvm2app C API adding the ability to determine when a property is signed we can then use this information to construct the correct representation of the number for python which will maintain value and sign. Previously, we only represented the numbers in python as positive integers. Python long type exceeds the range for unsigned and signed integers, we just need to use the appropriate parsing code to build correctly. Python part of the fix for: https://bugzilla.redhat.com/show_bug.cgi?id=838257 Signed-off-by: Tony Asleson <tasleson@redhat.com>
* lvm2app: Add signed numerical property valuesTony Asleson2015-05-067-8/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently lvm2app properties have the following structure: typedef struct lvm_property_value { uint32_t is_settable:1; uint32_t is_string:1; uint32_t is_integer:1; uint32_t is_valid:1; uint32_t padding:28; union { const char *string; uint64_t integer; } value; } lvm_property_value_t; which assumes that numerical values were in the range of 0 to 2**64-1. However, some of the properties were 'signed', like LV major/minor numbers and some reserved values for properties that represent percentages. Thus when the values were retrieved they were in two's complement notation. So for a -1 major number the API user would get a value of 18446744073709551615. The API user could cast the returned value to an int64_t to handle this, but that requires the API developer to look at the source code and determine when it should be done. This change modifies the return property structure to: typedef struct lvm_property_value { uint32_t is_settable:1; uint32_t is_string:1; uint32_t is_integer:1; uint32_t is_valid:1; uint32_t is_signed:1; uint32_t padding:27; union { const char *string; uint64_t integer; int64_t signed_integer; } value; } lvm_property_value_t; With this addition the API user can interrogate that the value is numerical, (is_integer = 1) and subsequently check if it's signed (is_signed = 1) too. If signed, then the API developer should use the union's signed_integer to avoid casting. This change maintains backwards compatibility as the structure size remains unchanged and integer value remains unchanged. Only the additional bit taken from the pad is utilized. Bugzilla reference: https://bugzilla.redhat.com/show_bug.cgi?id=838257 Signed-off-by: Tony Asleson <tasleson@redhat.com>
* tests: do not restart lvmetad when not necessaryOndrej Kozina2015-05-061-4/+1
| | | | overlooked pvmove-restart test during cleanup
* WHATS_NEW: update for recent changesOndrej Kozina2015-05-051-0/+2
| | | | | | commits: - bda26acf70e92232b1ed644dba6b44ecbff2a058 - 76a0dffe6f4869de9ca457119c9d7ced837d4e0b
* polldaemon: make wait_for_single_lv publicOndrej Kozina2015-05-052-3/+6
| | | | | referenced by new lvpoll command after lvmpolld gets merged.
* polldaemon: introduce _nanosleep functionOndrej Kozina2015-05-051-3/+18
| | | | | | | querying future lvmpolld with zero wait time is highly undesirable and can cause serious performance drop of the future daemon. The new wrapper function may avoid immediate return from syscal by introducing minimal wait time on demand.
* polldaemon: refactor polling interfacesOndrej Kozina2015-05-058-108/+291
| | | | | | | | | | | | | | | Routines responsible for polling of in-progress pvmove, snapshot merge or mirror conversion each used custom lookup functions to find vg and lv involved in polling. Especially pvmove used pvname to lookup pvmove in-progress. The future lvmpolld will poll each operation by vg/lv name (internally by lvid). Also there're plans to make pvmove able to move non-overlaping ranges of extents instead of single PVs as of now. This would also require to identify the opertion in different manner. The poll_operation_id structure together with daemon_parms structure they identify unambiguously the polling task.
* polldaemon: optimise out waiting after pollingOndrej Kozina2015-05-051-1/+1
| | | | | | | | | | Waiting even after _check_lv_status returned success and 'finished' flag was set to true doesn't make much sense. Note that while we skip the wait() we also skip the init_full_scan_done(0) inside the routine. This should have no impact as long as the code after _wait_for_single_lv doesn't presume anything about the state of the cache.
* polldaemon: get get_copy_vg ready for refactoringOndrej Kozina2015-05-055-9/+16
| | | | | with refactored code we take some VG locks as read-only. Make the poll_get_copy_vg ready for the change.
* lvconvert: code cleanup and preps for refactoringOndrej Kozina2015-05-051-7/+10
| | | | | | just a code cleanup and preparations for adding new code required for polldaemon refactoring. This commit should not have any functional impact.
* polldaemon: respect lv_attr parm in poll_get_copy_lvOndrej Kozina2015-05-041-2/+2
| | | | | | | | | as a part of bigger effort to unify polling intefaces poll_get_copy_lv should be able to look up LVs based on theirs lv->status field. Effective after pvmove starts using poll_get_copy_lv fn as well.
* polldaemon: move lvconvert_get_copy_lv codeOndrej Kozina2015-05-045-24/+23
| | | | | Moving lvconvert_get_copy_lv to polldaemon (poll_get_copy_lv). Clear move and rename.
* polldaemon: move lvconvert_get_copy_vg codeOndrej Kozina2015-05-045-23/+21
| | | | | Moving lvconvert_get_copy_vg to polldaemon (poll_get_copy_vg). Clear move and rename.
* tests: play better with mdadmZdenek Kabelac2015-05-042-1/+20
| | | | Manage mdadm devices on older distros is a challange.
* raid: reread status when 0 is reportedZdenek Kabelac2015-05-041-0/+14
| | | | | | | | | When kernel target reports sync status as 0% it might as well mean it's 100% in sync, just the target is in some race inconsistent state - so reread once again and take a more optimistic value ;) Patch tries to work around: https://bugzilla.redhat.com/show_bug.cgi?id=1210637
* tests: check for open_countZdenek Kabelac2015-05-041-5/+8
| | | | | Instead of checking /proc/mounts check for open_count of snap device. Parallel umount has race, so check for open_count.
* tests: drop extra scsi initZdenek Kabelac2015-05-041-9/+5
| | | | | Use first test also for checking the support is there - avoid one extra unnecessary scsi_debug reload.
* tests: check for clvmd process entryZdenek Kabelac2015-05-041-1/+1
| | | | | | Instead of checking just for pid file - rather check for process - since there could be slight race, the pid file is gone, but process still exists.
* tests: validate passed LVM_TEST_DEVDIRZdenek Kabelac2015-05-041-0/+1
| | | | Quit test early if passed LVM_TEST_DEVDIR dir does not exists.
* tests: wait for scsi device to appearZdenek Kabelac2015-05-041-5/+9
| | | | Continue with test as soon as device appear (avoid 2s delay)
* tests: dd needs to fail in this caseZdenek Kabelac2015-05-031-1/+1
|
* tests: more waits on restartZdenek Kabelac2015-05-031-15/+20
| | | | Check for socket presence (hardcoded for now)
* tests: use 800ms write delayZdenek Kabelac2015-05-031-6/+3
| | | | | | | Since this value magically worked for pvmove-abort* use it here as well. Also prepate_lvmetad has better kill&reload mechanism.
* tests: use odirectZdenek Kabelac2015-05-034-7/+6
| | | | | Fill snaphot with odirect so we know data hits disk before we test how full the snapshot is.
* lvm2app: call fin_locking in lvm_quitZdenek Kabelac2015-05-032-0/+2
| | | | | lvm_quit() function should also close locking. Fixes unclosed socket connecting clvmd.
* configure: detect /run dirZdenek Kabelac2015-05-033-13/+24
| | | | Access /run directly when system supports it.
* clvmd: missed newline in help textZdenek Kabelac2015-05-032-0/+2
| | | | Print \n after listing included lock managers.
* post-releaseAlasdair G Kergon2015-05-024-2/+8
|
* pre-releasev2_02_119Alasdair G Kergon2015-05-024-6/+15
|
* config: Remove newly-exposed default settings.Alasdair G Kergon2015-05-023-248/+199
| | | | | | | | Reinstate config settings matching the last release until every case where the generator produces different output has been reviewed and fresh decisions made about which defaults to expose as protection against changes in newer releases. We should be trying to reduce, not increase, this number.
* tests: more advance cleanup of running pvmoveZdenek Kabelac2015-05-011-4/+11
| | | | More take down more targets and use time-limited code.
* tests: configure use_lvmetad when neededZdenek Kabelac2015-05-012-3/+5
|
* man: expanded explanation of lvmetadDavid Teigland2015-05-011-10/+53
|
* man: expanded explanation of pvscanDavid Teigland2015-05-011-27/+119
| | | | Related to it's role with lvmetad and auto-activation.
* tests: free -h is quite new optionZdenek Kabelac2015-05-011-1/+1
| | | | Stay with -g and and ignore failure.
* tests: minor simplificationsZdenek Kabelac2015-05-015-20/+11
| | | | minor updates
* tests: disable usage of fuserZdenek Kabelac2015-05-011-4/+4
| | | | | Seems we captured problems with debug.log overwrite, so avoid quite expensive usage of fuser tool with each lvm command.
* tests: run api tests from startup dirZdenek Kabelac2015-05-011-2/+2
|
* tests: no lvmetad reload for debugless outputZdenek Kabelac2015-05-019-23/+26
| | | | | | | | | Introduce LVM_TEST_LVMETAD_DEBUG_OPTS to allow to override default debug opts for lvmetad. However could be still overloaded on command line: make check_lvmetad LVM_TEST_LVMETAD_DEBUG_OPTS="-l all"...