qemu-devel
[Top][All Lists]
Advanced

[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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]