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

Re: [Xen-devel] [PATCH 2/9] xl: Improve return and exit codes of restore and save related functions.



On Wed, 2016-02-24 at 18:23 +0530, Harmandeep Kaur wrote:
> Signed-off-by: Harmandeep Kaur <write.harmandeep@xxxxxxxxx>
> ---
>  tools/libxl/xl_cmdimpl.c | 40 ++++++++++++++++++++----------------
> ----
>  1 file changed, 20 insertions(+), 20 deletions(-)
> 
> diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
> index 8f5a2f4..e5bb41f 100644
> --- a/tools/libxl/xl_cmdimpl.c
> +++ b/tools/libxl/xl_cmdimpl.c
> @@ -2708,11 +2708,11 @@ static uint32_t create_domain(struct
> domain_create *dom_info)
>              restore_fd = open(restore_file, O_RDONLY);
>              if (restore_fd == -1) {
>                  fprintf(stderr, "Can't open restore file: %s\n",
> strerror(errno));
> -                return ERROR_INVAL;
> +                return -1;
>              }
Ah, so here it is create_domain(). Mmm... no, I think it would be best
to have it changed in the other patch where I mentioned it, together
with the other domain creation related functions.

That being said, the way in which the function is changed looks ok to
me. Only one comment about this hunk:

> @@ -3091,9 +3091,9 @@ out:
>       * already happened in the parent.
>       */
>      if ( daemonize && !need_daemon )
> -        exit(ret);
> +        exit(EXIT_SUCCESS);
>  
> -    return ret;
> +    return ret < 0 ? -1 : 0;
>
The ret<0 part was thre because libxl error codes where used... now
that we're not using them any longer, can we just initialize ret to 0,
change it to -1 on error (like you're doing) and, here, just return it.

Regards,
Dario
-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.