Catch exception when a process cannot be killed. Fixes #296.

This commit is contained in:
grossmj committed 2015-09-03 16:18:27 -06:00
1 parent eb5f9c48f2
commit fda33c56de
3 files changed
+14 -5

No files matched your search

+5 -2
View File
@@ -604,9 +604,12 @@ class QemuVM(BaseVM):
self._process.terminate()
self._process.wait()
except subprocess.TimeoutExpired:
self._process.kill()
try:
self._process.kill()
except OSError as e:
log.error("Cannot stop the Qemu process: {}".format(e))
if self._process.returncode is None:
log.warn('QEMU VM "{}" PID={} is still running'.format(self._name, self._process.pid))
log.warn('QEMU VM "{}" with PID={} is still running'.format(self._name, self._process.pid))
self._process = None
self._started = False
self._stop_cpulimit()