[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 20/21] iotests: Add "wait" functionality to _cleanup
From: |
Max Reitz |
Subject: |
[Qemu-devel] [PATCH 20/21] iotests: Add "wait" functionality to _cleanup_qemu |
Date: |
Mon, 26 Jan 2015 14:27:47 -0500 |
The qemu process does not always need to be killed, just waiting for it
can be fine, too. This introduces a way to do so.
Signed-off-by: Max Reitz <address@hidden>
---
tests/qemu-iotests/common.qemu | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/tests/qemu-iotests/common.qemu b/tests/qemu-iotests/common.qemu
index 8e618b5..4e1996c 100644
--- a/tests/qemu-iotests/common.qemu
+++ b/tests/qemu-iotests/common.qemu
@@ -187,13 +187,23 @@ function _launch_qemu()
# Silenty kills the QEMU process
+#
+# If $wait is set to anything other than the empty string, the process will not
+# be killed but only waited for, and any output will be forwarded to stdout. If
+# $wait is empty, the process will be killed and all output will be suppressed.
function _cleanup_qemu()
{
# QEMU_PID[], QEMU_IN[], QEMU_OUT[] all use same indices
for i in "address@hidden"
do
- kill -KILL ${QEMU_PID[$i]} 2>/dev/null
+ if [ -z "${wait}" ]; then
+ kill -KILL ${QEMU_PID[$i]} 2>/dev/null
+ fi
wait ${QEMU_PID[$i]} 2>/dev/null # silent kill
+ if [ -n "${wait}" ]; then
+ cat <&${QEMU_OUT[$i]} | _filter_testdir | _filter_qemu \
+ | _filter_qemu_io | _filter_qmp
+ fi
rm -f "${QEMU_FIFO_IN}_${i}" "${QEMU_FIFO_OUT}_${i}"
eval "exec ${QEMU_IN[$i]}<&-" # close file descriptors
eval "exec ${QEMU_OUT[$i]}<&-"
--
2.1.0
- [Qemu-devel] [PATCH 02/21] quorum: Fix close path, (continued)
- [Qemu-devel] [PATCH 02/21] quorum: Fix close path, Max Reitz, 2015/01/26
- [Qemu-devel] [PATCH 14/21] blockdev: Remove blk_hide_on_behalf_of_do_drive_del(), Max Reitz, 2015/01/26
- [Qemu-devel] [PATCH 16/21] block: Move some bdrv_*_all() functions to BB, Max Reitz, 2015/01/26
- [Qemu-devel] [PATCH 12/21] block: Use BlockBackend more, Max Reitz, 2015/01/26
- [Qemu-devel] [PATCH 15/21] block: Make bdrv_drain_one() public, Max Reitz, 2015/01/26
- [Qemu-devel] [PATCH 11/21] block: Add blk_commit_all() and blk_invalidate_cache_all(), Max Reitz, 2015/01/26
- [Qemu-devel] [PATCH 17/21] block: Remove bdrv_states, Max Reitz, 2015/01/26
- [Qemu-devel] [PATCH 13/21] blockdev: Add list of monitor-owned BlockBackends, Max Reitz, 2015/01/26
- [Qemu-devel] [PATCH 19/21] block: Strip down bdrv_close_all(), Max Reitz, 2015/01/26
- [Qemu-devel] [PATCH 18/21] blockdev: Keep track of monitor-owned BDS, Max Reitz, 2015/01/26
- [Qemu-devel] [PATCH 20/21] iotests: Add "wait" functionality to _cleanup_qemu,
Max Reitz <=
- [Qemu-devel] [PATCH 21/21] iotests: Add test for multiple BB on BDS tree, Max Reitz, 2015/01/26
- Re: [Qemu-devel] [PATCH 00/20] block: Rework bdrv_close_all(), Max Reitz, 2015/01/26