[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 10/13] iotests: Add @has_quit to vm.shutdown()
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 10/13] iotests: Add @has_quit to vm.shutdown() |
Date: |
Fri, 19 Jul 2019 15:43:42 +0200 |
From: Max Reitz <address@hidden>
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>
Signed-off-by: Kevin Wolf <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.20.1
- Re: [Qemu-block] [Qemu-devel] [PULL 01/13] iotests: Set read-zeroes on in null block driver for Valgrind, (continued)
[Qemu-block] [PULL 05/13] block: Make bdrv_parent_drained_[^_]*() static, Kevin Wolf, 2019/07/19
[Qemu-block] [PULL 06/13] tests: Lock AioContexts in test-block-iothread, Kevin Wolf, 2019/07/19
[Qemu-block] [PULL 07/13] block: Do not poll in bdrv_do_drained_end(), Kevin Wolf, 2019/07/19
[Qemu-block] [PULL 09/13] block: Loop unsafely in bdrv*drained_end(), Kevin Wolf, 2019/07/19
[Qemu-block] [PULL 08/13] tests: Extend commit by drained_end test, Kevin Wolf, 2019/07/19
[Qemu-block] [PULL 12/13] vl: Drain before (block) job cancel when quitting, Kevin Wolf, 2019/07/19
[Qemu-block] [PULL 10/13] iotests: Add @has_quit to vm.shutdown(),
Kevin Wolf <=
[Qemu-block] [PULL 11/13] iotests: Test commit with a filter on the chain, Kevin Wolf, 2019/07/19
[Qemu-block] [PULL 13/13] iotests: Test quitting with job on throttled node, Kevin Wolf, 2019/07/19
Re: [Qemu-block] [PULL 00/13] Block layer patches, Peter Maydell, 2019/07/22