summaryrefslogtreecommitdiffstats
path: root/tools/vgremove.c
Commit message (Collapse)AuthorAgeFilesLines
* Make force_t enum usage obviousZdenek Kabelac2012-02-271-1/+1
|
* Use __attribute__ consistently throughout.Alasdair Kergon2010-07-091-1/+1
|
* Refactor vg_remove_check to place pv removal into separate function.Dave Wysochanski2010-06-301-0/+2
|
* Fix vgremove to allow removal of VG with missing PVs. (2.02.52)Milan Broz2010-06-301-1/+1
|
* Allow vgremove of a VG with PVs missing.Petr Rockai2010-01-081-8/+13
|
* Fix tools to report error when stopped by user.Milan Broz2009-12-031-1/+1
| | | | (And do not produce internal error message.)
* 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-5/+15
| | | | | Make readonly locking available as locking type 4. Fix readonly locking to permit writeable global locks (for vgscan). (2.02.49)
* Split vg_remove_single into 2 functions - the second part commits to disk.Dave Wysochanski2009-09-021-1/+4
| | | | | | | | | | | | | | | | | | | | | | | Split vg_remove_single into vg_remove_check (mandatory checks before vgremove) and vg_remove (do actual remove by committing to disk). In liblvm, we'd like to provide an consistent API that allows multiple changes in memory, then let lvm_vg_write() control the commit to disk. In some cases (for example, lvresize calls fsadm) this may not be possible. However, since we are using an object model and dividing things into small operations, the most logical model seems to be the lvm_vg_write model, and handling the special cases as they arrive. So as best as possible we move towards this end. A possible optimization would be to consolidate vg_remove (committing) code with vgreduce code. A second possible optimization is making vgreduce of the last device equivalent to vgremove. Today, lvm_vg_reduce fails if vgreduce is called with the last device, but from an object model perspective we could view this as equivalent to vgremove and allow it. My gut feel is we do not want to do this though. Author: Dave Wysochanski <dwysocha@redhat.com>
* Fix vgck and vgremove segfault if non-existent vg given.Dave Wysochanski2009-07-141-0/+3
| | | | Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
* Move orphan lock inside vg_remove_single.Dave Wysochanski2009-07-101-7/+0
| | | | | | | | | | | | | | Move the vg orphan lock inside vg_remove_single, now a complete liblvm function. Note that this changes the order of the locks - originally VG_ORPHAN was obtained first, then the vgname lock. With the current policy of non-blocking second locks, this could mean we get a failure obtaining the orphan lock. In the case of a vg with lvs being removed, this could result in the lvs being removed but not the vg. Such a scenario could have happened prior though with a different failure. Other tools were examined for side-effects, and no major problems were noted. Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
* Remove force parameter from vg_remove_single, now the liblvm function.Dave Wysochanski2009-07-101-1/+23
| | | | | | | | | | | | | | | | | | | Move check for active LVs outside of library function. The vgremove liblvm function function will fail if there are active LVs. It will be the application's responsibility to check this condition and remove the LVs individually before calling vgremove. Note also that we've duplicated the EXPORTED_VG check in vgremove_single (tools) and vg_remove_single (library). Duplication seemed the only option here since we don't want to do the automatic removal of LVs (in the tools) if the vg is exported, and we still need to protect the library call from removal if the vg is exported. We still need to deal with the ORPHAN lock but vg_remove_single is now very close to our liblvm function. TODO: Refactor lvremove in a similar way. Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
* Remove unnecessary parameters from vg_remove_single().Dave Wysochanski2009-07-101-2/+1
| | | | | | | Use vg_t instead of struct volume_group. Should be no functional change. Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
* 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>
* Rework the toollib interface (process_each_*) on top of new vg_read.Dave Wysochanski2009-07-011-6/+4
| | | | | | | | | 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-2/+4
| | | | | | | | | | | | | | | | | | | | 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).
* 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.
* Some whitespace tidy-ups.Alasdair Kergon2008-01-301-2/+2
|
* Fix orphan-related locking in pvdisplay and pvs.Alasdair Kergon2007-11-021-2/+2
| | | | | | | | 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.
* Move guts of vgremove into lvm library.Dave Wysochanski2007-08-211-65/+0
| | | | Include archiver.h in metadata.c as a result of prior move.
* Prepare to move guts of vgremove into lvm library.Dave Wysochanski2007-08-211-12/+22
| | | | Fixup force_t.
* 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-4/+2
| | | | status_flags to status in vg_check_status.
* Remove get_ prefix from get_pv_* functionsDave Wysochanski2007-06-151-4/+4
|
* Convert pv->dev to get_pv_devDave Wysochanski2007-06-131-4/+4
|
* Fix vgremove to require at least one vg argument.Milan Broz2007-03-151-0/+5
|
* 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.
* Use ORPHAN lock definition throughout.Alasdair Kergon2005-10-031-2/+2
|
* Move archiver code from tools into library.Alasdair Kergon2005-05-171-1/+1
|
* Reinstate full PV size when removing from VG.Alasdair Kergon2005-05-031-0/+8
| | | | | Support loopfiles for testing. Complete the pv_segment support.
* Improve a vgremove error message.Alasdair Kergon2004-11-181-8/+5
|
* Use macro in vgremove locking fix.Alasdair Kergon2004-09-271-1/+1
|
* Hold VG lock while doing vgremove.Patrick Caulfield2004-09-241-2/+2
| | | | agk - you may want to check this.
* Update copyright notices.Alasdair Kergon2004-03-301-13/+8
|
* Fix vgremove 'all OK' checkAlasdair Kergon2003-11-061-1/+1
|
* More consistent error code usage.Alasdair Kergon2003-10-211-1/+1
|
* macro changesAlasdair Kergon2003-10-151-3/+3
|
* 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-2/+2
| | | | | | 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
* Some new features.Alasdair Kergon2002-11-181-28/+24
|
* agk, I recall you saying you had a massive commit pending; if you need meAndres Salomon2002-10-271-0/+3
| | | | | | | | | | | to back this out so you can do that commit, let me know. Also, if there's an issue with the error message that's displayed, just change it in tools.h. This causes a "device-mapper driver/module not loaded?" error message to be displayed for the commands that require dm-mod, if the tools can't get the driver version. It's not done for commands that don't require dm-mod. This should clear up some problems people have had attempting to use lvm2 without rtfm'ing.
* Merge with text format branch.Alasdair Kergon2002-04-241-8/+6
| | | | | | | | | | | | | | | | | | | Lots of changes/very little testing so far => there'll be bugs! Use 'vgcreate -M text' to create a volume group with its metadata stored in text files. Text format metadata changes should be reasonably atomic, with a (basic) automatic recovery mechanism if the system crashes while a change is in progress. Add a metadata section to lvm.conf to specify multiple directories if you want (recommended) to keep multiple copies of the metadata (eg on different filesystems). e.g. metadata { dirs = ["/etc/lvm/metadata1","/usr/local/lvm/metadata2"] } Plenty of refinements still in the pipeline.
* Review locking: block signals instead of ignoring them and restore stateAlasdair Kergon2002-03-151-1/+2
| | | | afterwards; avoid race condition with unlink; add LCK_HOLD to process_each_vg.
* o activate/reactivate mergeAlasdair Kergon2002-03-111-1/+1
| | | | o unlocking macro
* o Lock mechanism for LV activationAlasdair Kergon2002-02-271-2/+2
| | | | | | o #defines for common lock flag combinations o Try out hyphens instead of colons in device-mapper names - does this make messages containing filenames easier to read?
* Begin conversion so LV id is passed to activation unit instead ofAlasdair Kergon2002-02-251-2/+2
| | | | struct logical_volume.
* Run through indent - no (intentional) changes to any code.Alasdair Kergon2002-02-111-10/+8
|
* Preparation for an LVM2 liblvm - pass cmd_context into each tool andAlasdair Kergon2002-02-111-6/+6
| | | | link some globals that the tools need into that structure.
* o Support locking with local lock filesAlasdair Kergon2002-02-111-1/+13
| | | | o Disable control-c during updates (except if blocked waiting for a lock)
* quotes around names in outputHeinz Mauelshagen2002-01-301-12/+15
|