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 <jc...@redhat.com> >> --- >> + # 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