summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorFam Zheng2017-09-05 04:11:51 +0200
committerFam Zheng2017-09-22 04:46:25 +0200
commit22491a2f2ee75dbd68058abcb1ab9feee140ba50 (patch)
tree4c50527d649c76a378fb0c6f416f8d46a45bbba8 /scripts
parentgitignore: Ignore vm test images (diff)
downloadqemu-22491a2f2ee75dbd68058abcb1ab9feee140ba50.tar.gz
qemu-22491a2f2ee75dbd68058abcb1ab9feee140ba50.tar.xz
qemu-22491a2f2ee75dbd68058abcb1ab9feee140ba50.zip
qemu.py: Add "wait()" method
Signed-off-by: Fam Zheng <famz@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/qemu.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/qemu.py b/scripts/qemu.py
index 5e02dd8e78..2b5c2accb5 100644
--- a/scripts/qemu.py
+++ b/scripts/qemu.py
@@ -215,6 +215,13 @@ class QEMUMachine(object):
LOG.debug('Output: %r', self._iolog)
raise
+ def wait(self):
+ '''Wait for the VM to power off'''
+ self._popen.wait()
+ self._qmp.close()
+ self._load_io_log()
+ self._post_shutdown()
+
def shutdown(self):
'''Terminate the VM and clean up'''
if self.is_running():