[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 09/10] iotests: Add @has_quit to vm.shutdown()
From: |
Max Reitz |
Subject: |
[Qemu-devel] [PATCH v3 09/10] iotests: Add @has_quit to vm.shutdown() |
Date: |
Fri, 19 Jul 2019 11:26:17 +0200 |
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 <address@hidden>
---
python/qemu/machine.py | 5 +++--
tests/qemu-iotests/255 | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/python/qemu/machine.py b/python/qemu/machine.py
index 49445e675b..128a3d1dc2 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()
diff --git a/tests/qemu-iotests/255 b/tests/qemu-iotests/255
index 49433ec122..3632d507d0 100755
--- a/tests/qemu-iotests/255
+++ b/tests/qemu-iotests/255
@@ -132,4 +132,4 @@ with iotests.FilePath('src.qcow2') as src_path, \
vm.qmp_log('block-job-cancel', device='job0')
vm.qmp_log('quit')
- vm.shutdown()
+ vm.shutdown(has_quit=True)
--
2.21.0
- [Qemu-devel] [PATCH v3 00/10] block: Delay poll when ending drained sections, Max Reitz, 2019/07/19
- [Qemu-devel] [PATCH v3 01/10] block: Introduce BdrvChild.parent_quiesce_counter, Max Reitz, 2019/07/19
- [Qemu-devel] [PATCH v3 02/10] tests: Add job commit by drained_end test, Max Reitz, 2019/07/19
- [Qemu-devel] [PATCH v3 03/10] block: Add @drained_end_counter, Max Reitz, 2019/07/19
- [Qemu-devel] [PATCH v3 04/10] block: Make bdrv_parent_drained_[^_]*() static, Max Reitz, 2019/07/19
- [Qemu-devel] [PATCH v3 05/10] tests: Lock AioContexts in test-block-iothread, Max Reitz, 2019/07/19
- [Qemu-devel] [PATCH v3 06/10] block: Do not poll in bdrv_do_drained_end(), Max Reitz, 2019/07/19
- [Qemu-devel] [PATCH v3 07/10] tests: Extend commit by drained_end test, Max Reitz, 2019/07/19
- [Qemu-devel] [PATCH v3 08/10] block: Loop unsafely in bdrv*drained_end(), Max Reitz, 2019/07/19
- [Qemu-devel] [PATCH v3 09/10] iotests: Add @has_quit to vm.shutdown(),
Max Reitz <=
- [Qemu-devel] [PATCH v3 10/10] iotests: Test commit with a filter on the chain, Max Reitz, 2019/07/19
- Re: [Qemu-devel] [PATCH v3 00/10] block: Delay poll when ending drained sections, Kevin Wolf, 2019/07/19