From 22491a2f2ee75dbd68058abcb1ab9feee140ba50 Mon Sep 17 00:00:00 2001 From: Fam Zheng Date: Tue, 5 Sep 2017 10:11:51 +0800 Subject: qemu.py: Add "wait()" method MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fam Zheng Reviewed-by: Stefan Hajnoczi Reviewed-by: Alex Bennée --- scripts/qemu.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'scripts/qemu.py') 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(): -- cgit v1.2.1