qemu-iotests: Allow starting new qemu after cleanup
authorKevin Wolf <kwolf@redhat.com>
Fri, 9 Jun 2017 11:32:48 +0000 (13:32 +0200)
committerKevin Wolf <kwolf@redhat.com>
Mon, 26 Jun 2017 12:51:12 +0000 (14:51 +0200)
After _cleanup_qemu(), test cases should be able to start the next qemu
process and call _cleanup_qemu() for that one as well. For this to work
cleanly, we need to improve the cleanup so that the second invocation
doesn't try to kill the qemu instances from the first invocation a
second time (which would result in error messages).

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
tests/qemu-iotests/common.qemu

index 7a78a0099959f93ad3d3386afec56345946ab617..76ef298d3f71753c9916702fc50a33b19fc7c16a 100644 (file)
@@ -222,5 +222,8 @@ function _cleanup_qemu()
         rm -f "${QEMU_FIFO_IN}_${i}" "${QEMU_FIFO_OUT}_${i}"
         eval "exec ${QEMU_IN[$i]}<&-"   # close file descriptors
         eval "exec ${QEMU_OUT[$i]}<&-"
+
+        unset QEMU_IN[$i]
+        unset QEMU_OUT[$i]
     done
 }