diff options
author | Eduardo Habkost <ehabkost@redhat.com> | 2017-05-26 15:11:59 -0300 |
---|---|---|
committer | Eduardo Habkost <ehabkost@redhat.com> | 2017-06-05 14:59:09 -0300 |
commit | b2b8d986753ceb20437457dfe51dd75285328373 (patch) | |
tree | e03b9de83722ee2ad030010e281fba06d4d2e243 | |
parent | 37bbcd575745d9bea4f840164e75dd2f40e5ee91 (diff) | |
download | qemu-b2b8d986753ceb20437457dfe51dd75285328373.zip qemu-b2b8d986753ceb20437457dfe51dd75285328373.tar.gz qemu-b2b8d986753ceb20437457dfe51dd75285328373.tar.bz2 |
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>
-rw-r--r-- | scripts/qemu.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/qemu.py b/scripts/qemu.py index 16934f1..880e3e8 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 |