diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/dpdk/Makefile | 4 | ||||
-rw-r--r-- | src/dpdk/dpdk.py | 2 | ||||
-rw-r--r-- | src/ovs/daemon.py | 35 | ||||
-rwxr-xr-x | src/qemu/Makefile | 8 |
4 files changed, 22 insertions, 27 deletions
diff --git a/src/dpdk/Makefile b/src/dpdk/Makefile index 25ec3f12..e21e7999 100755 --- a/src/dpdk/Makefile +++ b/src/dpdk/Makefile @@ -29,7 +29,6 @@ ifndef VHOST_USER endif WORK_DIR = dpdk TAG_DONE_FLAG = $(WORK_DIR)/.$(DPDK_TAG).tag.done -DPDK_VANILLA = ../../src_vanilla/dpdk DPDK_CUSE = ../../src_cuse/dpdk # the name has been changed from version to version @@ -70,7 +69,6 @@ clean: $(AT)cd $(WORK_DIR) && git clean -xfd *.o clobber: $(AT)rm -rf $(WORK_DIR) - $(AT)rm -rf $(DPDK_VANILLA) $(AT)rm -rf $(DPDK_CUSE) # distclean is for developer who would like to keep the @@ -86,8 +84,6 @@ sanity: $(WORK_DIR): $(AT)git clone $(DPDK_URL) - $(AT)mkdir -p $(DPDK_VANILLA) - $(AT)cp -rf ./* $(DPDK_VANILLA) $(AT)mkdir -p $(DPDK_CUSE) $(AT)cp -rf ./* $(DPDK_CUSE) diff --git a/src/dpdk/dpdk.py b/src/dpdk/dpdk.py index 36f1d055..30f228f7 100644 --- a/src/dpdk/dpdk.py +++ b/src/dpdk/dpdk.py @@ -30,7 +30,7 @@ from tools.module_manager import ModuleManager _LOGGER = logging.getLogger(__name__) RTE_PCI_TOOL = os.path.join( - settings.getValue('RTE_SDK'), 'tools', 'dpdk_nic_bind.py') + settings.getValue('RTE_SDK_USER'), 'tools', 'dpdk_nic_bind.py') _DPDK_MODULE_MANAGER = ModuleManager() diff --git a/src/ovs/daemon.py b/src/ovs/daemon.py index 09735600..f9b037b2 100644 --- a/src/ovs/daemon.py +++ b/src/ovs/daemon.py @@ -24,13 +24,6 @@ import pexpect from conf import settings from tools import tasks -_OVS_VSWITCHD_BIN = os.path.join( - settings.getValue('OVS_DIR'), 'vswitchd', 'ovs-vswitchd') -_OVSDB_TOOL_BIN = os.path.join( - settings.getValue('OVS_DIR'), 'ovsdb', 'ovsdb-tool') -_OVSDB_SERVER_BIN = os.path.join( - settings.getValue('OVS_DIR'), 'ovsdb', 'ovsdb-server') - _OVS_VAR_DIR = settings.getValue('OVS_VAR_DIR') _OVS_ETC_DIR = settings.getValue('OVS_ETC_DIR') @@ -45,6 +38,7 @@ class VSwitchd(tasks.Process): _ovsdb_pid = None _logfile = _LOG_FILE_VSWITCHD _ovsdb_pidfile_path = os.path.join(settings.getValue('LOG_DIR'), "ovsdb_pidfile.pid") + _vswitchd_pidfile_path = os.path.join(settings.getValue('LOG_DIR'), "vswitchd_pidfile.pid") _proc_name = 'ovs-vswitchd' def __init__(self, timeout=30, vswitchd_args=None, expected_cmd=None): @@ -60,7 +54,12 @@ class VSwitchd(tasks.Process): self._timeout = timeout self._expect = expected_cmd vswitchd_args = vswitchd_args or [] - self._cmd = ['sudo', '-E', _OVS_VSWITCHD_BIN] + vswitchd_args + ovs_vswitchd_bin = os.path.join( + settings.getValue('OVS_DIR'), 'vswitchd', 'ovs-vswitchd') + sep = ['--'] if '--dpdk' in vswitchd_args else [] + self._cmd = ['sudo', '-E', ovs_vswitchd_bin] + vswitchd_args + sep + \ + ['--pidfile=' + self._vswitchd_pidfile_path, '--overwrite-pidfile', + '--log-file=' + self._logfile] # startup/shutdown @@ -82,15 +81,19 @@ class VSwitchd(tasks.Process): self._kill_ovsdb() raise exc - def kill(self, signal='-15', sleep=2): + def kill(self, signal='-15', sleep=10): """Kill ``ovs-vswitchd`` instance if it is alive. :returns: None """ self._logger.info('Killing ovs-vswitchd...') + with open(self._vswitchd_pidfile_path, "r") as pidfile: + vswitchd_pid = pidfile.read().strip() + tasks.terminate_task(vswitchd_pid, logger=self._logger) - self._kill_ovsdb() + self._kill_ovsdb() # ovsdb must be killed after vswitchd + # just for case, that sudo envelope has not terminated super(VSwitchd, self).kill(signal, sleep) # helper functions @@ -118,15 +121,20 @@ class VSwitchd(tasks.Process): :returns: None """ - tasks.run_task(['sudo', _OVSDB_TOOL_BIN, 'create', + ovsdb_tool_bin = os.path.join( + settings.getValue('OVS_DIR'), 'ovsdb', 'ovsdb-tool') + tasks.run_task(['sudo', ovsdb_tool_bin, 'create', os.path.join(_OVS_ETC_DIR, 'conf.db'), os.path.join(settings.getValue('OVS_DIR'), 'vswitchd', 'vswitch.ovsschema')], self._logger, 'Creating ovsdb configuration database...') + ovsdb_server_bin = os.path.join( + settings.getValue('OVS_DIR'), 'ovsdb', 'ovsdb-server') + tasks.run_background_task( - ['sudo', _OVSDB_SERVER_BIN, + ['sudo', ovsdb_server_bin, '--remote=punix:%s' % os.path.join(_OVS_VAR_DIR, 'db.sock'), '--remote=db:Open_vSwitch,Open_vSwitch,manager_options', '--pidfile=' + self._ovsdb_pidfile_path, '--overwrite-pidfile'], @@ -144,8 +152,7 @@ class VSwitchd(tasks.Process): self._logger.info("Killing ovsdb with pid: " + ovsdb_pid) if ovsdb_pid: - tasks.run_task(['sudo', 'kill', '-15', str(ovsdb_pid)], - self._logger, 'Killing ovsdb-server...') + tasks.terminate_task(ovsdb_pid, logger=self._logger) @staticmethod def get_db_sock_path(): diff --git a/src/qemu/Makefile b/src/qemu/Makefile index 4603b273..1bf8a8d0 100755 --- a/src/qemu/Makefile +++ b/src/qemu/Makefile @@ -28,8 +28,6 @@ INSTALL_TARGET = force_make force_install CONFIG_CMD = CONFIG_CMD += ./configure CONFIG_CMD += --target-list="x86_64-softmmu" -QEMU_VANILLA = ../../src_vanilla/qemu -QEMU_CUSE = ../../src_cuse/qemu all: force_make @@ -55,8 +53,6 @@ clean: $(AT)cd $(WORK_DIR) && git clean -xfd *.o clobber: $(AT)rm -rf $(WORK_DIR) - $(AT)rm -rf $(QEMU_VANILLA) - $(AT)rm -rf $(QEMU_CUSE) # distclean is for developer who would like to keep the # clone git repo, saving time to fetch again from url @@ -73,10 +69,6 @@ $(WORK_DIR)/configure: $(TAG_DONE_FLAG) $(WORK_DIR): $(AT)git clone $(QEMU_URL) - $(AT)mkdir -p $(QEMU_VANILLA) - $(AT)cp -rf ./* $(QEMU_VANILLA) - $(AT)mkdir -p $(QEMU_CUSE) - $(AT)cp -rf ./* $(QEMU_CUSE) $(TAG_DONE_FLAG): $(WORK_DIR) $(AT)cd $(WORK_DIR); git checkout $(QEMU_TAG) |