summaryrefslogtreecommitdiffstats
path: root/tools/vgreduce.c
Commit message (Collapse)AuthorAgeFilesLines
* config: add silent modeAlasdair G Kergon2012-08-251-3/+3
| | | | | | | | | | | | | | | | Accept -q as the short form of --quiet. Suppress non-essential standard output if -q is given twice. Treat log/silent in lvm.conf as equivalent to -qq. Review all log_print messages and change some to log_print_unless_silent. When silent, the following commands still produce output: dumpconfig, lvdisplay, lvmdiskscan, lvs, pvck, pvdisplay, pvs, version, vgcfgrestore -l, vgdisplay, vgs. [Needs checking.] Non-essential messages are shifted from log level 4 to log level 5 for syslog and lvm2_log_fn purposes.
* check: add internal errors for unexpected pathsZdenek Kabelac2012-08-231-0/+5
| | | | | | | | | | | | | | | | | | | | Adding couple INTERNAL_ERROR reports for unwanted parameters: Ensure the 'top' metadata node cannot be NULL for lvmetad. Make obvious vginfo2 cannot be NULL. Report internal error if handler and vg is undefined. Check for handle in poll_vg(). Ensure seg is not NULL in dev_manager_transient(). Report missing read_ahead for _lv_read_ahead_single(). Check for report handler in dm_report_object(). Check missing VG in _vgreduce_single().
* cleanup: drop unneeded included header filesZdenek Kabelac2012-08-231-1/+0
| | | | | This headers were not resolving anything used for compiled .c files. Remove unused util.c file.
* Fix unlocking in error path of vgreduceZdenek Kabelac2012-03-301-1/+8
| | | | | | When vg_read fails, it internally unlocks VG if it's been locked, so in error path we should skip unlock_vg for this case. (user would see ugly internal warning)
* Make force_t enum usage obviousZdenek Kabelac2012-02-271-1/+1
|
* Turn a warning to an error in vgreduce --removemissing, since we exit with aPetr Rockai2012-02-151-2/+2
| | | | failure status there.
* Remove duplicate testZdenek Kabelac2012-02-081-1/+1
| | | | | | Tested condition has been already evaluated before For strlen() code has already excluded <ID_LEN. For repairing, already tested (!argc && !repairing) before.
* Replace free_vg with release_vgZdenek Kabelac2011-08-101-3/+3
| | | | | | | | 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.
* remove unnecessary lvconvert.hAlasdair Kergon2011-07-081-1/+0
|
* Rewrite vgreduce --removemissing --force, using existing primitives:Petr Rockai2011-05-071-281/+23
| | | | | lv_remove_with_dependencies and mirror_remove_missing (the latter coming from lvconvert). Remove substantial amount of legacy code.
* Remove double bracesZdenek Kabelac2011-03-291-2/+2
| | | | | Clang gives notice about possible confusion as commonly double bracces are used when some assignment is done inside them.
* 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).
* Change pv_write code to work with the changes in metadata handling interfacePeter Rajnoha2011-02-211-1/+1
| | | | and changes in format_instance.
* 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.
* Rename vg_release to free_vg.Alasdair Kergon2010-12-081-3/+3
|
* Allow internal suspend and resume of origin without its snapshots.Alasdair Kergon2010-08-171-1/+1
|
* Use __attribute__ consistently throughout.Alasdair Kergon2010-07-091-2/+2
|
* Use del_pvl_from_vgs() in vgreduce paths.Dave Wysochanski2010-04-131-2/+1
| | | | | | Somehow these got missed in earlier patches. Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
* Call add_pvl_to_vgs() and del_pvl_from_vgs() from more places.Dave Wysochanski2010-04-131-3/+1
| | | | | | | 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>
* Introduce is_missing_pv().Alasdair Kergon2010-03-161-3/+3
|
* Also clean up MISSING devices in --removemissing --force in vgreduce.Petr Rockai2009-12-171-1/+1
|
* Add lots of missing stack debug messages to tools.Alasdair Kergon2009-09-141-7/+7
| | | | | Make readonly locking available as locking type 4. Fix readonly locking to permit writeable global locks (for vgscan). (2.02.49)
* Remove redundant validate_name in vgreduce.Dave Wysochanski2009-07-241-6/+0
| | | | | | | This check is now done in vg_read_for_update, thanks to mornfall. Should be no functional change. Author: Dave Wysochanski <dwysocha@redhat.com>
* Port process_each_pv to new vg_read.Petr Rockai2009-07-151-1/+1
|
* Refuse to open VG with MISSING_PVs for update unless handles_missing_pvs is set.Petr Rockai2009-07-151-1/+3
|
* Remove unneeded LOCK_NONBLOCKING from vg_read() API.Dave Wysochanski2009-07-081-1/+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>
* Convert vgreduce to use vg_read_for_update.Dave Wysochanski2009-07-011-22/+20
| | | | | | | Sun May 3 12:50:58 CEST 2009 Petr Rockai <me@mornfall.net> * Convert vgreduce to use vg_read_for_update. Rebased 6/26/2009 - Dave W.
* - Ignore suspended devices during repair (Milan).Petr Rockai2009-06-151-0/+5
| | | | | - Call vgreduce --removemissing (without --force) automatically to clean up bad PVs (Milan).
* Pre-release cleanups.Alasdair Kergon2009-05-211-2/+2
|
* Remove NON_BLOCKING lock flag from tools and set a policy to auto-set.Dave Wysochanski2009-05-131-1/+1
| | | | | | | | | 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.
* Fix vgreduce --removemissing failure exit code.Milan Broz2009-04-221-2/+4
|
* Properly release VG memory pool in all CLI tools.Milan Broz2009-04-101-50/+33
|
* Separate PV label attributes which do not need parse metadata when reporting.Milan Broz2009-02-091-2/+2
| | | | | | | | | | When reporting explicitly label attributes (pv_uuid for example), we do not need to read metadata. This patch separate the label fileds and removes scan_vgs_for_pvs in process_each_pv() if not needed. (There should be no user visible change in output.)
* Rename vg_read() to vg_read_internal(). (mornfall)Alasdair Kergon2009-01-261-3/+3
|
* Right, a simple build (without options) is working again.Alasdair Kergon2008-11-031-25/+25
|
* fix last releaseAlasdair Kergon2008-09-191-3/+19
|
* Improve the way VGs with PVs missing are handled so manual interventionAlasdair Kergon2008-09-191-43/+59
| | | | is required in fewer circumstances. (mornfall)
* remove unused varAlasdair Kergon2008-09-191-1/+0
|
* Avoid shuffling remaining mirror images when removing one, retaining primary.Alasdair Kergon2008-09-181-3/+2
|
* Fix vgreduce to use vg_split_mdas to check sufficient mdas remain.Alasdair Kergon2008-04-081-1/+28
| | | | | Add (empty) orphan VGs to lvmcache during initialisation. Fix orphan VG name used for format_pool.
* split orphan VG by format typeAlasdair Kergon2008-02-061-1/+1
|
* undo a few 'stack' movesAlasdair Kergon2008-01-301-1/+2
|
* Some whitespace tidy-ups.Alasdair Kergon2008-01-301-2/+2
|
* Use stack return macros throughout.Alasdair Kergon2008-01-301-34/+17
|
* rename lv_remap_errorAlasdair Kergon2008-01-171-14/+4
|
* lvconvert/vgreduce fixesAlasdair Kergon2008-01-171-0/+19
|
* Maintain lists of stacked LV segments using each LV.Alasdair Kergon2008-01-161-7/+2
|
* note pvmove breakageAlasdair Kergon2007-11-191-1/+1
|
* more vg_read lock fixesAlasdair Kergon2007-11-151-1/+1
|