summaryrefslogtreecommitdiff
path: root/scripts/qemu.py
diff options
context:
space:
mode:
authorFam Zheng <famz@redhat.com>2017-09-05 10:11:51 +0800
committerFam Zheng <famz@redhat.com>2017-09-22 10:46:25 +0800
commit22491a2f2ee75dbd68058abcb1ab9feee140ba50 (patch)
tree4c50527d649c76a378fb0c6f416f8d46a45bbba8 /scripts/qemu.py
parentb8bd2f598b7d8afa5413c36c77830c465a4c9034 (diff)
downloadqemu-22491a2f2ee75dbd68058abcb1ab9feee140ba50.tar.gz
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/qemu.py')
-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():