Remove the progress-monitor-support flag
authorNikos Skalkotos <skalkoto@grnet.gr>
Fri, 11 May 2012 08:28:46 +0000 (11:28 +0300)
committerNikos Skalkotos <skalkoto@grnet.gr>
Fri, 11 May 2012 08:33:31 +0000 (11:33 +0300)
snf-image-host will make use the external progress monitor program
if the PROGRESS_MONITOR variable is not empty. This way progress
monitor can be enable or disabled by just overwriting the aforementioned
variable in the defaults file.

snf-image-host/Makefile.am
snf-image-host/common.sh.in
snf-image-host/configure.ac
snf-image-host/create
snf-image-host/defaults

index e59c6b2..ca5c8ec 100644 (file)
@@ -1,9 +1,3 @@
-if PROGMONSUPPORT
-progress_monitor_support=yes
-else
-progress_monitor_support=no
-endif
-
 if PITHOSIMGSUPPORT
 pithos_backend_support=yes
 else
index d6af96a..13381d3 100644 (file)
@@ -24,9 +24,8 @@ QEMU_IMG="qemu-img"
 INSTALL_MBR="install-mbr"
 TIMELIMIT="timelimit"
 CURL="curl"
-PROGRESS_MONITOR="snf-progress-monitor"
 
-progress_monitor_support="@progress_monitor_support@"
+
 pithos_backend_support="@pithos_backend_support@"
 network_backend_support="@network_backend_support@"
 
@@ -340,6 +339,7 @@ fi
 : ${HELPER_MIRROR:=""}
 : ${PITHOS_DB:="sqlite:////@localstatedir@/lib/pithos/backend.db"}
 : ${PITHOS_DATA:="@localstatedir@/lib/pithos/data/"}
+: ${PROGRESS_MONITOR:="@PROGRESS_MONITOR@"}
 
 SCRIPT_NAME=$(basename $0)
 
index a0ec48c..ef9b460 100644 (file)
@@ -27,20 +27,18 @@ AM_CONDITIONAL(NETWORKIMGSUPPORT, [test "x$enable_network_backend" = "xyes"])
 # --with-progress-monitor
 AC_ARG_WITH([progress-monitor],
   [AS_HELP_STRING([--with-progress-monitor=PRGRM_PATH],
-    [path to progress-monitor program]
-    [[snf-progress-monitor]])],
-    [if test "$withval" = "yes" ; then
-         AC_PATH_PROG(PROGRESS_MONITOR, [snf-progress-monitor], [], [$PATH:/usr/sbin:/sbin])
+    [path to progress-monitor program []])],
+    [if test "$withval" != "yes" -a "$withval" != "no"; then
+         AC_PATH_PROG(PROGRESS_MONITOR, ["$withval"], [], [$PATH:/usr/sbin:/sbin])
          if test -z "$PROGRESS_MONITOR" ; then
-             AC_MSG_FAILURE([Could not find snf-progress-monitor.])
+             AC_MSG_FAILURE([Could not find progress-monitor: $withval.])
          fi
-     else
          PROGRESS_MONITOR="$withval"
-    fi],
-   [AC_MSG_NOTICE(progress-monitor support not enabled)]
+     elif test "$withval" != "no"; then
+         AC_MSG_ERROR([you must specify a value for progress-monitor if --with-progress-monitor is specified])
+    fi]
 )
 
-AM_CONDITIONAL(PROGMONSUPPORT, [test -n "$PROGRESS_MONITOR"])
 
 # --with-helper-dir
 AC_ARG_WITH([helper-dir],
index 87c84fa..a052a78 100755 (executable)
@@ -46,8 +46,8 @@ case $BACKEND_TYPE in
         ;;
 esac
 
-monitor="" #Empty if progress monitor support is disabled
-if [ "$progress_monitor_support" = "yes" ]; then
+monitor="" # Empty if no progress monitor program is not defined.
+if [ -n "$PROGRESS_MONITOR" ]; then
     monitor="$PROGRESS_MONITOR \
         -i $(printf "%q" "$INSTANCE_NAME") -r $image_size"
 fi
index f6bebab..2efe6ea 100644 (file)
 # PITHOS_DATA: Directory where pithos data are hosted
 # PITHOS_DATA="/var/lib/pithos/data"
 
-# Paths for needed programs. Uncommend and change the variables below, if you
+# PROGRESS_MONITOR: External program that monitors the progress of the image
+# deployment. For now, this program is treated by snf-image as a decorator for
+# the raw copy command that copies the image file to the instance's hard disk.
+# This program must support the following options:
+#   -r, which specifies the expected number of bytes to be written to the disk.
+#   -i, which specifies the Ganeti instance name.
+# PROGRESS_MONITOR=""
+
+# Paths for needed programs. Uncommend and change the variables below if you
 # don't want to use the default one.
 # LOSETUP="losetup"
 # KPARTX="kpartx"
@@ -73,4 +81,3 @@
 # INSTALL_MBR="install-mbr"
 # TIMELIMIT="timelimit"
 # CURL="curl"
-# PROGRESS_MONITOR="snf-progress-monitor"