mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 14:53:54 -06:00
qemu.py: Add QEMUMachine.exitcode() method
Allow the exit code of QEMU to be queried by scripts. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Message-Id: <20170526181200.17227-3-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
parent
37bbcd5757
commit
b2b8d98675
1 changed files with 5 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue