summaryrefslogtreecommitdiffstats
path: root/liblvm/lvm_lv.c
Commit message (Collapse)AuthorAgeFilesLines
* cleanup: replace memset with struct initilizationZdenek Kabelac2012-06-221-2/+2
| | | | | Simplifies the code, properly detects too long socket paths, drops unused parameter.
* Initialize dmeventd monitoring for every commandZdenek Kabelac2012-02-151-1/+0
| | | | | | | | | | Read lvm.conf setting for monitoring for each command. So we should not activate monitoring if the default compilation is set to monitor during lvconvert commnads. Patch also removes check for clustered VG and allows to disable monitoring for clustered VG with the assumption, the problem with monitoring and dmeventd flag passing for INGNORE is already fixed.
* Add internal error for unsupported code pathsZdenek Kabelac2012-02-131-3/+10
| | | | | Patch mainly helps static analyzers to better work with code paths lvm code should never trigger.
* Remove duplicate testZdenek Kabelac2012-02-081-5/+5
| | | | | | Tested condition has been already evaluated before For strlen() code has already excluded <ID_LEN. For repairing, already tested (!argc && !repairing) before.
* Permit --available with lvcreate so non-snapshot LVs need not be activated.Alasdair Kergon2011-06-011-0/+1
|
* Do not check for open_count when not needed.Zdenek Kabelac2011-02-031-2/+2
| | | | | | Disable open_count checking in lv_info it it's not used. Fix previous commit (comment out unsable code for now).
* Add getters for copy_percent and snap_percent to the lvm2app API.Petr Rockai2010-12-141-1/+1
|
* This patch adds helpers to allow users to lookup a lv or pv handle byPetr Rockai2010-11-251-0/+22
| | | | | | | uuid (given a vg_t of course). Signed-off-by: Dave Wysochanski <wysochanski@pobox.com> Reviewed-by: Petr Rockai <prockai@redhat.com>
* This patch adds helpers to allow users to lookup a lv or pv handle byPetr Rockai2010-11-251-0/+11
| | | | | | | name (given a vg_t of course). Signed-off-by: Dave Wysochanski <wysochanski@pobox.com> Reviewed-by: Petr Rockai <prockai@redhat.com>
* Add lvm2app function to query pvseg properties.Petr Rockai2010-11-171-2/+2
| | | | | Signed-off-by: Dave Wysochanski <wysochanski@pobox.com> Reviewed-by: Petr Rockai <prockai@redhat.com>
* Add lvm2app function to query lvseg properties.Petr Rockai2010-11-171-1/+7
| | | | | Signed-off-by: Dave Wysochanski <wysochanski@pobox.com> Reviewed-by: Petr Rockai <prockai@redhat.com>
* Add a new type and function to lvm2app to enumerate lvsegs.Petr Rockai2010-11-171-0/+27
| | | | | Signed-off-by: Dave Wysochanski <wysochanski@pobox.com> Reviewed-by: Petr Rockai <prockai@redhat.com>
* Support repetition of --addtag and --deltag arguments.Alasdair Kergon2010-11-111-1/+1
| | | | | 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 lvm_lv_get_property() generic function to obtain value of any lv propertDave Wysochanski2010-10-251-0/+5
| | | | | | Add a generic LV property function to lvm2app, similar to VG function. Return lvm_property_value and require caller to check 'is_valid' flag and lvm_errno() for API error.
* Add pv_uuid_dup, vg_uuid_dup, and lv_uuid_dup, and call id_format_and_copy.Dave Wysochanski2010-09-301-8/+2
| | | | | | | Add supporting functions for pv_uuid, vg_uuid, and lv_uuid. Call new function id_format_and_copy. Use 'const' where appropriate. Add "_dup" suffix to indicate memory is being allocated. Call {pv|vg|lv}_uuid_dup from lvm2app uuid functions.
* Allow internal suspend and resume of origin without its snapshots.Alasdair Kergon2010-08-171-2/+2
|
* Remove unnecessary list of includes in liblvm files.Dave Wysochanski2010-07-091-2/+0
| | | | Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
* Use __attribute__ consistently throughout.Alasdair Kergon2010-07-091-1/+1
|
* Use vg->vgmem to allocate vg/lv/pv string properties instead of dm_malloc/frDave Wysochanski2010-04-191-9/+5
| | | | | | | | Everywhere else in the API the caller can rely on lvm2app taking care of memory allocation and free, so make the 'name' and 'uuid' properties of a vg/lv/pv use the vg handle to allocate memory. Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
* Use INTERNAL_ERROR definition consistently in internal error messages.Alasdair Kergon2010-03-251-1/+1
|
* Improve activation monitoring option processingMike Snitzer2010-03-231-0/+1
| | | | | | | | | | | | | . Add "monitoring" option to "activation" section of lvm.conf . Have clvmd consult the lvm.conf "activation/monitoring" too. . Introduce toollib.c:get_activation_monitoring_mode(). . Error out when both --monitor and --ignoremonitoring are provided. . Add --monitor and --ignoremonitoring support to lvcreate. Update lvcreate man page accordingly. . Clarify that '--monitor' controls the start and stop of monitoring in the {vg,lv}change man pages. Signed-off-by: Mike Snitzer <snitzer@redhat.com>
* Add lvm_lv_get_tags(), lvm_lv_add_tag(), and lvm_lv_remove_tag().Dave Wysochanski2010-02-241-0/+35
| | | | | | | | | | Add lvm2app functions to manage LV tags. For lvm_lv_get_tags(), we return a list of tags, similar to other functions that return lists. An empty list is returned if there are no tags. NULL is returned if there is a problem obtaining the list of tags. Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
* post-releaseAlasdair Kergon2010-02-161-2/+3
|
* Fix off by 512 sizes for lvm2app.Dave Wysochanski2010-02-141-2/+2
| | | | | | | | | | Internally we store sizes in sectors, but lvm2app exports sizes in bytes. We could get fancier and allow units configuration but this fix should do for now. Fixes rhbz561422. Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
* Make lvm2app lv_t handle definition consistent with lvm_t.Dave Wysochanski2009-08-131-11/+11
| | | | | | | This patch update lv_t handle to be consistent with lvm_t - define as a pointer to internal struct logical_volume. Author: Dave Wysochanski <dwysocha@redhat.com>
* Make lvm2app vg_t handle definition consistent with lvm_t.Dave Wysochanski2009-08-131-2/+2
| | | | | | | This patch update vg_t handle to be consistent with lvm_t - define as a pointer to internal struct volume_group. Author: Dave Wysochanski <dwysocha@redhat.com>
* Remove unneeded struct on return from lvm_lv_create_linear.Dave Wysochanski2009-07-291-1/+1
| | | | Results in compile warning.
* Remove pv_t, vg_t & lv_t handles from lib. Only liblvm uses them.Alasdair Kergon2009-07-291-2/+2
| | | | Rename lvm.h to lvm2app.h for now.
* Add an open_mode to the vg struct for liblvm - enforce read / write semantics.Dave Wysochanski2009-07-281-1/+4
| | | | | | | | | | | | | | For now, a simple way to enforce the read/write semantics is to just save the open mode of the VG. If the caller uses lvm_vg_create, the mode is write. The caller using lvm_vg_open can use either read or write to open the VG. Once we have this, we enforce the permissions on each API call and don't allow a caller to modify a VG that has not been opened properly. This may be better combined with the locking mode, but I view that as future cleanup, past this initial release. The intial release should enforce the basic object semantics though, as described in the lvm.h file. Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
* Update lvm.h - remove remaining FIXMEs, note limitations of a few functions.Dave Wysochanski2009-07-281-0/+9
| | | | Almost done...
* Use dm_malloc and dm_free in liblvm instead of malloc/free.Dave Wysochanski2009-07-281-1/+1
|
* Remove unnecessary \n's from log_error in liblvm.Dave Wysochanski2009-07-271-6/+6
|
* Add skeletons of lvm_lv_resize and lvm_pv_resize - not yet implemented.Dave Wysochanski2009-07-271-0/+7
| | | | | | | | These lower-priority interfaces are not currently implemented in liblvm but are on the TODO list in the near term. Author: Thomas Woerner <twoerner@redhat.com> Acked-by: Dave Wysochanski <dwysocha@redhat.com>
* Add lvm_lv_is_active and lvm_lv_is_suspended.Dave Wysochanski2009-07-261-0/+19
| | | | | | | | Return whether an LV is active in the kernel (live table) or suspended (table suspend). Author: Dave Wysochanski <dwysocha@redhat.com>
* Implement lvm_lv_activate and lvm_lv_deactivate liblvm calls.Dave Wysochanski2009-07-261-0/+50
| | | | | | | | Limited implementation but other types of activation should probably have separate calls. We also currently do not handle pvmoves or lvconverts. Author: Dave Wysochanski <dwysocha@redhat.com>
* Update liblvm status return codes to be consistent.Dave Wysochanski2009-07-261-2/+4
| | | | | | | | | | | | For now, we use the following scheme. For APIs that return an int, success is 0, fail is -1. APIs that return handles, success is non-NULL, fail is NULL. At this early stage, liblvm error handling mechanism is subject to change, but for now we go with this simple scheme consistent with system programming. Author: Dave Wysochanski <dwysocha@redhat.com>
* Add lvm_vg_remove_lv liblvm function.Dave Wysochanski2009-07-261-0/+6
| | | | | | | | | Add a very simple version of lvm_vg_remove_lv. Since we currently can only create linear LVs, this simple remove function is adequate. We must refactor lvremove_single a bit. Author: Dave Wysochanski <dwysocha@redhat.com>
* Add most all liblvm 'get' functions needed for anaconda.Dave Wysochanski2009-07-261-0/+6
| | | | | | | | | | | | Add the most straightforward 'get' functions required for anaconda. These are the ones that return simple uint64_t values. The other more complex ones involve the lv_attr bits. These will come in a separate patch series since each lv_attr bit will be returned in a separate API instred of returning the string and requiring the user to parse it. Author: Dave Wysochanski <dwysocha@redhat.com>
* Add lvm_vg_create_lv_linear liblvm function.Dave Wysochanski2009-07-261-0/+52
| | | | | | | Create a default linear logical volume from a volume group. Author: Dave Wysochanski <dwysocha@redhat.com>
* Add lvm_{pv|vg|lv}_get_{uuid|name}.Dave Wysochanski2009-07-231-0/+40
Caller must free the memory of the uuid / name returned. This may not be the best memory management policy since it may lead to memory leaks if the caller has code like this: if (!lvm_vg_get_name(vg)) Maybe we don't care - if we do we can use pools tied to handles later or some other scheme. Signed-off-by: Dave Wysochanski <dwysocha@redhat.com> Acked-by: Thomas Woerner <twoerner@redhat.com>