aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2017-05-26 15:11:59 -0300
committerEduardo Habkost <ehabkost@redhat.com>2017-06-05 14:59:09 -0300
commitb2b8d986753ceb20437457dfe51dd75285328373 (patch)
treee03b9de83722ee2ad030010e281fba06d4d2e243 /scripts
parent37bbcd575745d9bea4f840164e75dd2f40e5ee91 (diff)
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>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/qemu.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/qemu.py b/scripts/qemu.py
index 16934f1e02..880e3e8219 100644
--- a/scripts/qemu.py
+++ b/scripts/qemu.py
@@ -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