summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* toollib: avoid repeated lvmetad vg_lookupdev-dct-lvmcache2David Teigland2015-05-077-75/+162
| | | | | | | | | | | | | In process_each_{vg,lv,pv} when no vgname args are given, the first step is to get a list of all vgid/vgname on the system. This is exactly what lvmetad returns from a vg_list request. The current code is doing a vg_lookup on each VG after the vg_list and populating lvmcache with the info for each VG. These preliminary vg_lookup's are unnecessary, because they will be done again when the processing functions call vg_read. This patch eliminates the initial round of vg_lookup's, which can roughly cut in half the number of lvmetad requests and save a lot of extra work.
* lvmcache: choose preferred device onceDavid Teigland2015-05-073-11/+53
| | | | | | Once the preferred duplicate devices have been set in lvmcache, don't attempt to pick preferred duplicates again.
* lvmcache: update lvmcache with alternate deviceDavid Teigland2015-05-071-13/+19
| | | | | | When there are duplicate PVs, and one device replaces another in lvmcache, use label_read to update lvmcache for the new device.
* 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"...
* tests: lower version of dm-delayZdenek Kabelac2015-05-011-1/+4
| | | | | | Let's see what will break with lower version 1.1. Also avoid repeated check of target version.
* tests: rename kill_tagged_processesZdenek Kabelac2015-05-017-12/+31
| | | | | | | Better name for aux function. First use normal -TERM, and only after a while use -KILL (leaving some time to correctly finish) Print INFO about killed processes.
* tests: move conf preparingZdenek Kabelac2015-05-012-2/+1
| | | | | If the test in the middle is restarting lvmetad avoid conf regenerating.
* tests: hide error messageZdenek Kabelac2015-05-011-1/+1
| | | | Hide error about missing declare -A support.
* tests: wait between remountZdenek Kabelac2015-05-011-0/+2
| | | | Let's see if this help with some races...