Re: [kvm-unit-tests PATCH] scripts/runtime: Replace "|&" with "2>&1 |"

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

 



On Fri, Jul 31, 2020 at 08:09:09AM +0200, Thomas Huth wrote:
> The "|&" only works with newer versions of the bash. For compatibility
> with older versions, we should use "2>&1 |" instead.

Hi Thomas,

Which bash version are you targeting with this change?

I think it's time we pick a bash version that we want to support
(thoroughly test all the scripts with it) and then document it. As
part of the CI we should test with both that version and with the
latest released version (394d1421 ("run_migration: Implement our own
wait") is an example of why only testing with our supported version
wouldn't be sufficient, unless we required everyone to use that
version when running the tests, and I don't want to do that.)

> 
> Signed-off-by: Thomas Huth <thuth@xxxxxxxxxx>
> ---
>  scripts/runtime.bash | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/scripts/runtime.bash b/scripts/runtime.bash
> index c88e246..35689a7 100644
> --- a/scripts/runtime.bash
> +++ b/scripts/runtime.bash
> @@ -172,7 +172,7 @@ function run()
>  # "arm/arm64: KVM: Remove 'config KVM_ARM_MAX_VCPUS'". So, at some
>  # point when maintaining the while loop gets too tiresome, we can
>  # just remove it...
> -while $RUNTIME_arch_run _NO_FILE_4Uhere_ -smp $MAX_SMP \
> -		|& grep -qi 'exceeds max CPUs'; do
> +while $RUNTIME_arch_run _NO_FILE_4Uhere_ -smp $MAX_SMP 2>&1 \
> +		| grep -qi 'exceeds max CPUs'; do
>  	MAX_SMP=$((MAX_SMP >> 1))
>  done
> -- 
> 2.18.1
>

Anyway
 
Reviewed-by: Andrew Jones <drjones@xxxxxxxxxx>




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux