mirror of
git://sourceware.org/git/lvm2.git
synced 2025-04-01 18:50:41 +03:00
lvm2app: add lvm_config_find_bool function
To effectively retrieve the setting of anything that could be enabled or disabled.
This commit is contained in:
parent
8791d01fee
commit
f64f22e2d6
@ -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.
|
||||
|
@ -302,6 +302,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.
|
||||
*
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user