Commit 3536c792 authored by Iustin Pop's avatar Iustin Pop

Allow customisation of the disk index separator

As per issue 124, some Xen versions (or packaging) don't deal nicely
with the colon being part of a disk name. Therefore we add a
configure-time option for customising this.

Note: setting the separator to interesting values like / is not
handled by the code. This being a configure-time option (e.g. to be
set by distribution packagers), we assume the person building the code
knows what they are doing.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 9f37f689
......@@ -661,6 +661,7 @@ lib/_autoconf.py: Makefile vcs-version | lib/.dir
echo "CONFD_GROUP = '$(CONFD_GROUP)'"; \
echo "NODED_USER = '$(NODED_USER)'"; \
echo "VCS_VERSION = '$$VCSVER'"; \
echo "DISK_SEPARATOR = '$(DISK_SEPARATOR)'"; \
} > $@
$(REPLACE_VARS_SED): Makefile
......
......@@ -223,6 +223,15 @@ then
fi
AC_SUBST(SYSLOG_USAGE, $SYSLOG)
# --with-disk-separator=...
AC_ARG_WITH([disk-separator],
[AS_HELP_STRING([--with-disk-separator=STRING],
[Disk index separator, useful if the default of ':' is handled specially by the hypervisor]
)],
[disk_separator="$withval"],
[disk_separator=":"])
AC_SUBST(DISK_SEPARATOR, $disk_separator)
# Check common programs
AC_PROG_INSTALL
AC_PROG_LN_S
......
......@@ -941,8 +941,8 @@ def RunRenameInstance(instance, old_name, debug):
def _GetBlockDevSymlinkPath(instance_name, idx):
return utils.PathJoin(constants.DISK_LINKS_DIR,
"%s:%d" % (instance_name, idx))
return utils.PathJoin(constants.DISK_LINKS_DIR, "%s%s%d" %
(instance_name, constants.DISK_SEPARATOR, idx))
def _SymlinkBlockDev(instance_name, device_path, idx):
......
......@@ -488,6 +488,8 @@ DEFAULT_SHUTDOWN_TIMEOUT = 120
NODE_MAX_CLOCK_SKEW = 150
# Time for an intra-cluster disk transfer to wait for a connection
DISK_TRANSFER_CONNECT_TIMEOUT = 30
# Disk index separator
DISK_SEPARATOR = _autoconf.DISK_SEPARATOR
# runparts results
(RUNPARTS_SKIP,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment