]> sourceware.org Git - lvm2.git/commitdiff
lvm2app: add lvm_config_find_bool function
authorPeter Rajnoha <prajnoha@redhat.com>
Tue, 31 Jul 2012 14:18:01 +0000 (16:18 +0200)
committerPeter Rajnoha <prajnoha@redhat.com>
Tue, 31 Jul 2012 14:18:01 +0000 (16:18 +0200)
To effectively retrieve the setting of anything that could be enabled or disabled.

WHATS_NEW
liblvm/lvm2app.h
liblvm/lvm_base.c

index cb3ed90cd07889200ba944e56ecb872b3c703837..5208da9a72422ab77d622dc89c67ffdaca56ab15 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -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.
index dd200e3e3a2efb428ce6cd8323e075fb747409d8..72c0d79ffb66b917db2cd4c028bbe8c203d2658e 100644 (file)
@@ -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.
  *
index 599c859a3a166f8992311e34f8ae2c01cfb9f441..2f39b46231d32609ef72598d203e0329de60b732 100644 (file)
@@ -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();
This page took 0.040591 seconds and 5 git commands to generate.