qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH RFC v4 2/6] qemu-iotests: qemu machine type supp


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH RFC v4 2/6] qemu-iotests: qemu machine type support
Date: Thu, 05 Feb 2015 10:57:39 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

On 02/05/2015 07:18 AM, Max Reitz wrote:
>> reference_machine="$source_iotests/$seq.$QEMU_DEFAULT_MACHINE.out"
>> +            if [ -f $reference_machine ]; then
> 
> Maybe this should be [ -f "$reference_machine" ]. I guess spaces in the
> directory name will break the qemu-iotests anyway, but there's no reason
> not to use quotes here.

Or, since the script explicitly required bash, use a bashism:

if [[ -f $reference_machine ]]; then

>> +export QEMU_DEFAULT_MACHINE=$($QEMU -machine ? | awk
>> '/(default)/{print $1}')
> 
> Interesting that "-machine ?" works. I would have expected it needed to
> be "-machine \?".

Correct, you need quoting here to avoid accidental globbing.

> 
> Apparently bash does not replace wildcard characters if there is no
> match (in contrast, zsh errors out in that case). Therefore, this only
> works as long as there is no single-character-named file in the
> directory where "check" is executed (test: "touch i; ./check").

bash and zsh chose different defaults, but both shells are configurable
in the other direction (you can tell zsh to turn off warnings; and
here's how to make bash balk at an unsuccessful glob: shopt -s failglob

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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