summaryrefslogtreecommitdiffstats
path: root/tools/vgcreate.c
Commit message (Collapse)AuthorAgeFilesLines
* The lvmetad client-side integration. Only active when use_lvmetad = 1 is set inPetr Rockai2012-02-231-0/+2
| | | | lvm.conf *and* lvmetad is running.
* 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.
* 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
|
* Support repetition of --addtag and --deltag arguments.Alasdair Kergon2010-11-111-11/+15
| | | | | Add infrastructure for specific cmdline arguments to be repeated in groups. Split the_args cmdline arguments and values into arg_props and arg_values.
* improve vgmetadatacopies unmanaged messageAlasdair Kergon2010-06-301-1/+1
|
* Add --vgmetadatacopies to vgcreate man page, command, and lvm.conf.Dave Wysochanski2010-06-281-6/+2
| | | | | | | Allow parsing of --vgmetadatacopies for vgcreate. Accept --metadatacopies as a synonym for --vgmetadatacopies. Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
* Refactor vgcreate to call new vg_change_tag() function.Dave Wysochanski2010-02-241-10/+2
| | | | Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
* Fix previous vgcreate commit to not call unpaired unlock.Milan Broz2009-12-281-2/+3
|
* Print error if VG already exist.Milan Broz2009-12-031-2/+7
| | | | This test have to be moved because of new vg read error handling.
* Rename validate_vg_create_params to vgcreate_params_validate.Dave Wysochanski2009-11-011-1/+1
|
* Rename fill_vg_create_params to vgcreate_params_set_from_args.Dave Wysochanski2009-11-011-1/+2
| | | | | Rename fill_vg_create_params to vgcreate_params_set_from_args and remove vg_name parameter from function (caller must set before calling function).
* Add vgcreate_params_set_defaults().Dave Wysochanski2009-11-011-6/+1
| | | | | Add function to set default vgcreate parameters based on existing VG or internal defaults. Should be no functional change.
* Rename pvcreate_params processing functions to better match <object><action>.Dave Wysochanski2009-11-011-2/+2
| | | | | | Rename fill_default_pvcreate_params to pvcreate_params_set_defaults. Rename pvcreate_validate_restore_params to pvcreate_restore_params_validate. Rename pvcreate_validate_params to pvcreate_params_validate.
* Update vgcreate to call vg_set_clustered().Dave Wysochanski2009-10-311-5/+3
|
* Add --pvmetadatacopies as a synonym for --metadatacopies in various commands.Dave Wysochanski2009-10-051-0/+5
| | | | | | | | | | | | | | | | | | | | | | | 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.
* Add implicit pvcreate support to vgcreate and vgextend.Dave Wysochanski2009-10-051-3/+4
| | | | | | Adds implicit pvcreate support when calling vgcreate or vgextend with device paths that are not yet PVs. This changes the behavior of vgcreate and vgextend from failing with an error message to implicitly pvcreating.
* Refactor vgcreate/vgextend validation of vgname/pvname(s).Dave Wysochanski2009-10-051-3/+8
| | | | | Decrement argc and increment argv in a consistent way to allow for later code-sharing. Should be no functional change.
* Add pvcreate_params to vg_extend.Dave Wysochanski2009-10-051-1/+1
| | | | | | | | | | | | | | | | Another refactoring for implicit pvcreate support. We need to get the pvcreate parameters somehow to the vg_extend routine. Options seemed to be: 1. Attach the parameters to struct volume_group. I personally did not like this idea in most cases, though one could make an agrument why it might be ok at least for some of the parameters (e.g. metadatacopies). 2. Pass them in to the extend routine. This second route seemed to be the best approach given the constraints. Future patches will parse the command line and fill in the actual values for the pvcreate_single call. Should be no functional change.
* Add lots of missing stack debug messages to tools.Alasdair Kergon2009-09-141-6/+4
| | | | | Make readonly locking available as locking type 4. Fix readonly locking to permit writeable global locks (for vgscan). (2.02.49)
* Revert previous patch that moved VG_ORPHAN lock inside vg_extend.Dave Wysochanski2009-07-241-0/+8
| | | | | | | | | | | | | | | | | | | We must hold the VG_ORPHAN lock until we commit to disk. Otherwise, we risk a race condition on vgcreate / vgextend. Reverts the following commit: commit 72a41480ba66d7dc2d05ef8583080b6b08208507 Author: Dave Wysochanski <dwysocha@redhat.com> Date: Fri Jul 10 20:09:21 2009 +0000 Move orphan lock obtain/release inside vg_extend(). With this change we now have vgcreate/vgextend liblvm functions. Note that this changes the lock order of the following functions as the orphan lock is now obtained first. With our policy of non-blocking second locks, this should not be a problem. Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
* Move orphan lock obtain/release inside vg_extend().Dave Wysochanski2009-07-101-8/+0
| | | | | | | | | With this change we now have vgcreate/vgextend liblvm functions. Note that this changes the lock order of the following functions as the orphan lock is now obtained first. With our policy of non-blocking second locks, this should not be a problem. Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
* Change vg_create() to take only minimal parameters and obtain a lock.Dave Wysochanski2009-07-091-10/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | vg_t *vg_create(struct cmd_context *cmd, const char *vg_name); This is the first step towards the API called to create a VG. Call vg_lock_newname() inside this function. Use _vg_make_handle() where possible. Now we have 2 ways to construct a volume group: 1) vg_read: Used when constructing an existing VG from disks 2) vg_create: Used when constructing a new VG Both of these interfaces obtain a lock, and return a vg_t *. The usage of _vg_make_handle() inside vg_create() doesn't fit perfectly but it's ok for now. Needs some cleanup though and I've noted "FIXME" in the code. Add the new vg_create() plus vg 'set' functions for non-default VG parameters in the following tools: - vgcreate: Fairly straightforward refactoring. We just moved vg_lock_newname inside vg_create so we check the return via vg_read_error. - vgsplit: The refactoring here is a bit more tricky. Originally we called vg_lock_newname and depending on the error code, we either read the existing vg or created the new one. Now vg_create() calls vg_lock_newname, so we first try to create the VG. If this fails with FAILED_EXIST, we can then do the vg_read. If the create succeeds, we check the input parameters and set any new values on the VG. TODO in future patches: 1. The VG_ORPHAN lock needs some thought. We may want to treat this as any other VG, and require the application to obtain a handle and pass it to other API calls (for example, vg_extend). Or, we may find that hiding the VG_ORPHAN lock inside other APIs is the way to go. I thought of placing the VG_ORPHAN lock inside vg_create() and tying it to the vg handle, but was not certain this was the right approach. 2. Cleanup error paths. Integrate vg_read_error() with vg_create and vg_read* error codes and/or the new error APIs. Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
* Add defines for default vgcreate parameters.Dave Wysochanski2009-07-091-4/+4
|
* Update vgcreate to use new vg_lock_newname().Dave Wysochanski2009-06-091-1/+1
|
* 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.
* Properly release VG memory pool in all CLI tools.Milan Broz2009-04-101-0/+2
|
* Fix vgcreate race which could allow two parallel vgcreates to succeed,Dave Wysochanski2008-12-011-21/+22
| | | | | | | with the second vgcreate overwriting the first. Obtain lock before calling vg_create(), which checks for existence of vgname and fails if it already exists.
* Indicate whether or not VG is clustered in vgcreate log message.Alasdair Kergon2008-04-081-3/+9
| | | | Mention default --clustered setting in vgcreate man page.
* fix default extent_sizeAlasdair Kergon2008-01-171-1/+1
|
* Move more parameter validation into the library.Dave Wysochanski2008-01-151-14/+21
| | | | | | | | | | | | | | | Update vgrename to call validate_vg_rename_params(). Fix vgcreate and vgsplit default arguments by adding defaults parameter to fill_vg_create_params(). Add t-vgrename-usage.sh test. Bugzilla: bz251992 --- tools/toollib.c | 32 ++++++++------------------------ tools/toollib.h | 5 ++--- tools/vgcreate.c | 35 +++++++++++++++++++++-------------- tools/vgrename.c | 35 ++++++----------------------------- tools/vgsplit.c | 21 ++++++++++++++------- 5 files changed, 51 insertions(+), 77 deletions(-)
* Allow vgcreate options as input to vgsplit when new vg is split destination.Dave Wysochanski2008-01-141-84/+15
|
* Refactor vgcreate for parameter validation and add testsDave Wysochanski2008-01-111-26/+40
|
* Accept sizes with --readahead argument.Alasdair Kergon2007-11-141-1/+1
| | | | Store size arguments as sectors internally.
* Fix orphan-related locking in pvdisplay and pvs.Alasdair Kergon2007-11-021-6/+6
| | | | | | | | 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.
* Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1.Alasdair Kergon2007-08-201-3/+3
|
* Make warnings go to stderr. Change log_warn to that effect, log_printPetr Rockai2007-06-281-4/+4
| | | | continues to send messages to stdout.
* Support the /dev/mapper prefix on most command lines.Alasdair Kergon2007-03-091-1/+1
|
* Add skip_dev_dir() to process command line VGs.Alasdair Kergon2006-08-251-5/+1
|
* 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-5/+5
|
* Make VG name restrictions consistent.Alasdair Kergon2005-06-061-8/+1
|
* Add clustered attribute so vgchange can identify clustered VGs w/o locking.Alasdair Kergon2005-03-211-0/+12
|
* Rename allocation policies; add --alloc to cmdline; LV inherits from VG.Alasdair Kergon2004-05-181-1/+9
|
* Update copyright notices.Alasdair Kergon2004-03-301-13/+8
|
* indentAlasdair Kergon2004-03-261-50/+50
|
* taggingAlasdair Kergon2004-03-081-0/+19
|
* Default to unlimited number of LVs/PVs in lvm2 format.Alasdair Kergon2003-11-061-32/+39
|
* Ban vgcreate -s 0Alasdair Kergon2003-11-061-0/+5
|
* More consistent error code usage.Alasdair Kergon2003-10-211-1/+1
|