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>
This commit is contained in:
		@@ -215,6 +215,13 @@ class QEMUMachine(object):
 | 
				
			|||||||
                LOG.debug('Output: %r', self._iolog)
 | 
					                LOG.debug('Output: %r', self._iolog)
 | 
				
			||||||
            raise
 | 
					            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):
 | 
					    def shutdown(self):
 | 
				
			||||||
        '''Terminate the VM and clean up'''
 | 
					        '''Terminate the VM and clean up'''
 | 
				
			||||||
        if self.is_running():
 | 
					        if self.is_running():
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user