master - lvm2app: add lvm_config_find_bool function
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f64f22e2d657346197fcd0b8e97e87b6d290ab2b Commit: f64f22e2d657346197fcd0b8e97e87b6d290ab2b Parent: 8791d01fee7f5977b037400020db97a40821b94a Author: Peter Rajnoha <[email protected]> AuthorDate: Tue Jul 31 16:18:01 2012 +0200 Committer: Peter Rajnoha <[email protected]> CommitterDate: Tue Jul 31 16:18:01 2012 +0200
lvm2app: add lvm_config_find_bool function
To effectively retrieve the setting of anything that could be enabled or disabled.
--- WHATS_NEW | 1 + liblvm/lvm2app.h | 22 ++++++++++++++++++++++ liblvm/lvm_base.c | 5 +++++ 3 files changed, 28 insertions(+), 0 deletions(-)
WHATS_NEW +1 -0
@@ -1,5 +1,6 @@ Version 2.02.97 - =============================== + Add lvm_config_find_bool lvm2app fn to retrieve bool value from config tree. Respect --test also when using lvmetad. No longer capitalise first LV attribute char for invalid snapshots. Allow vgextend to add PVs to a VG that is missing PVs.
liblvm/lvm2app.h +22 -0
@@ -303,6 +303,28 @@ int lvm_config_reload(lvm_t libh);int lvm_config_override (lvm_t libh,const char *config_string);/** +* Find a boolean value in the LVM configuration. +* +* \memberof lvm_t +* +* This function finds a boolean value associated with a path +* in current LVM configuration. +* +* \param libh +* Handle obtained from lvm_init(). +* +* \param config_path +* A path in LVM configuration +* +* \param fail +* Value to return if the path is not found. +* +* \return +* boolean value for 'config_path' (success) or the value of 'fail' (error) +*/ +int lvm_config_find_bool (lvm_t libh,const char *config_path,int fail); + +/** * Return stored error no describing last LVM API error. * * \memberof lvm_t
liblvm/lvm_base.c +5 -0
@@ -94,6 +94,11 @@ int lvm_config_override(lvm_t libh, const char *config_settings)return 0 ; } +int lvm_config_find_bool (lvm_t libh,const char *config_path,int fail) +{ +return find_config_tree_bool ((struct cmd_context *)libh, config_path, fail); +} +int lvm_errno (lvm_t libh) {return stored_errno ();