]> git.proxmox.com Git - mirror_qemu.git/commitdiff
qemu.py: Add "wait()" method
authorFam Zheng <famz@redhat.com>
Tue, 5 Sep 2017 02:11:51 +0000 (10:11 +0800)
committerFam Zheng <famz@redhat.com>
Fri, 22 Sep 2017 02:46:25 +0000 (10:46 +0800)
Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
scripts/qemu.py

index 5e02dd8e78775232abce925460de73bf7e6dae5a..2b5c2accb5d3706a13ac1ab1510b944cf4676c15 100644 (file)
@@ -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():