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

Re: [libvirt] [PATCH 3/4] vz: fix getJobResultHelper




On 26.05.2016 13:14, Maxim Nestratov wrote:
> when additional information is asked PrlJob_GetError an error
> PRL_ERR_NO_DATA should not be treated as error
> 
> Signed-off-by: Maxim Nestratov <mnestratov virtuozzo com>
> ---
>  src/vz/vz_sdk.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
> index 7fc7d97..bad4ddd 100644
> --- a/src/vz/vz_sdk.c
> +++ b/src/vz/vz_sdk.c
> @@ -162,7 +162,8 @@ getJobResultHelper(PRL_HANDLE job, unsigned int timeout, PRL_HANDLE *result,
>          PRL_HANDLE err_handle;
>  
>          /* Sometimes it's possible to get additional error info. */
> -        if ((ret = PrlJob_GetError(job, &err_handle))) {
> +        ret = PrlJob_GetError(job, &err_handle);
> +        if (ret && ret != PRL_ERR_NO_DATA) {
>              logPrlErrorHelper(ret, filename, funcname, linenr);
>              goto cleanup;
>          }
> 

I would log and return in case of PRL_ERR_NO_DATA or it is rather compilicated
to call logPrlEventErrorHelper only to return immediately.


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