summaryrefslogtreecommitdiffstats
path: root/liblvm/lvm_base.c
Commit message (Collapse)AuthorAgeFilesLines
* buffering: use unbuffered silent mode for liblvmAlasdair G Kergon2012-08-261-1/+1
| | | | | | Disable private buffering when using liblvm. When private stdin/stdout buffering is not used always use silent mode.
* lvm2app: add lvm_config_find_bool functionPeter Rajnoha2012-07-311-0/+5
| | | | To effectively retrieve the setting of anything that could be enabled or disabled.
* Only use built-in stack size in clvmd - ignore lvm.conf.Alasdair Kergon2011-12-081-1/+1
|
* Add proper udev library context initialization and finalization to liblvm.Peter Rajnoha2011-06-151-0/+4
| | | | | | | | This was missing in liblvm and it caused all udev-related operations to not take effect when using liblvm, e.g. obtaining the list of devices from udev db instead of scanning the whole /dev which also recreated the .cache as a side effect. This was also the case with udisks-lvm-pv-export prober which is run from within udev rules whenever the CHANGE event is fired.
* When glibc needs buffers for line buffering of input and output buffers, itPetr Rockai2011-05-071-1/+1
| | | | | | | | | | | | allocates these buffers in such way it adds memory page for each such buffer and size of unlock memory check will mismatch by 1 or 2 pages. This happens when we print or read lines without '\n' so these buffers are used. To avoid this extra allocation, use setvbuf to set these bufffers ahead. Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com> Reviewed-by: Milan Broz <mbroz@redhat.com> Reviewed-by: Petr Rockai <prockai@redhat.com>
* Fix wrong cast to char*Zdenek Kabelac2010-12-201-1/+1
| | | | | As cmd->cmd_line is already const char pointer it's not needed to cast already const char pointer to char pointer.
* Add getters for copy_percent and snap_percent to the lvm2app API.Petr Rockai2010-12-141-1/+1
|
* Fix warnings with conversion of uuid.Dave Wysochanski2010-05-191-3/+3
| | | | | More cleanup of uuid casting / structures is needed but for now just cast like the rest of the code.
* Add lvm2app interfaces to lookup a vgname from a pvid and pvname.Dave Wysochanski2010-05-191-0/+19
| | | | | | | | | | | lvm2app forces applications to start with a volume group name, open the volume group, then operate on individual pvs. In some cases the application may want to start with a device name rather than the volume group name. Today, if an application wants to do this, it must iterate through all the volume groups to find the volume group that the specific device is attached to. These new interfaces allow the application to avoid such overhead. Bump the lvm2app version number to 3.
* Add new --sysinit option for vgchange and lvchange.Peter Rajnoha2010-05-061-1/+1
| | | | | | A shortcut for --ignorelockingfailure, --ignoremonitoring, --poll n options and LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES environment variable used all at once in initialisation scripts (e.g. rc.sysinit or initrd).
* Disable long living process flag in lvm2app.Milan Broz2010-03-171-1/+2
| | | | | | | | | This option should be configurable, but for now do not set it at all. (lvm2app is used in udisks probers and there cac cause several nasty races when trying to update lvmcache during rescan.)
* Move error message to locking constructor and printMilan Broz2010-01-221-1/+0
| | | | | | | | more descriptive message if locking fails instead of "Locking type -1 initialisation failed." Use read-only locking instead of misleading ignorelocking option in message.
* Don't include lvm-version.h in exported liblvm file!Dave Wysochanski2009-07-291-0/+1
| | | | Move include of lvm-version.h into lvm_base.c where it belongs.
* Remove pv_t, vg_t & lv_t handles from lib. Only liblvm uses them.Alasdair Kergon2009-07-291-1/+1
| | | | Rename lvm.h to lvm2app.h for now.
* Update lvm.h - remove remaining FIXMEs, note limitations of a few functions.Dave Wysochanski2009-07-281-0/+3
| | | | Almost done...
* Add lvm_library_get_version() and update unit tests to display version.Dave Wysochanski2009-07-281-0/+5
|
* Rename lvm_create to lvm_init and lvm_destroy to lvm_quit.Dave Wysochanski2009-07-281-3/+3
|
* Update return code for lvm_config_reload.Dave Wysochanski2009-07-271-1/+1
|
* Add lvm_config_override - allow caller to override config, similar to --config.Dave Wysochanski2009-07-271-0/+8
| | | | | | | | | | | | | | | | Allowing the caller to override the LVM configuration with an API will enable them to use things such as device filters. While very flexible, there is some danger to this API in that it will make it harder to debug setups that have a changing config and deduce what might have happened. At some point we may want to limit the scope of this API but for now it is as open as the --config option to lvm commands. Update exported symbols. When I renamed lvm_reload_config to lvm_config_reload I forgot to rename so I renamed that one here. This I believe is the last liblvm API for now. ;-) Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
* Rename lvm_reload_config to lvm_config_reload.Dave Wysochanski2009-07-271-1/+1
| | | | | | | | | | | The general naming scheme for most liblvm APIs is: lvm_<object>_<action> As there are likely to be other things to do on the lvm 'config' object (i.e. lvm_config_set_device_filter), we should use consistent naming. Author: Dave Wysochanski <dwysocha@redhat.com>
* Update liblvm status return codes to be consistent.Dave Wysochanski2009-07-261-2/+3
| | | | | | | | | | | | 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_errno and lvm_errmsg to liblvm to obtain failure information.Alasdair Kergon2009-07-161-0/+14
| | | | | Change create_toolcontext to still return an object if it fails part-way. Add EUNCLASSIFIED (-1) as the default LVM errno code.
* Add default cmd->cmd_line initialization for liblvm lvm_create().Dave Wysochanski2009-07-141-0/+6
| | | | | | | | | | | This needs initialized to non-NULL before using the archive() call. Normally this is set to the cmdline string when lvm is called from a tool. We could think about using it in another way, as a potential audit trail of liblvm calls, or just leave it set to the default "liblvm", similar to what clvmd does. For now, just set it to "liblvm". Signed-off-by: Dave Wysochanski <dwysocha@redhat.com> Acked-by: Alasdair G Kergon <agk@redhat.com>
* Remove unnecessary includes in lvm_base.c.Dave Wysochanski2009-03-101-2/+0
| | | | | | | | | | We would like to declare our handles pv_t, vg_t, and lv_t in the external library header lvm.h. However, these are already defined in metadata-exported.h for the use of some of the in-progress liblvm APIs. Thus, we cannot both define them in lvm.h and include metadata-exported.h in the external library C files. We could use preprocessor tricks (#ifndef) but for now we just avoid the include.
* Add new liblvm build directory and move lvm_base.c.Dave Wysochanski2009-03-061-0/+64
The original liblvm.a has been moved to liblvm-internal.a. We now use liblvm.a for the new application library and build it inside liblvm directory. Change dependencies so tools depend on liblvm application library, and application library depends on liblvm internal.