[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v5 05/10] qemu-iotests: change qemu pid and fd t
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v5 05/10] qemu-iotests: change qemu pid and fd tracking / cleanup |
Date: |
Wed, 18 Oct 2017 09:11:41 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 |
On 10/18/2017 08:59 AM, Jeff Cody wrote:
> On Tue, Oct 17, 2017 at 12:31:50PM -0400, Jeff Cody wrote:
>> So that later patches can cleanup running qemu processes called from
>> different subshells, track resources to cleanup in pid and fd list
>> files.
>>
>> In subsquent patches, ./check will kill all QEMU processes launched with
s/subsquent/subsequent/
>> the common.qemu framework, and the tests will not need to cleanup
>> manually (unless they want to do so as part of the test, e.g. wait for
>> a process to end such as migration).
>>
>> Signed-off-by: Jeff Cody <address@hidden>
>> ---
>> + # The FIFOs do not correspond to process entry in the pidlist, so
>> + # just clean them up afterwards
>> + while read fifo_name
>> + do
>> + # make sure entries are inside the $TEST_DIR
>> + fifo_path=$(dirname -z $(realpath "$fifo_name"))
>
> Pointing out another issue I noticed after testing on a different machine:
> in Bash > 4.4, this generates a warning, which breaks diff stats. The fix
> is to drop the '-z':
> fifo_path=$(dirname $(realpath "$fifo_name"))
That, and 'dirname -z' is GNU-specific. It is handy for getting the
name of a directory that ends in newline (yes, you are evil if you do
'mkdir $"abc\n"', because $(dirname "$dir") will strip that trailing
newline and likely trip up a poorly-written script to operate on 'abc'
instead). But as we already check for no whitespace in $TESTDIR, we
don't have to rely on -z to work around evil directories with a name
ending in newline.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH v5 00/10] qemu-iotests improvements, Jeff Cody, 2017/10/17
- [Qemu-devel] [PATCH v5 01/10] qemu-iotests: refuse to run if TEST_DIR contains spaces, Jeff Cody, 2017/10/17
- [Qemu-devel] [PATCH v5 02/10] qemu-iotests: set TEST_DIR to a unique dir for each test, Jeff Cody, 2017/10/17
- [Qemu-devel] [PATCH v5 03/10] qemu-iotests: automatically clean up bash protocol servers, Jeff Cody, 2017/10/17
- [Qemu-devel] [PATCH v5 05/10] qemu-iotests: change qemu pid and fd tracking / cleanup, Jeff Cody, 2017/10/17
- [Qemu-devel] [PATCH v5 06/10] qemu-iotests: make ./check automatically reap QEMU processes, Jeff Cody, 2017/10/17
- [Qemu-devel] [PATCH v5 07/10] qemu-iotests: run python tests in own subdirectories, Jeff Cody, 2017/10/17
- [Qemu-devel] [PATCH v5 09/10] qemu-iotests: add option to save temp files on error, Jeff Cody, 2017/10/17
- [Qemu-devel] [PATCH v5 04/10] qemu-iotests: remove file cleanup from bash tests, Jeff Cody, 2017/10/17
- [Qemu-devel] [PATCH v5 10/10] qemu-iotests: add support for running multi-threaded iotests, Jeff Cody, 2017/10/17