summaryrefslogtreecommitdiffstats
path: root/tools/vgconvert.c
Commit message (Collapse)AuthorAgeFilesLines
* Using enum types for enumsZdenek Kabelac2012-02-281-1/+1
| | | | alloc_policy_t, dm_string_mangling_t, percent_range_t, sign_t
* Add free_orphan_vgZdenek Kabelac2012-02-131-4/+0
| | | | | | | Move commod code to destroy orphan VG into free_orphan_vg() function. Use orphan vgmem for creation of PV lists. Remove some free_pv_fid() calls (FIXME: check all of them) FIXME: Check whether we could merge release_vg back again for all VGs.
* Add new free_pv_fid fn and use it throughout to free all attached fids.Peter Rajnoha2011-03-111-0/+3
| | | | | | | | Since format instances will use own memory pool, it's necessary to properly deallocate it. For now, only fid is deallocated. The PV structure itself still uses cmd mempool mostly, but anytime we'd like to add a mempool in the struct physical_volume, we can just rename this fn to free_pv and add the code (like we have free_vg fn for VGs).
* Allow non-orphan PVs with two metadata areas to be resized.Peter Rajnoha2011-02-281-1/+1
| | | | | | | | | We allow writing non-orphan PVs only for resize now. The "orphan PV" assert in pv_write fn uses the "allow_non_orphan" parameter to control this assert. However, we should find a more elaborate solution so we can remove this restriction altogether (pv_write together with vg_write is not atomic, we need to find a safe mechanism so there's an easy revert possible in case of an error).
* Revert the patch for vgconvert to work with recent changes in metadata area ↵Peter Rajnoha2011-02-251-20/+67
| | | | | | handling. This should work now with the help of the patch from previous commit.
* Fix vgconvert code to work with changes in metadata area handling and changesPeter Rajnoha2011-02-211-70/+20
| | | | in format_instance. Add new 'vg_convert' function.
* Change pv_write code to work with the changes in metadata handling interfacePeter Rajnoha2011-02-211-3/+1
| | | | and changes in format_instance.
* Change the code throughout to use new pv_initialise and modified pv_setup fn.Peter Rajnoha2011-02-211-2/+4
| | | | | Change pv_create code to work with these changes together with using new pv_add_metadata_area fn to add metadata areas for a PV being created.
* Fix gcc warnings for unused variablesZdenek Kabelac2011-02-181-3/+2
| | | | Put dead assigment code into comment.
* Allow internal suspend and resume of origin without its snapshots.Alasdair Kergon2010-08-171-1/+1
|
* Use __attribute__ consistently throughout.Alasdair Kergon2010-07-091-1/+1
|
* Pass metadataignore to pv_create, pv_setup, _mda_setup, and add_mda.Dave Wysochanski2010-07-081-1/+1
| | | | | | | | | | | Pass metadataignore through PV creation / setup paths. As a result of this cleanup, we can remove the unnecessary setting of mda_ignore bits inside pvcreate_single(), after call to pv_create. For now, just set metadataignore to '0' in some places. This is equivalent to the prior functionality, although the 0 is given by the caller not hardcoded in _mda_setup() call. Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
* Add --pvmetadatacopies as a synonym for --metadatacopies in various commands.Dave Wysochanski2009-10-051-4/+9
| | | | | | | | | | | | | | | | | | | | | | | Going forward, we would like to allow users to specify the total number of metadatacopies in a VG rather than on a per-PV basis. In order to facilitate that, introduce --pvmetadatacopes to replace --metadatacopies everywhere. We still allow --metadatacopies for pv commands, but require --pvmetadatacopies for vg commands. Eventually we will introduce --vgmetadatacopies. Once we do that, we should either deprecate --metadatacopies or make it a synonym based on the command (pvmetadatacopies for pv commands, and vgmetadatacopies for vg commands). The latter option would likely just require a simple 'strncpy' check against cmd->command->name to qualify the merge_synonym call. Update nightly tests to cover the pvmetadatacopies synonym. Note that this patch is the result of an eariler review comment for the implicit pvcreate patches. Should apply cleanly on top of the implicit pvcreate patches (I applied after patch 10/10 in that series). NOTE: This patch will require --pvmetadatacopies for vgconvert as --metadatacopies is no longer accepted.
* Fix process_each_vg / _process_one_vg when vg_read() returns FAILED_LOCKING.Dave Wysochanski2009-09-151-5/+0
| | | | | | | | | | | | | | Remove the checks for vg_read_error() in most of the tools callback functions and instead make the check in _process_one_vg() more general. In all but vgcfgbackup, we do not want to proceed if we get any error from vg_read(). In vgcfgbackup's case, we may proceed if the backup is to proceed with inconsistent VGs. This is a special case though, and we mark it with the READ_ALLOW_INCONSISTENT flag passed to process_each_vg (and subsequently to _process_one_vg). NOTE: More cleanup is needed in the vg_read_error() path cases. This patch is a start.
* Add lots of missing stack debug messages to tools.Alasdair Kergon2009-09-141-3/+9
| | | | | Make readonly locking available as locking type 4. Fix readonly locking to permit writeable global locks (for vgscan). (2.02.49)
* Rename internal library function vg_remove to vg_remove_mdas.Dave Wysochanski2009-09-021-1/+1
| | | | | | | | Later patches should consolidate the vgremove / vgreduce functions but for now let's clarify what vg_remove actually does by changing the name. Author: Dave Wysochanski <dwysocha@redhat.com>
* Add --dataalignmentoffset to pvcreate to shift start of aligned data areaMike Snitzer2009-07-301-1/+1
| | | | | | | | Adds pe_align_offset to 'struct physical_volume'; is initialized with set_pe_align_offset(). After pe_start is established pe_align_offset is added to it. Signed-off-by: Mike Snitzer <snitzer@redhat.com>
* Rework the toollib interface (process_each_*) on top of new vg_read.Dave Wysochanski2009-07-011-3/+5
| | | | | | | | | Sun May 3 12:32:30 CEST 2009 Petr Rockai <me@mornfall.net> * Rework the toollib interface (process_each_*) on top of new vg_read. Rebased 6/26/09 by Dave W. - Add skipping message to process_each_lv - Remove inconsistent_t.
* Fix double releasing of vg when repairing of vg is requested.Milan Broz2009-06-051-14/+2
| | | | | | | | | | | | | | | | | | | | Several commands calls process_each_vg() and in provided callback it explicitly recovers VG if inconsistent. (vgchange, vgconvert, vgscan) It means that old VG is released and reread but the function above (process_one_vg) tries to unlock and release old VG. Patch moves the repair logic into _process_one_vg() function. It always tries to read vg (even inconsistent) and then decides what to do according new defined parameter. Also patch unifies inconsistent error messages. The only slight change if for vgremove command, where it now tries to repair VG before it removes if force arg is given. (It works similar way before, just the order of operation changed).
* Pre-release cleanups.Alasdair Kergon2009-05-211-1/+1
|
* Properly release VG memory pool in all CLI tools.Milan Broz2009-04-101-1/+1
|
* Add --dataalignment to pvcreate to specify alignment of data area. (mbroz)Alasdair Kergon2009-02-221-1/+1
| | | | | | | | | | | | | | | | | | This patch is not fully tested and leaves some related bugs unfixed. Intended behaviour of the code now: pe_start in the lvm2 format PV label header is set only by pvcreate (or vgconvert -M2) and then preserved in *all* operations thereafter. In some specialist cases, after the PV is added to a VG, the pe_start field in the VG metadata may hold a different value and if so, it overrides the other one for as long as the PV is in such a VG. Currently, the field storing the size of the data area in the PV label header always holds 0. As it only has meaning in the context of a volume group, it is calculated whenever the PV is added to a VG (and can be derived from extent_size and pe_count in the VG metadata).
* Right, a simple build (without options) is working again.Alasdair Kergon2008-11-031-5/+5
|
* Fix setting of volume limit count if converting to lvm1 format.Milan Broz2008-08-291-0/+9
| | | | | | | | Fixes problem when after downconvert to lvm1 VG is broken: # lvcreate -n lv1 -l 4 vg_test Invalid LV in extent map (PV /dev/sdb1, PE 0, LV 0, LE 0) ...
* Fix vgconvert logical volume id metadata validation.Milan Broz2008-08-281-0/+11
| | | | | If volume group is downconverted to lvm1 format, check if lvid has supported format for conversion to lv_num in lvm1.
* Refactor pv_create() to take cmd_context - no functional change.Dave Wysochanski2008-06-241-1/+1
|
* Accept sizes with --readahead argument.Alasdair Kergon2007-11-141-1/+1
| | | | Store size arguments as sectors internally.
* readahead activation code (but no dm support yet)Alasdair Kergon2007-11-121-1/+1
|
* Add pv_dev_name() to access PV device name.Dave Wysochanski2007-10-121-6/+6
| | | | 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
|
* Convert vg->status checks to use vg_check_status function.\nRename ↵Dave Wysochanski2007-06-191-8/+1
| | | | status_flags to status in vg_check_status.
* Remove get_ prefix from get_pv_* functionsDave Wysochanski2007-06-151-12/+12
|
* Convert pv->dev to get_pv_devDave Wysochanski2007-06-131-6/+6
|
* Convert pv->size to get_pv_sizeDave Wysochanski2007-06-131-1/+1
|
* Convert existing_pv dereferences to get_pv_*Dave Wysochanski2007-06-131-6/+6
|
* Fix lvcreate corelog validation.Alasdair Kergon2006-05-161-2/+2
| | | | | | | | | Add --config for overriding most config file settings from cmdline. Quote arguments when printing command line. Remove linefeed from 'initialising logging' message. Add 'Completed' debug message. Don't attempt library exit after reloading config files. Always compile with libdevmapper, even if device-mapper is disabled.
* Make SIZE_SHORT the default for display_size().Alasdair Kergon2006-05-091-1/+1
| | | | | | | Fix some memory leaks in error paths found by coverity. Use C99 struct initialisers. Move DEFS into configure.h. Clean-ups to remove miscellaneous compiler warnings.
* Attempt to load missing targets using modprobe.Alasdair Kergon2005-10-171-1/+1
| | | | Simplify dev_manager_info().
* Internal snapshot code restructuring.Alasdair Kergon2005-04-071-0/+2
|
* Only ask libdevmapper for open_count when we need it.Alasdair Kergon2005-01-121-1/+1
|
* Update copyright notices.Alasdair Kergon2004-03-301-13/+8
|
* rename config file vars & always use / as separatorAlasdair Kergon2004-03-081-4/+4
|
* Fix support for PVs on read only devices. [Still must set LVs read only]Alasdair Kergon2003-11-211-0/+1
|
* Cope better with LVM1 minor numbers & LV numbers.Alasdair Kergon2003-11-061-0/+25
|
* More consistent error code usage.Alasdair Kergon2003-10-211-2/+2
|
* macro changesAlasdair Kergon2003-10-151-3/+3
|
* Ensure more args aren't negative.Alasdair Kergon2003-09-151-0/+5
|
* Stop more gracefully when in test mode.Alasdair Kergon2003-04-241-0/+7
|
* Tidy various pre-processing incl. making libdl optional.Alasdair Kergon2003-03-241-1/+1
|
* Default stripesize 64k & config file setting for it;Alasdair Kergon2002-12-191-4/+4
| | | | | | Clear many compiler warnings (i386) & associated bugs - hopefully without introducing too many new bugs:-) (Same exercise required for other archs.) Default compilation has optimisation - or else use ./configure --enable-debug