Le 11/09/2019 à 05:31, Mao Zhongyi a écrit :
> if stress function always return 0, the path
> 'if (stress(ramsizeGB, ncpus) < 0)' is nerver unreachable,
> so fix it to allow the test failed.
> 
> Cc: arm...@redhat.com
> Cc: laur...@vivier.eu
> Cc: tony.ngu...@bt.com
> 
> Signed-off-by: Mao Zhongyi <maozhon...@cmss.chinamobile.com>
> ---
>  tests/migration/stress.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/migration/stress.c b/tests/migration/stress.c
> index 19a6eff5fd..35903d90c4 100644
> --- a/tests/migration/stress.c
> +++ b/tests/migration/stress.c
> @@ -224,6 +224,7 @@ static int stressone(unsigned long long ramsizeMB)
>              }
>          }
>      }
> +    return 0;
>  }

before the return, we have an infinite loop "while(1) { }".

So this part is dead code.

In fact, if the function exits, it's because it fails, otherwise it
loops infinitely, so I think we should change its type to void and
stress should always return -1.

Thanks,
Laurent

Reply via email to