提交 b2b8d986 编写于 作者: E Eduardo Habkost

qemu.py: Add QEMUMachine.exitcode() method

Allow the exit code of QEMU to be queried by scripts.
Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
Message-Id: <20170526181200.17227-3-ehabkost@redhat.com>
Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
上级 37bbcd57
......@@ -88,6 +88,11 @@ class QEMUMachine(object):
def is_running(self):
return self._popen and (self._popen.returncode is None)
def exitcode(self):
if self._popen is None:
return None
return self._popen.returncode
def get_pid(self):
if not self.is_running():
return None
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册