Commit a8e8c0c6 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Make Xen config path a build-time option



Stop hardcoding the path in “hv_xen.py”.
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent df1d5c8f
...@@ -1381,6 +1381,7 @@ lib/_autoconf.py: Makefile | stamp-directories ...@@ -1381,6 +1381,7 @@ lib/_autoconf.py: Makefile | stamp-directories
echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \ echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
echo "ES_SEARCH_PATH = [$(ES_SEARCH_PATH)]"; \ echo "ES_SEARCH_PATH = [$(ES_SEARCH_PATH)]"; \
echo "XEN_BOOTLOADER = '$(XEN_BOOTLOADER)'"; \ echo "XEN_BOOTLOADER = '$(XEN_BOOTLOADER)'"; \
echo "XEN_CONFIG_DIR = '$(XEN_CONFIG_DIR)'"; \
echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \ echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
echo "XEN_INITRD = '$(XEN_INITRD)'"; \ echo "XEN_INITRD = '$(XEN_INITRD)'"; \
echo "KVM_KERNEL = '$(KVM_KERNEL)'"; \ echo "KVM_KERNEL = '$(KVM_KERNEL)'"; \
...@@ -1497,6 +1498,7 @@ $(REPLACE_VARS_SED): $(SHELL_ENV_INIT) Makefile stamp-directories ...@@ -1497,6 +1498,7 @@ $(REPLACE_VARS_SED): $(SHELL_ENV_INIT) Makefile stamp-directories
echo 's#@''GNTDAEMONSGROUP@#$(DAEMONS_GROUP)#g'; \ echo 's#@''GNTDAEMONSGROUP@#$(DAEMONS_GROUP)#g'; \
echo 's#@''CUSTOM_ENABLE_CONFD@#$(ENABLE_CONFD)#g'; \ echo 's#@''CUSTOM_ENABLE_CONFD@#$(ENABLE_CONFD)#g'; \
echo 's#@''MODULES@#$(strip $(lint_python_code))#g'; \ echo 's#@''MODULES@#$(strip $(lint_python_code))#g'; \
echo 's#@''XEN_CONFIG_DIR@#$(XEN_CONFIG_DIR)#g'; \
echo; \ echo; \
echo '/^@SHELL_ENV_INIT@$$/ {'; \ echo '/^@SHELL_ENV_INIT@$$/ {'; \
echo ' r $(SHELL_ENV_INIT)'; \ echo ' r $(SHELL_ENV_INIT)'; \
......
...@@ -49,6 +49,15 @@ AC_ARG_WITH([ssh-config-dir], ...@@ -49,6 +49,15 @@ AC_ARG_WITH([ssh-config-dir],
[ssh_config_dir="/etc/ssh"]) [ssh_config_dir="/etc/ssh"])
AC_SUBST(SSH_CONFIG_DIR, $ssh_config_dir) AC_SUBST(SSH_CONFIG_DIR, $ssh_config_dir)
# --with-xen-config-dir=...
AC_ARG_WITH([xen-config-dir],
[AS_HELP_STRING([--with-xen-config-dir=DIR],
m4_normalize([Xen configuration directory
(default: /etc/xen)]))],
[xen_config_dir="$withval"],
[xen_config_dir=/etc/xen])
AC_SUBST(XEN_CONFIG_DIR, $xen_config_dir)
# --with-os-search-path=... # --with-os-search-path=...
# do a bit of black sed magic to for quoting of the strings in the list # do a bit of black sed magic to for quoting of the strings in the list
AC_ARG_WITH([os-search-path], AC_ARG_WITH([os-search-path],
......
...@@ -33,13 +33,13 @@ from ganeti.hypervisor import hv_base ...@@ -33,13 +33,13 @@ from ganeti.hypervisor import hv_base
from ganeti import netutils from ganeti import netutils
from ganeti import objects from ganeti import objects
from ganeti import pathutils from ganeti import pathutils
from ganeti import vcluster
from ganeti import ssconf from ganeti import ssconf
XEND_CONFIG_FILE = vcluster.AddNodePrefix("/etc/xen/xend-config.sxp") XEND_CONFIG_FILE = utils.PathJoin(pathutils.XEN_CONFIG_DIR, "xend-config.sxp")
XL_CONFIG_FILE = vcluster.AddNodePrefix("/etc/xen/xl.conf") XL_CONFIG_FILE = utils.PathJoin(pathutils.XEN_CONFIG_DIR, "xen/xl.conf")
VIF_BRIDGE_SCRIPT = vcluster.AddNodePrefix("/etc/xen/scripts/vif-bridge") VIF_BRIDGE_SCRIPT = utils.PathJoin(pathutils.XEN_CONFIG_DIR,
"scripts/vif-bridge")
_DOM0_NAME = "Domain-0" _DOM0_NAME = "Domain-0"
...@@ -73,7 +73,7 @@ class XenHypervisor(hv_base.BaseHypervisor): ...@@ -73,7 +73,7 @@ class XenHypervisor(hv_base.BaseHypervisor):
@rtype: str @rtype: str
""" """
return "/etc/xen/%s" % instance_name return utils.PathJoin(pathutils.XEN_CONFIG_DIR, instance_name)
@classmethod @classmethod
def _WriteConfigFile(cls, instance, startup_memory, block_devices): def _WriteConfigFile(cls, instance, startup_memory, block_devices):
...@@ -90,7 +90,9 @@ class XenHypervisor(hv_base.BaseHypervisor): ...@@ -90,7 +90,9 @@ class XenHypervisor(hv_base.BaseHypervisor):
""" """
# just in case it exists # just in case it exists
utils.RemoveFile("/etc/xen/auto/%s" % instance_name) utils.RemoveFile(utils.PathJoin(pathutils.XEN_CONFIG_DIR, "auto",
instance_name))
cfg_file = XenHypervisor._ConfigFileName(instance_name) cfg_file = XenHypervisor._ConfigFileName(instance_name)
try: try:
utils.WriteFile(cfg_file, data=data) utils.WriteFile(cfg_file, data=data)
......
...@@ -36,6 +36,7 @@ EXPORT_DIR = vcluster.AddNodePrefix(_autoconf.EXPORT_DIR) ...@@ -36,6 +36,7 @@ EXPORT_DIR = vcluster.AddNodePrefix(_autoconf.EXPORT_DIR)
OS_SEARCH_PATH = _autoconf.OS_SEARCH_PATH OS_SEARCH_PATH = _autoconf.OS_SEARCH_PATH
ES_SEARCH_PATH = _autoconf.ES_SEARCH_PATH ES_SEARCH_PATH = _autoconf.ES_SEARCH_PATH
SSH_CONFIG_DIR = _autoconf.SSH_CONFIG_DIR SSH_CONFIG_DIR = _autoconf.SSH_CONFIG_DIR
XEN_CONFIG_DIR = vcluster.AddNodePrefix(_autoconf.XEN_CONFIG_DIR)
SYSCONFDIR = vcluster.AddNodePrefix(_autoconf.SYSCONFDIR) SYSCONFDIR = vcluster.AddNodePrefix(_autoconf.SYSCONFDIR)
TOOLSDIR = _autoconf.TOOLSDIR TOOLSDIR = _autoconf.TOOLSDIR
LOCALSTATEDIR = vcluster.AddNodePrefix(_autoconf.LOCALSTATEDIR) LOCALSTATEDIR = vcluster.AddNodePrefix(_autoconf.LOCALSTATEDIR)
......
...@@ -302,7 +302,7 @@ migration\_port ...@@ -302,7 +302,7 @@ migration\_port
This options specifies the TCP port to use for live-migration. For This options specifies the TCP port to use for live-migration. For
Xen, the same port should be configured on all nodes in the Xen, the same port should be configured on all nodes in the
``/etc/xen/xend-config.sxp`` file, under the key ``@XEN_CONFIG_DIR@/xend-config.sxp`` file, under the key
"xend-relocation-port". "xend-relocation-port".
migration\_bandwidth migration\_bandwidth
......
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