Skip to contentSkip to conversation

master - configure: use_lvmetad/polld configurable

PATCH Zdenek Kabelac 1 participant 1 message May 11, 2015

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=725136b57eef7a61e506a445d43e6632882dc0bf
Commit:        725136b57eef7a61e506a445d43e6632882dc0bf
Parent:        18066949282613fad1981804297b3bba01bcc3bd
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Mon May 11 13:49:41 2015 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Mon May 11 14:36:10 2015 +0200

configure: use_lvmetad/polld configurable

Configure provides proper settings for
use_lvmetad and use_lvmpolld conf setttings.

When the build of polld & lvmetad, these settings are enabled by default unless explicitelly disabled with --disable-use-lvmetad/--disable-use-lvmpolld.

---
 WHATS_NEW                    |    1 +
 conf/example.conf.in         |    4 +-
 configure                    |   50 ++++++++++++++++++++++++++++++++++++++++++
 configure.in                 |   28 +++++++++++++++++++++++
 lib/config/config_settings.h |    4 +-
 lib/misc/configure.h.in      |    6 +++++
 6 files changed, 89 insertions(+), 4 deletions(-)
WHATS_NEW +1 -0
index 7052016..e4fe6b6 100644
@@ -1,5 +1,6 @@
 Version 2.02.120 -
 ===============================
+  Configure lvm.conf for use_lvmetad and use_lvmpolld.
   Add lvpoll for cmdline communication with lvmpolld.
   Add lvmpolld acting as a free-standing version of polldaemon.
   Properly validate PV size for pvcreate --restorefile.
conf/example.conf.in +2 -2
index e16aa7f..843e62d 100644
@@ -820,7 +820,7 @@ global {
 	# lvmetad is not compatible with locking_type 3 (clustering).
 	# LVM prints warnings and ignores lvmetad if this combination
 	# is seen.
-	use_lvmetad = 0
+	use_lvmetad = @DEFAULT_USE_LVMETAD@
 
 	# Configuration option global/thin_check_executable.
 	# The full path to the thin_check command.
@@ -947,7 +947,7 @@ global {
 	# spawned in lvmpolld's service cgroup.
 	#
 	# When set to 0 lvm falls back to classical polling.
-	use_lvmpolld = 0
+	use_lvmpolld = @DEFAULT_USE_LVMPOLLD@
 }
 
 # Configuration section activation.
configure +50 -0

105 lines not on this page · raw message

Makefile tools/Makefile udev/Makefile unit-tests/datastruct/Makefile unit-tests/regex/Makefile unit-tests/mm/Makefile"

configure.in +28 -0
index 1887757..83358f5 100644
@@ -1067,6 +1067,15 @@ AC_MSG_RESULT($LVMETAD)
 BUILD_LVMETAD=$LVMETAD
 
 if test "$BUILD_LVMETAD" = yes; then
+	AC_MSG_CHECKING([defaults for use_lvmetad])
+	AC_ARG_ENABLE(use_lvmetad,
+		      AC_HELP_STRING([--disable-use-lvmetad],
+				     [disable usage of LVM Metadata Daemon]),
+		      [case ${enableval} in
+		       yes) DEFAULT_USE_LVMETAD=1 ;;
+		       *) DEFAULT_USE_LVMETAD=0 ;;
+		       esac], DEFAULT_USE_LVMETAD=1)
+	AC_MSG_RESULT($DEFAULT_USE_LVMETAD)
 	AC_DEFINE([LVMETAD_SUPPORT], 1, [Define to 1 to include code that uses lvmetad.])
 
 	AC_ARG_WITH(lvmetad-pidfile,
@@ -1076,7 +1085,11 @@ if test "$BUILD_LVMETAD" = yes; then
 		    LVMETAD_PIDFILE="$DEFAULT_PID_DIR/lvmetad.pid")
 	AC_DEFINE_UNQUOTED(LVMETAD_PIDFILE, ["$LVMETAD_PIDFILE"],
 			   [Path to lvmetad pidfile.])
+else
+	DEFAULT_USE_LVMETAD=0
 fi
+AC_DEFINE_UNQUOTED(DEFAULT_USE_LVMETAD, [$DEFAULT_USE_LVMETAD],
+		   [Use lvmetad by default.])
 
 ################################################################################
 dnl -- Build lvmpolld
@@ -1090,6 +1103,15 @@ AC_MSG_RESULT($LVMPOLLD)
 BUILD_LVMPOLLD=$LVMPOLLD
 
 if test "$BUILD_LVMPOLLD" = yes; then
+	AC_MSG_CHECKING([defaults for use_lvmpolld])
+	AC_ARG_ENABLE(use_lvmpolld,
+		      AC_HELP_STRING([--disable-use-lvmpolld],
+				     [disable usage of LVM Poll Daemon]),
+		      [case ${enableval} in
+		       yes) DEFAULT_USE_LVMPOLLD=1 ;;
+		       *) DEFAULT_USE_LVMPOLLD=0 ;;
+		       esac], DEFAULT_USE_LVMPOLLD=1)
+	AC_MSG_RESULT($DEFAULT_USE_LVMPOLLD)
 	AC_DEFINE([LVMPOLLD_SUPPORT], 1, [Define to 1 to include code that uses lvmpolld.])
 
 	AC_ARG_WITH(lvmpolld-pidfile,
@@ -1099,7 +1121,11 @@ if test "$BUILD_LVMPOLLD" = yes; then
 		    LVMPOLLD_PIDFILE="$DEFAULT_PID_DIR/lvmpolld.pid")
 	AC_DEFINE_UNQUOTED(LVMPOLLD_PIDFILE, ["$LVMPOLLD_PIDFILE"],
 			   [Path to lvmpolld pidfile.])
+else
+	DEFAULT_USE_LVMPOLLD=0
 fi
+AC_DEFINE_UNQUOTED(DEFAULT_USE_LVMPOLLD, [$DEFAULT_USE_LVMPOLLD],
+		   [Use lvmpolld by default.])
 
 ################################################################################
 dnl -- Enable blkid wiping functionality
@@ -1748,6 +1774,8 @@ AC_SUBST(DEFAULT_RAID10_SEGTYPE)
 AC_SUBST(DEFAULT_RUN_DIR)
 AC_SUBST(DEFAULT_SPARSE_SEGTYPE)
 AC_SUBST(DEFAULT_SYS_DIR)
+AC_SUBST(DEFAULT_USE_LVMETAD)
+AC_SUBST(DEFAULT_USE_LVMPOLLD)
 AC_SUBST(DEVMAPPER)
 AC_SUBST(DLM_CFLAGS)
 AC_SUBST(DLM_LIBS)
lib/config/config_settings.h +2 -2
index 59a7c1c..2bbafc3 100644
@@ -780,7 +780,7 @@ cfg(global_lvdisplay_shows_full_device_path_CFG, "lvdisplay_shows_full_device_pa
 	"was never a valid path in the /dev filesystem.\n"
 	"Enable this option to reinstate the previous format.\n")
 
-cfg(global_use_lvmetad_CFG, "use_lvmetad", global_CFG_SECTION, 0, CFG_TYPE_BOOL, 0, vsn(2, 2, 93), NULL, 0, NULL,
+cfg(global_use_lvmetad_CFG, "use_lvmetad", global_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_USE_LVMETAD, vsn(2, 2, 93), NULL, 0, NULL,
 	"Use lvmetad to cache metadata and reduce disk scanning.\n"
 	"When enabled (and running), lvmetad provides LVM commands\n"
 	"with VG metadata and PV state.  LVM commands then avoid\n"
@@ -920,7 +920,7 @@ cfg(activation_checks_CFG, "checks", activation_CFG_SECTION, 0, CFG_TYPE_BOOL, D
 	"Some of the checks may be expensive, so it's best to use\n"
 	"this only when there seems to be a problem.\n")
 
-cfg(global_use_lvmpolld_CFG, "use_lvmpolld", global_CFG_SECTION, 0, CFG_TYPE_BOOL, 0, vsn(2, 2, 120), NULL, 0, NULL,
+cfg(global_use_lvmpolld_CFG, "use_lvmpolld", global_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_USE_LVMPOLLD, vsn(2, 2, 120), NULL, 0, NULL,
 	"Indicates whether to use lvmpolld instead of classical polldaemon (a process\n"
 	"forked off an initiating lvm command) or not. When set to 1 and native systemd\n"
 	"service is installed in the system lvm starts using lvmpolld. lvmpolld gets\n"
lib/misc/configure.h.in +6 -0
index 45a8462..f28cc79 100644
@@ -95,6 +95,12 @@
 /* Path to LVM system directory. */
 #undef DEFAULT_SYS_DIR
 
+/* Use lvmetad by default. */
+#undef DEFAULT_USE_LVMETAD
+
+/* Use lvmpolld by default. */
+#undef DEFAULT_USE_LVMPOLLD
+
 /* Define to 1 to enable LVM2 device-mapper interaction. */
 #undef DEVMAPPER_SUPPORT