diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/dpdk/Makefile | 4 | ||||
-rw-r--r-- | src/ovs/daemon.py | 17 | ||||
-rwxr-xr-x | src/qemu/Makefile | 8 |
3 files changed, 12 insertions, 17 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/ovs/daemon.py b/src/ovs/daemon.py index 089bc7a4..f9b037b2 100644 --- a/src/ovs/daemon.py +++ b/src/ovs/daemon.py @@ -38,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): @@ -55,7 +56,10 @@ class VSwitchd(tasks.Process): vswitchd_args = vswitchd_args or [] ovs_vswitchd_bin = os.path.join( settings.getValue('OVS_DIR'), 'vswitchd', 'ovs-vswitchd') - self._cmd = ['sudo', '-E', ovs_vswitchd_bin] + vswitchd_args + 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 @@ -77,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 @@ -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) |