Drop poll from Qemu

This commit is contained in:
Julien Duponchelle 2015-02-26 10:18:01 +01:00
parent 0eaad579c2
commit c07b8c746e

View File

@ -522,7 +522,7 @@ class QemuVM(BaseVM):
Stops the cpulimit process. Stops the cpulimit process.
""" """
if self._cpulimit_process and self._cpulimit_process.poll() is None: if self._cpulimit_process and self._cpulimit_process.returncode is None:
self._cpulimit_process.kill() self._cpulimit_process.kill()
try: try:
self._process.wait(3) self._process.wait(3)
@ -597,7 +597,7 @@ class QemuVM(BaseVM):
self._process.wait() self._process.wait()
except subprocess.TimeoutExpired: except subprocess.TimeoutExpired:
self._process.kill() self._process.kill()
if self._process.poll() is None: if self._process.returncode is None:
log.warn("QEMU VM instance {} PID={} is still running".format(self._id, log.warn("QEMU VM instance {} PID={} is still running".format(self._id,
self._process.pid)) self._process.pid))
self._process = None self._process = None