Revision b1fef76e

b/snf-image-host/Makefile.am
1
if PROGMONSUPPORT
2
progress_monitor_support=yes
3
else
4
progress_monitor_support=no
5
endif
6

  
7 1
if PITHOSIMGSUPPORT
8 2
pithos_backend_support=yes
9 3
else
b/snf-image-host/common.sh.in
24 24
INSTALL_MBR="install-mbr"
25 25
TIMELIMIT="timelimit"
26 26
CURL="curl"
27
PROGRESS_MONITOR="snf-progress-monitor"
28 27

  
29
progress_monitor_support="@progress_monitor_support@"
28

  
30 29
pithos_backend_support="@pithos_backend_support@"
31 30
network_backend_support="@network_backend_support@"
32 31

  
......
340 339
: ${HELPER_MIRROR:=""}
341 340
: ${PITHOS_DB:="sqlite:////@localstatedir@/lib/pithos/backend.db"}
342 341
: ${PITHOS_DATA:="@localstatedir@/lib/pithos/data/"}
342
: ${PROGRESS_MONITOR:="@PROGRESS_MONITOR@"}
343 343

  
344 344
SCRIPT_NAME=$(basename $0)
345 345

  
b/snf-image-host/configure.ac
27 27
# --with-progress-monitor
28 28
AC_ARG_WITH([progress-monitor],
29 29
  [AS_HELP_STRING([--with-progress-monitor=PRGRM_PATH],
30
    [path to progress-monitor program]
31
    [[snf-progress-monitor]])],
32
    [if test "$withval" = "yes" ; then
33
         AC_PATH_PROG(PROGRESS_MONITOR, [snf-progress-monitor], [], [$PATH:/usr/sbin:/sbin])
30
    [path to progress-monitor program []])],
31
    [if test "$withval" != "yes" -a "$withval" != "no"; then
32
         AC_PATH_PROG(PROGRESS_MONITOR, ["$withval"], [], [$PATH:/usr/sbin:/sbin])
34 33
         if test -z "$PROGRESS_MONITOR" ; then
35
             AC_MSG_FAILURE([Could not find snf-progress-monitor.])
34
             AC_MSG_FAILURE([Could not find progress-monitor: $withval.])
36 35
         fi
37
     else
38 36
         PROGRESS_MONITOR="$withval"
39
    fi],
40
   [AC_MSG_NOTICE(progress-monitor support not enabled)]
37
     elif test "$withval" != "no"; then
38
         AC_MSG_ERROR([you must specify a value for progress-monitor if --with-progress-monitor is specified])
39
    fi]
41 40
)
42 41

  
43
AM_CONDITIONAL(PROGMONSUPPORT, [test -n "$PROGRESS_MONITOR"])
44 42

  
45 43
# --with-helper-dir
46 44
AC_ARG_WITH([helper-dir],
b/snf-image-host/create
46 46
        ;;
47 47
esac
48 48

  
49
monitor="" #Empty if progress monitor support is disabled
50
if [ "$progress_monitor_support" = "yes" ]; then
49
monitor="" # Empty if no progress monitor program is not defined.
50
if [ -n "$PROGRESS_MONITOR" ]; then
51 51
    monitor="$PROGRESS_MONITOR \
52 52
        -i $(printf "%q" "$INSTANCE_NAME") -r $image_size"
53 53
fi
b/snf-image-host/defaults
64 64
# PITHOS_DATA: Directory where pithos data are hosted
65 65
# PITHOS_DATA="/var/lib/pithos/data"
66 66

  
67
# Paths for needed programs. Uncommend and change the variables below, if you
67
# PROGRESS_MONITOR: External program that monitors the progress of the image
68
# deployment. For now, this program is treated by snf-image as a decorator for
69
# the raw copy command that copies the image file to the instance's hard disk.
70
# This program must support the following options:
71
#   -r, which specifies the expected number of bytes to be written to the disk.
72
#   -i, which specifies the Ganeti instance name.
73
# PROGRESS_MONITOR=""
74

  
75
# Paths for needed programs. Uncommend and change the variables below if you
68 76
# don't want to use the default one.
69 77
# LOSETUP="losetup"
70 78
# KPARTX="kpartx"
......
73 81
# INSTALL_MBR="install-mbr"
74 82
# TIMELIMIT="timelimit"
75 83
# CURL="curl"
76
# PROGRESS_MONITOR="snf-progress-monitor"

Also available in: Unified diff