[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH v4 1/2] iotests: Use absolute paths for executab
From: |
Max Reitz |
Subject: |
Re: [Qemu-block] [PATCH v4 1/2] iotests: Use absolute paths for executables |
Date: |
Fri, 30 Jun 2017 04:46:59 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 |
On 2017-06-29 20:52, Eric Blake wrote:
> On 06/21/2017 08:30 AM, Max Reitz wrote:
>> A user may specify a relative path for accessing qemu, qemu-img, etc.
>> through environment variables ($QEMU_PROG and friends) or a symlink.
>>
>> If a test decides to change its working directory, relative paths will
>> cease to work, however. Work around this by making all of the paths to
>> programs that should undergo testing absolute. Besides "realpath", we
>> also have to use "which" to support programs in $PATH.
>
> Is this sentence stale...
Gnarf. Sure is, yes. Thanks for spotting!
>> As a side effect, this fixes specifying these programs as symlinks for
>> out-of-tree builds: Before, you would have to create two symlinks, one
>> in the build and one in the source tree (the first one for common.config
>> to find, the second one for the iotest to use). Now it is sufficient to
>> create one in the build tree because common.config will resolve it.
>>
>> Reported-by: Kevin Wolf <address@hidden>
>> Reviewed-by: Eric Blake <address@hidden>
>> Signed-off-by: Max Reitz <address@hidden>
>> ---
>> tests/qemu-iotests/common.config | 6 ++++++
>> 1 file changed, 6 insertions(+)
>>
>> diff --git a/tests/qemu-iotests/common.config
>> b/tests/qemu-iotests/common.config
>> index d1b45f5..c1dc425 100644
>> --- a/tests/qemu-iotests/common.config
>> +++ b/tests/qemu-iotests/common.config
>> @@ -103,6 +103,12 @@ if [ -z "$QEMU_VXHS_PROG" ]; then
>> export QEMU_VXHS_PROG="`set_prog_path qnio_server`"
>> fi
>>
>> +export QEMU_PROG=$(realpath -- "$(type -p "$QEMU_PROG")")
>
> ...now that you updated per my review to favor 'type' over 'which'?
> Otherwise, the R-b stands.
Thanks, will fix and apply then...
...and done, applied to my block branch:
https://github.com/XanClic/qemu/commits/block
Max
signature.asc
Description: OpenPGP digital signature