summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* lvmcache: change duplicate VG name warnings to verbosedev-dct-dupvgnamesEDavid Teigland2015-12-011-20/+33
| | | | | | | | | When two different VGs with the same name exist, they are both stored in lvmcache using the vginfo->next list. Previously, the code would print warnings (sometimes) when adding VGs to this list. Now the duplicate VG names are handled by higher level code, so this list no longer needs to print warnings about duplicate VG names being found.
* vg_read: look up vgid from nameDavid Teigland2015-12-013-1/+27
| | | | | | | | | | | | | | | | | | | | | | | | After recent changes to process_each, vg_read() is usually given both the vgname and vgid for the intended VG. However, in some cases vg_read() is given a vgid with no vgname, or is given a vgname with no vgid. When given a vgid with no vgname, vg_read() uses lvmcache to look up the vgname using the vgid. If the vgname is not found, vg_read() fails. When given a vgname with no vgid, vg_read() should also use lvmcache to look up the vgid using the vgname. If the vgid is not found, vg_read() fails. If the lvmcache lookup finds multiple vgids for the vgname, then the lookup fails, causing vg_read() to fail because the intended VG is uncertain. Usually, both vgname and vgid for the intended VG are passed to vg_read(), which means the lvmcache translations between vgname and vgid are not done.
* toollib: remove unused functionDavid Teigland2015-12-011-29/+0
|
* process_each: resolve duplicate VG namesDavid Teigland2015-12-011-0/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If two different VGs with the same name exist on the system, a command that just specifies that ambiguous name will fail with a new error: $ vgs -o name,uuid ... foo qyUS65-vn32-TuKs-a8yF-wfeQ-7DkF-Fds0uf foo vfhKCP-mpc7-KLLL-Uh08-4xPG-zLNR-4cnxJX $ lvs foo Multiple VGs found with the same name: foo Use the --select option with VG UUID (vg_uuid). $ vgremove foo Multiple VGs found with the same name: foo Use the --select option with VG UUID (vg_uuid). $ lvs -S vg_uuid=qyUS65-vn32-TuKs-a8yF-wfeQ-7DkF-Fds0uf lv1 foo ... This is implemented for process_each_vg/lv, and works with or without lvmetad. It does not work for commands that do not use process_each. This change includes one exception to the behavior shown above. If one of the VGs is foreign, and the other is not, then the command assumes that the intended VG is the local one and uses it.
* process_each: always use list of vgnames on systemDavid Teigland2015-12-011-50/+169
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes process_each_vg/lv always use the list of vgnames on the system. When specific VGs are named on the command line, the corresponding entries from vgnameids_on_system are moved to vgnameids_to_process. Previously, when specific VGs were named on the command line, the vgnameids_on_system list was not created, and vgnameids_to_process was created from the arg_vgnames list (which is only names, without vgids). Now, vgnameids_on_system is always created, and entries are moved from that list to vgnameids_to_process -- either some (when arg_vgnames specifies only some), or all (when the command is processing all VGs, or needs to look at all VGs for checking tags/selection). This change adds one new lvmetad lookup (vg_list) to a command that specifies VG names. It adds no new work for other commands, e.g. non-lvmetad commands, or commands that look at all VGs. When using lvmetad, 'lvs foo' previously sent one request to lvmetad: 'vg_lookup foo'. Now, 'lvs foo' sends two requests to lvmetad: 'vg_list' and 'vg_lookup foo <uuid>'. (The lookup can now always include the uuid in the request because the initial vg_list contains name/vgid pairs.)
* mirror: fix conditionZdenek Kabelac2015-12-011-1/+1
| | | | Recent patch tested wrong condition for error
* cleanup: use dm_get_status_mirrorZdenek Kabelac2015-12-015-280/+118
| | | | Use libdm function to parse mirror status report.
* lib: pass mem pool to check_transient_statusZdenek Kabelac2015-12-014-3/+5
| | | | | check_transient_status() may need to allocate some memory, so pass in already existing mem pool.
* tests: unit test for mirror statusZdenek Kabelac2015-12-014-2/+77
|
* libdm: introduce dm_get_status_mirrorZdenek Kabelac2015-12-014-15/+152
| | | | Add missing function to parse mirror status.
* lvconvert: Improve message for raid without -m.Alasdair G Kergon2015-11-302-2/+3
|
* lvmcache: new function to check if VG is foreignDavid Teigland2015-11-304-0/+44
| | | | | | | | When not using lvmetad, this uses the system_id field in the cached vginfo structs that are populated during a scan. When using lvmetad, this requests the VG from lvmetad, and checks the system_id field in the returned metadata.
* system_id: refactor check for allowed system_idDavid Teigland2015-11-302-17/+34
| | | | | Refactor the code that checks for an allowable system_id so that it can be used from other places.
* lvmcache: include system_id in vginfo cacheDavid Teigland2015-11-303-7/+37
| | | | | Save system_id just like creation_host and lock_type strings in vginfo cache.
* lvmetad: include both vgid and vgname in lookup requestDavid Teigland2015-11-301-7/+18
| | | | | | When the command already knows both the vgid and vgname, it should send both to lvmetad for a more exact request, and it can save lvmetad the work of a name lookup.
* post-releaseAlasdair G Kergon2015-11-284-2/+8
|
* pre-releasev2_02_136Alasdair G Kergon2015-11-284-4/+4
|
* tests: make unit testing usable againZdenek Kabelac2015-11-278-47/+116
| | | | | | Make unit tests usable/compilable with newer header files. Add 'initial' dmlist_t for list tests. More will come...
* cleanup: clean gcc shadow declaration of version warningZdenek Kabelac2015-11-261-6/+6
|
* debug: show LV name where dlid creation failedZdenek Kabelac2015-11-261-1/+7
|
* cleanup: using display_lvnameZdenek Kabelac2015-11-262-106/+127
| | | | | Use for showing vgname/lvname in messages. No functional change.
* cleanup: remove unused codeZdenek Kabelac2015-11-262-218/+7
| | | | | | | | | | Remove long outstand unused code lines, which were already been obsoleted by other code. Statuses and snapshot tree creation is already handled differently. Also drop some 'extra' log_error() and use only stack; since error has already been reported.
* cleanup: avoid allocation for vg_nameZdenek Kabelac2015-11-261-4/+2
| | | | | | | | | | Since we do not use dev_manager in a way we would have destroyed VG content while in-use - we could safely keep just pointer. So dropping strdup. Also it seems we actually no longer use vg_name for anything so it may possibly go away completely unless it would be useful for debugging...
* libdm: const raid params and error for unsupported typeZdenek Kabelac2015-11-263-4/+7
| | | | | Accept const struct with raid params (No API change). Also add extra error message when raid type is unsupported.
* lvmconfig: add --sinceversion for --type newPeter Rajnoha2015-11-257-19/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Just for convenience to display all new configuration settings introduced since given version (before, there was only --atversion to display settings introduced in concrete version). For example: $ lvmconfig --type new --sinceversion 2.2.120 allocation { # cache_mode="writethrough" # cache_settings { # } } global { use_lvmlockd=0 # lvmlockd_lock_retries=3 # sanlock_lv_extend=256 use_lvmpolld=1 } activation { } # report { # compact_output_cols="" # time_format="%Y-%m-%d %T %z" # } local { # host_id=0 }
* cleanup: rename lv_ondisk to lv_committedZdenek Kabelac2015-11-254-17/+19
| | | | Patch has no functional change.
* cleanup: change ondisk committedZdenek Kabelac2015-11-252-44/+44
| | | | Patch has no functional change.
* cleanup: rename vg_ondisk to vg_committedZdenek Kabelac2015-11-253-14/+14
| | | | | | | | | Unifying terminology. Since all the metadata in-use are ALWAYS on disk - switch to terminology committed and precommitted. Patch has no functional change inside.
* thin: fix previous update of partial tree buildingZdenek Kabelac2015-11-241-1/+2
| | | | | | | We do want to preserve 'active' thin-pool, so add this 'fake' layer only when activating. TODO: think how to use thin-pool without fake LV layer.
* tests: improve teardownZdenek Kabelac2015-11-241-1/+5
| | | | Do not try to execute vgremove, when test has left suspended devices.
* tests: data correctness after thin-pool resizeZdenek Kabelac2015-11-241-0/+84
|
* cleanup: use display_lvnameZdenek Kabelac2015-11-231-27/+28
| | | | | Switch debug msg to use display_lvname. Link to VG early, so we have access to VG from LV.
* thin: skip detach preload from poolsZdenek Kabelac2015-11-231-0/+3
| | | | | | | | | lv preload for detached LVs started to be used also for various other types which just happens to pass through weak if() condition. TODO: find here better solution to rather explicitly check for types we really need to preload.
* cleanup: move towards using direct LV pointersZdenek Kabelac2015-11-233-30/+30
| | | | | | | | | | | | We do not won't to 'expose' internals of VG struct. ATM we use lists to keep all LVs - we may want to switch to better struct for quicker 'search'. Since we do not need 'lists' but always actual LV, switch find_lv_in_vg_by_lvid() to return LV, and replaces some use case of find_lv_in_vg() with 'better' working find_lv() which already returns LV.
* thin: work with active thin-poolZdenek Kabelac2015-11-232-1/+2
| | | | | | When 'lvextend -L+XX vg/thinpool' do not leave inactive table loaded for 'wrapping' LV on top of resized thin-pool (ATM we use linear LV for this with same size as thin-pool).
* memlock: add more libs on ignore listZdenek Kabelac2015-11-232-0/+9
| | | | | | Udev recently start to 'link-in' major amount of useless libs. (Seem to be faulty 'systemd' link-in all issue) Anyway - avoid locking those libs in RAM.
* libdm: enhance thin-pool preloadZdenek Kabelac2015-11-232-0/+18
| | | | | | | | When preloading thin-pool device node for already existing/running thin-pool do not resume such thin-pool. This allows to properly schedule commit point for metadata, when thin-pool data or metadata volume is resized.
* libdm: drop extra space from cache target lineZdenek Kabelac2015-11-232-1/+2
| | | | | | Extra space between 'cache' target and metadata device caused string comparation being not equal and thus always causing table reload even when uneeded.
* man lvmcache: include chunk sizeDavid Teigland2015-11-231-0/+29
|
* post-releaseAlasdair G Kergon2015-11-234-2/+8
|
* pre-releasev2_02_135Alasdair G Kergon2015-11-235-7/+11
|
* tests: more cache conversion checksZdenek Kabelac2015-11-192-1/+35
|
* cache: lvconvert repairs only thin poolsZdenek Kabelac2015-11-192-4/+10
| | | | | | | | | | Avoid internal error message where thin pool repair code tries to fix cache pool - was catched later in code stack, so rather catch this early and make the repair function exlusive to thin pools. So far we have no code for repairing cache pools (other then the automatic during activation/deactivation).
* cache: enable raid conversion for _cdata and _cmetaZdenek Kabelac2015-11-192-0/+3
| | | | | Since thin-pool supports convertion of data and metadata LV, enable the same for cache data and metadata LV.
* tests: stacktrace on skip if message is emptyMarian Csontos2015-11-191-2/+13
|
* tests: add missing --skip option and S env.variableMarian Csontos2015-11-191-8/+32
|
* cleanup: cast resulting value explicitelyZdenek Kabelac2015-11-191-1/+1
|
* cleanup: add stack tracesZdenek Kabelac2015-11-181-2/+2
|
* cleanup: use display_lvname in pmspareZdenek Kabelac2015-11-181-6/+6
| | | | | | Just switch to use display_lvname(). Also squeeze possibly failing strncpy into INTERNAL_ERROR as lvname always should fit.
* libdm: report: consolidate use of string list selection structuresPeter Rajnoha2015-11-182-16/+19
|