From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39618) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1diArB-0000at-AY for qemu-devel@nongnu.org; Wed, 16 Aug 2017 22:48:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1diAr8-0001f0-8H for qemu-devel@nongnu.org; Wed, 16 Aug 2017 22:48:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40934) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1diAr8-0001eu-26 for qemu-devel@nongnu.org; Wed, 16 Aug 2017 22:48:22 -0400 From: Fam Zheng Date: Thu, 17 Aug 2017 10:47:39 +0800 Message-Id: <20170817024746.5961-4-famz@redhat.com> In-Reply-To: <20170817024746.5961-1-famz@redhat.com> References: <20170817024746.5961-1-famz@redhat.com> Subject: [Qemu-devel] [PATCH RFC v2 03/10] qemu.py: Add "wait()" method List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: berrange@redhat.com, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Fam Zheng , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , pbonzini@redhat.com, stefanha@redhat.com, Cleber Rosa , Peter Maydell , eblake@redhat.com, Kamil Rytarowski Signed-off-by: Fam Zheng --- scripts/qemu.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/qemu.py b/scripts/qemu.py index e5f314efdb..20c9cd6139 100644 --- a/scripts/qemu.py +++ b/scripts/qemu.py @@ -144,6 +144,13 @@ class QEMUMachine(object): self._post_shutdown() 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(): -- 2.13.4