aboutsummaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2019-07-19 11:26:17 +0200
committerKevin Wolf <kwolf@redhat.com>2019-07-19 13:19:17 +0200
commit4687133b812323b743e490a21510a1e1ac0fb6df (patch)
tree0b60f087799cf87fcbbc5c7181984bd9772870f1 /python
parent61ad631cee21f878540681274fe0f53e7ee9f59e (diff)
downloadqemu-4687133b812323b743e490a21510a1e1ac0fb6df.zip
qemu-4687133b812323b743e490a21510a1e1ac0fb6df.tar.gz
qemu-4687133b812323b743e490a21510a1e1ac0fb6df.tar.bz2
iotests: Add @has_quit to vm.shutdown()
If a test has issued a quit command already (which may be useful to do explicitly because the test wants to show its effects), QEMUMachine.shutdown() should not do so again. Otherwise, the VM may well return an ECONNRESET which will lead QEMUMachine.shutdown() to killing it, which then turns into a "qemu received signal 9" line. Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'python')
-rw-r--r--python/qemu/machine.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/python/qemu/machine.py b/python/qemu/machine.py
index 49445e6..128a3d1 100644
--- a/python/qemu/machine.py
+++ b/python/qemu/machine.py
@@ -329,13 +329,14 @@ class QEMUMachine(object):
self._load_io_log()
self._post_shutdown()
- def shutdown(self):
+ def shutdown(self, has_quit=False):
"""
Terminate the VM and clean up
"""
if self.is_running():
try:
- self._qmp.cmd('quit')
+ if not has_quit:
+ self._qmp.cmd('quit')
self._qmp.close()
except:
self._popen.kill()