summaryrefslogtreecommitdiffstats
path: root/tools/pvchange.c
Commit message (Collapse)AuthorAgeFilesLines
* Move the core of the lib/config/config.c functionality into libdevmapper,Petr Rockai2011-08-301-1/+1
| | | | | | | leaving behind the LVM-specific parts of the code (convenience wrappers that handle `struct device` and `struct cmd_context`, basically). A number of functions have been renamed (in addition to getting a dm_ prefix) -- namely, all of the config interface now has a dm_config_ prefix.
* Replace free_vg with release_vgZdenek Kabelac2011-08-101-4/+4
| | | | | | | | 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.
* Allow non-orphan PVs with two metadata areas to be resized.Peter Rajnoha2011-02-281-2/+2
| | | | | | | | | 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).
* Add old_uuid field to struct physical_volume so we can still reference a PVPeter Rajnoha2011-02-211-0/+1
| | | | | with its old UUID when we're changig it (the cache as well as metadata area index has the old uuid that we need to use to access the information!)
* Change pv_write code to work with the changes in metadata handling interfacePeter Rajnoha2011-02-211-2/+2
| | | | and changes in format_instance.
* Add change_tag to toollib.Alasdair Kergon2011-01-241-58/+35
| | | | Allow multiple pvchange command line options to be specified together.
* Fix wrongly paired unlocking of global lock in pvchange. (2.02.66)Milan Broz2010-12-231-1/+1
|
* Rename vg_release to free_vg.Alasdair Kergon2010-12-081-4/+4
|
* Support repetition of --addtag and --deltag arguments.Alasdair Kergon2010-11-111-13/+20
| | | | | Add infrastructure for specific cmdline arguments to be repeated in groups. Split the_args cmdline arguments and values into arg_props and arg_values.
* Add escape sequence for ':' and '@' found in device names used as PVs.Peter Rajnoha2010-09-231-1/+3
|
* Use __attribute__ consistently throughout.Alasdair Kergon2010-07-091-2/+2
|
* Shorten prompt for pvchange and vgextend.Dave Wysochanski2010-07-071-4/+3
|
* Add --force to pvchange, and allow override of prompt involving metadataignore.Dave Wysochanski2010-07-071-0/+1
| | | | Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
* Add prompt if using --metadataignore argument with vgmetadatacopies.Dave Wysochanski2010-07-071-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When using vgmetadatacopies value other than "umanaged" (0), prompt the user if the usage of --metadataignore would change the value of vgmetadatacopies. The main 2 cases are: 1) pvchange --metadataignore 2) vgextend --metadataignore We leave the prompt check in the tools, and do not change anything if the user says 'n'. Examples: vgextend --metadataignore y vgtest /dev/loop0 Setting metadataignore will override preferred number of copies of VG vgtest metadata. Are you sure? [y/n]: y No physical volume label read from /dev/loop0 Physical volume "/dev/loop0" successfully created Volume group "vgtest" successfully extended pvchange --metadataignore y /dev/loop3 Setting metadataignore on /dev/loop3 will override preferred number of copies of VG vgtest metadata. Are you sure? [y/n]: y WARNING: Changing preferred number of copies of VG vgtest metadata from 3 to 2 Physical volume "/dev/loop3" changed 1 physical volume changed / 0 physical volumes not changed Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
* Move code into pv_change_metadataignore library function.Dave Wysochanski2010-06-291-35/+1
| | | | | | | In preparation to call this from both pvcreate as well as pvchange, move the guts of metadataignore into a library function. Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
* Set vg_mda_copies when pvchange --metadataignore is given.Dave Wysochanski2010-06-281-0/+11
| | | | | | | | | | When a user explicitly sets a new mda ignore value for a PV, we should update vg_mda_copies accordingly. When the VG is written out, the user would not want the new ignore state to get lost as a result of the vg_mda_copies value and logic in the vg_write path. Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
* Add --metadataignore to pvchange, allowing for ignoring of metadata areas.Dave Wysochanski2010-06-281-1/+32
| | | | | | | | | This patch just modifies pvchange to call the underlying ignore functions for mdas. Ensure special cases do not reflect changes in metadata (PVs with 0 mdas, setting ignored when already ignored, clearing ignored when not ignored). Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
* Remove another pvchange hack involving orphan VG names.Dave Wysochanski2010-05-191-3/+0
| | | | Unnecessary as a result of recent changes.
* Remove hack in pvchange to unlock orphan VG.Dave Wysochanski2010-05-191-3/+0
| | | | | With agk's recent changes, the lock/unlock APIs can properly handle orphan VG names.
* Update pvchange to always obtain a vg handle for each pv to process.Dave Wysochanski2010-05-191-67/+55
| | | | | | | | | | | | Earlier patches added some infrastructure to lookup a vgname from a pvname. We now can cleanup some of the pvchange and other code by requiring callers that want to modify some pv property: 1) lookup the vgname by the pvname 2) use the vgname to obtain a vg handle 3) get the pv handle from the vg handle This should work going forward and be a much cleaner interface, as we move away from pvs as standalone objects.
* Add lots of missing stack debug messages to tools.Alasdair Kergon2009-09-141-0/+1
| | | | | Make readonly locking available as locking type 4. Fix readonly locking to permit writeable global locks (for vgscan). (2.02.49)
* Refactor a couple log_error() statements in prep for larger log_error() patch.Dave Wysochanski2009-07-081-3/+2
| | | | | | | Part of twoerner's log_error() patches. Signed-off-by: Thomas Woerner <twoerner@redhat.com> Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
* Fix vg_read() error paths to properly release upon vg_read_error().Dave Wysochanski2009-07-071-1/+3
| | | | | | | | | | | | | | | | | | | | | | | 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-3/+2
| | | | | | | 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-2/+3
|
* Convert the straight instances of vg_lock_and_read to new vg_read(_for_update).Dave Wysochanski2009-06-261-3/+2
| | | | | | | | | 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>
* Abort if automatic metadata correction fails when reading VG to update it.Alasdair Kergon2009-06-261-1/+1
|
* Pre-release cleanups.Alasdair Kergon2009-05-211-1/+1
|
* Properly release VG memory pool in all CLI tools.Milan Broz2009-04-101-32/+22
|
* Try to avoid full rescan if label scan is enough.Milan Broz2009-02-251-3/+3
|
* Right, a simple build (without options) is working again.Alasdair Kergon2008-11-031-5/+5
|
* remove unused mdas variableAlasdair Kergon2008-07-311-4/+1
|
* Fix pvchange to handle PVs without mdas.Alasdair Kergon2008-07-311-4/+23
|
* Fix pvchange -M1 -u to preserve existing extent locations when there's a VG.Alasdair Kergon2008-07-161-0/+13
|
* split orphan VG by format typeAlasdair Kergon2008-02-061-1/+1
|
* Some whitespace tidy-ups.Alasdair Kergon2008-01-301-1/+1
|
* Use stack return macros throughout.Alasdair Kergon2008-01-301-2/+1
|
* Convert some vg_reads into vg_lock_and_readsAlasdair Kergon2007-11-151-20/+6
|
* Fix orphan-related locking in pvdisplay and pvs.Alasdair Kergon2007-11-021-30/+31
| | | | | | | | Fix missing VG unlocks in some pvchange error paths. Add some missing validation of VG names. Rename validate_vg_name() to validate_new_vg_name(). Change orphan lock to VG_ORPHANS. Change format1 to use ORPHAN as orphan VG name.
* Convert pvchange, pvdisplay, pvscan to use is_orphan()Bryn M. Reeves2007-11-021-6/+7
|
* Add pv_dev_name() to access PV device name.Dave Wysochanski2007-10-121-1/+1
| | | | 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
|
* Remove get_ prefix from get_pv_* functionsDave Wysochanski2007-06-151-23/+23
|
* Convert pv->vg_name to get_pv_vg_nameDave Wysochanski2007-06-141-4/+4
|
* Convert pv->vg_name to get_pv_vg_nameDave Wysochanski2007-06-131-15/+15
|
* Convert pv->status to get_pv_statusDave Wysochanski2007-06-131-2/+2
|
* Convert pv->dev to get_pv_devDave Wysochanski2007-06-131-1/+1
|
* Convert pv->pe_alloc_count to get_pv_pe_alloc_countDave Wysochanski2007-06-131-1/+1
|
* Add vg_check_status to consolidate vg status flags checks and error messages.Dave Wysochanski2007-06-061-14/+2
|
* Adjust some alignments for ia64 and sparc.Alasdair Kergon2006-11-301-1/+1
| | | | (Some of the changes are probably unnecessary.)