[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 02/65] iotests: Add "wait" functionality to _clean
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PULL v2 02/65] iotests: Add "wait" functionality to _cleanup_qemu |
Date: |
Mon, 16 Feb 2015 15:45:27 +0000 |
From: Max Reitz <address@hidden>
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>
Reviewed-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <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] [PULL v2 00/65] Block patches, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 03/65] iotests: Add test for drive-mirror with NBD target, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 01/65] nbd: Drop BDS backpointer, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 04/65] libqos: Split apart pc_alloc_init, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 02/65] iotests: Add "wait" functionality to _cleanup_qemu,
Stefan Hajnoczi <=
- [Qemu-devel] [PULL v2 06/65] libqos: create libqos.c, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 08/65] libqos: add alloc_init_flags, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 07/65] libqos: add qtest_vboot, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 05/65] qtest/ahci: Create ahci.h, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 09/65] libqos: Update QGuestAllocator to be opaque, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 10/65] libqos: add pc specific interface, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 12/65] qtest/ahci: finalize AHCIQState consolidation, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 15/65] libqos/ahci: Functional register helpers, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 11/65] qtest/ahci: Store hba_base in AHCIQState, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 13/65] qtest/ahci: remove pcibus global, Stefan Hajnoczi, 2015/02/16