summaryrefslogtreecommitdiffstats
path: root/tools/vgmerge.c
Commit message (Collapse)AuthorAgeFilesLines
* Backtrace for failing drop_cached_metadataZdenek Kabelac2012-03-011-1/+2
|
* Replace free_vg with release_vgZdenek Kabelac2011-08-101-6/+6
| | | | | | | | Move the free_vg() to vg.c and replace free_vg with release_vg and make the _free_vg internal. Patch is needed for sharing VG in vginfo cache so the release_vg function name is a better fit here.
* Fix free_vg orderZdenek Kabelac2011-03-301-7/+7
| | | | | | | | | | | | | | As now the FID management is more complex, the code inside free_vg needs to access some parts of memory pools which were not needed before. For this - makes the order of unlock_and_free_vg() unconditional. Keek using unlock_and_free_vg() API function. For properly working VG locking mechanism only the alphabeting locking orderer needs to be preserved. TODO: there could be few more code parts simplified when we 'officially' support of referencies between different memory pools.
* Const fixingZdenek Kabelac2011-02-181-1/+1
| | | | | | | | | | | | | | | | Fixing some const warnings - with API change in: int vg_extend(struct volume_group *vg, int pv_count, const char *const *pv_names, Change is needed - as lvm2api expects const behaviour here. So vg_extend() is doing local strdup for unescaping. skip_dev_dir return const char* from const char* vg_name. Rest of the patch is cleanup of related warnings. Also using dm_report_filed_string() API change to simplify casting in _string_disp and _lvname_disp.
* Add further consistency checking to vg_validate, ensuring that all segmentPetr Rockai2010-12-141-0/+4
| | | | areas point to LVs or PVs that are listed in the respective VG.
* Rename vg_release to free_vg.Alasdair Kergon2010-12-081-7/+7
|
* Use __attribute__ consistently throughout.Alasdair Kergon2010-07-091-1/+1
|
* Update _vgmerge_single() to move fid->metadata_areas_ignored.Dave Wysochanski2010-06-281-0/+6
| | | | | | | | | | | | | When vgmerge is called we move the mdas from the source to the destination. With metadata balancing we now have another mda list, fid->metadata_areas_ignored, so move the mdas on this list as well. This patch should not matter as the code is written today. However we include it for completeness in the case that _vgmerge_single() is refactored and/or moved into a library function. Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
* Rename fid->metadata_areas to fid->metadata_areas_in_use.Dave Wysochanski2010-06-281-3/+3
| | | | | Rename the metadata_areas list to an 'in_use' list to prepare for future 'ignored' list.
* Call add_pvl_to_vgs() and del_pvl_from_vgs() from more places.Dave Wysochanski2010-04-131-9/+5
| | | | | | | Now that we have library functions to add/delete a pv from the vg->pvs list, call them from everywhere. Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
* Add lots of missing stack debug messages to tools.Alasdair Kergon2009-09-141-2/+8
| | | | | Make readonly locking available as locking type 4. Fix readonly locking to permit writeable global locks (for vgscan). (2.02.49)
* Change vgmerge behavior to open/lock first vg based on alphabetical ordering.Dave Wysochanski2009-09-021-7/+21
| | | | | | | This enforces our alphabetical lock ordering rules for vgmerge. Author: Dave Wysochanski <dwysocha@redhat.com>
* Refactor vgmerge - combine _vgmerge_to and _vgmerge_from into _vgmerge_vg_read.Dave Wysochanski2009-09-021-24/+10
| | | | | | | These functions are identical so should be no functional change. Author: Dave Wysochanski <dwysocha@redhat.com>
* Refactor vgmerge - create _vgmerge_from and _vgmerge_to.Dave Wysochanski2009-09-021-9/+31
| | | | | | | | | | These functions are really identical but for clarity I made them separate functions in this patch. Should be no functional change. Author: Dave Wysochanski <dwysocha@redhat.com>
* Refactor vgmerge - introduce lock_vg_from_first flag.Dave Wysochanski2009-09-021-2/+8
| | | | | | | Should be no functional change. Author: Dave Wysochanski <dwysocha@redhat.com>
* Remove unneeded LOCK_NONBLOCKING from vg_read() API.Dave Wysochanski2009-07-081-2/+1
| | | | | | | | | | | | | | | | | | | | | | | Remove unneeded LOCK_NONBLOCKING from vg_read() API and tools that use it. We no longer need this flag anywhere since we now automatically set LCK_NONBLOCK inside lock_vol() if vgs_locked(). For further details, see: commit d52b3fd3fe2006e2d13e42f8518b6512bff03710 Author: Dave Wysochanski <dwysocha@redhat.com> Date: Wed May 13 13:02:52 2009 +0000 Remove NON_BLOCKING lock flag from tools and set a policy to auto-set. As a simplification to the tools and further liblvm, this patch pushes the setting of NON_BLOCKING lock flag inside the lock_vol() call. The policy we set is if any existing VGs are currently locked, we set the NON_BLOCKING flag. At some point it may make sense to add this flag back if we get an RFE from a liblvm user, but for now let's keep it as simple as possible. Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
* Fix vg_read() error paths to properly release upon vg_read_error().Dave Wysochanski2009-07-071-2/+5
| | | | | | | | | | | | | | | | | | | | | | | Fix vg_read() error paths to properly release upon vg_read_error(). Note that in the iterator paths (process_each_*()), we release inside the iterator so no individual cleanup is needed. However there are a number of other places we missed the cleanup. Proper cleanup when vg_read_error() is true should be calling vg_release(vg), since there should be no locks held if we get an error (except in certain special cases, which IMO we should work to remove from the code). Unfortunately the testsuite is unable to detect these types of memory leaks. Most of them can be easily seen if you try an operation (e.g. lvcreate) with a volume group that does not exist. Error message looks like this: Volume group "vg2" not found You have a memory leak (not released memory pool): [0x1975eb8] You have a memory leak (not released memory pool): [0x1975eb8] Author: Dave Wysochanski <dwysocha@redhat.com>
* Convert the straight instances of vg_lock_and_read to new vg_read(_for_update).Dave Wysochanski2009-07-011-7/+5
| | | | | | | Sun May 3 11:40:51 CEST 2009 Petr Rockai <me@mornfall.net> * Convert the straight instances of vg_lock_and_read to new vg_read(_for_update). Rebased 6/26/09 by Dave W.
* revert last patch - let's do a release firstAlasdair Kergon2009-06-261-6/+8
|
* Convert the straight instances of vg_lock_and_read to new vg_read(_for_update).Dave Wysochanski2009-06-261-8/+6
| | | | | | | | | Sun May 3 11:40:51 CEST 2009 Petr Rockai <me@mornfall.net> * Convert the straight instances of vg_lock_and_read to new vg_read(_for_update). Author: Petr Rockai <prockai@redhat.com> Committer: Dave Wysochanski <dwysocha@redhat.com>
* Pre-release cleanups.Alasdair Kergon2009-05-211-3/+3
|
* Remove vg->lv_count and use counter function.Milan Broz2009-05-131-1/+0
| | | | | | | This should not cause problems but simplifies code a lot. (the volumes_count is merged and renamed with lvs_visible function by following patch.)
* Remove NON_BLOCKING lock flag from tools and set a policy to auto-set.Dave Wysochanski2009-05-131-2/+2
| | | | | | | | | As a simplification to the tools and further liblvm, this patch pushes the setting of NON_BLOCKING lock flag inside the lock_vol() call. The policy we set is if any existing VGs are currently locked, we set the NON_BLOCKING flag. Should be no functional change.
* Remove snapshot_count from VG and use function instead.Milan Broz2009-05-121-2/+0
|
* Properly release VG memory pool in all CLI tools.Milan Broz2009-04-101-11/+7
|
* Right, a simple build (without options) is working again.Alasdair Kergon2008-11-031-12/+12
|
* Drop cached metadata for disappearing VG in vgmerge.Alasdair Kergon2008-06-061-0/+2
|
* Fix internal snapshot_count when vgmerge with snapshots in source VG.Dave Wysochanski2008-04-231-0/+1
|
* make list_move consistent with other list fnsAlasdair Kergon2008-04-101-3/+3
|
* Use list_move() in applicable places.Dave Wysochanski2008-03-261-6/+3
|
* Some whitespace tidy-ups.Alasdair Kergon2008-01-301-5/+5
|
* Use stack return macros throughout.Alasdair Kergon2008-01-301-11/+8
|
* Create vgs_are_compatible() fn to check whether vgs are compatible for merging.Dave Wysochanski2008-01-161-67/+2
| | | | | | | | | | | | | | | Add new vgmerge and vgsplit tests to check rejection of incompatible vgs. Cleanup comments. Bugzilla: bz251992 --- lib/metadata/metadata-exported.h | 3 + lib/metadata/metadata.c | 89 +++++++++++++++++++++++++++++++++- test/t-vgmerge-usage.sh | 101 +++++++++++++++++++++++++++++++++++++++ test/t-vgsplit-operation.sh | 20 +++++++ tools/vgmerge.c | 69 -------------------------- tools/vgsplit.c | 5 - 6 files changed, 215 insertions(+), 72 deletions(-)
* Convert some vg_reads into vg_lock_and_readsAlasdair Kergon2007-11-151-2/+2
|
* Add pv_dev_name() to access PV device name.Dave Wysochanski2007-10-121-2/+2
| | | | Patch by Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
* Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1.Alasdair Kergon2007-08-201-3/+3
|
* Add CORRECT_INCONSISTENT and FAIL_INCONSISTENT flags to vg_lock_and_readDave Wysochanski2007-07-231-2/+4
|
* Add vg_lock_and_read() external library function.Dave Wysochanski2007-07-231-27/+6
|
* Add vg_check_status to consolidate vg status flags checks and error messages.Dave Wysochanski2007-06-061-29/+2
|
* Support the /dev/mapper prefix on most command lines.Alasdair Kergon2007-03-091-2/+2
|
* Adjust some alignments for ia64 and sparc.Alasdair Kergon2006-11-301-1/+1
| | | | (Some of the changes are probably unnecessary.)
* When using local file locking, skip clustered VGs.Alasdair Kergon2006-09-021-0/+13
| | | | Add fallback_to_clustered_locking and fallback_to_local_locking parameters.
* Add skip_dev_dir() to process command line VGs.Alasdair Kergon2006-08-251-3/+5
|
* Add mirror_library description to example.conf.Alasdair Kergon2006-05-111-2/+2
| | | | More compile-time cleanup.
* Fix vgexport/vgimport to set/reset PV exported flag so pv_attr is correct.Alasdair Kergon2006-04-121-2/+2
| | | | Add vgid to struct physical_volume and pass with vg_name to some functions.
* Use dm_is_dm_major instead of local copy.Alasdair Kergon2005-10-251-0/+20
| | | | Allow mapped devices to be used as PVs safely.
* Use hash, bitset, malloc, pool from libdevmapper.Alasdair Kergon2005-10-161-1/+1
|
* Fix vgmerge to handle duplicate LVIDs.Alasdair Kergon2005-05-191-0/+27
|
* Update copyright notices.Alasdair Kergon2004-03-301-13/+8
|
* Default to unlimited number of LVs/PVs in lvm2 format.Alasdair Kergon2003-11-061-2/+4
|