All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Dario Faggioli <dario.faggioli@citrix.com>
Cc: xen-devel@lists.xenproject.org,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	Wei Liu <wei.liu2@citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH v3 5/6] xl: make return type of create_domain() more consistent.
Date: Fri, 8 Apr 2016 13:40:52 +0100	[thread overview]
Message-ID: <20160408124052.GE32191@citrix.com> (raw)
In-Reply-To: <20160408022407.9058.8250.stgit@Solace.fritz.box>

On Fri, Apr 08, 2016 at 04:24:07AM +0200, Dario Faggioli wrote:
> create_domain() is of uint32_t return type, because on
> success it returns the domid of the new domain, and
> uint32_t is what we typically use for domid-s.
> 
> However, on failure, it returns ERROR_FAIL or ERROR_INVAL,
> which are -3 and -6. Callers assign the return value to an
> 'int rc' variable and then check for '(rc < 0)'.
> 
> Although things work, and no tool (compiler, Coverity, ecc.)
> is complaining, using 'int' as return type seems better.
> 
> Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>

Acked-by: Wei Liu <wei.liu2@citrix.com>

> ---
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Wei Liu <wei.liu2@citrix.com>
> Cc: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
>  tools/libxl/xl_cmdimpl.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
> index 823cb46..d2ad8c8 100644
> --- a/tools/libxl/xl_cmdimpl.c
> +++ b/tools/libxl/xl_cmdimpl.c
> @@ -2777,7 +2777,7 @@ static void evdisable_disk_ejects(libxl_evgen_disk_eject **diskws,
>      }
>  }
>  
> -static uint32_t create_domain(struct domain_create *dom_info)
> +static int create_domain(struct domain_create *dom_info)
>  {
>      uint32_t domid = INVALID_DOMID;
>  
> 

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

  reply	other threads:[~2016-04-08 12:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-08  2:23 [PATCH v3 0/6] xl: convert exit codes related to domain subcommands to EXIT_[SUCCESS|FAILURE] Dario Faggioli
2016-04-08  2:23 ` [PATCH v3 1/6] xl: improve return and exit codes of memory related functions Dario Faggioli
2016-04-08  9:58   ` Dario Faggioli
2016-04-08 12:40     ` Wei Liu
2016-04-08  2:23 ` [PATCH v3 2/6] xl: improve exit codes of save/restore and migration functions Dario Faggioli
2016-04-08 12:40   ` Wei Liu
2016-04-08  2:23 ` [PATCH v3 3/6] xl: improve exit codes of some of the domain handling functions Dario Faggioli
2016-04-08 12:40   ` Wei Liu
2016-04-08  2:23 ` [PATCH v3 4/6] xl : improve exit codes of debug related functions Dario Faggioli
2016-04-08 12:40   ` Wei Liu
2016-04-08  2:24 ` [PATCH v3 5/6] xl: make return type of create_domain() more consistent Dario Faggioli
2016-04-08 12:40   ` Wei Liu [this message]
2016-04-08  2:24 ` [PATCH v3 6/6] xl: improve exit codes of domain creation related functions Dario Faggioli
2016-04-08 12:40   ` Wei Liu
2016-04-08 14:08 ` [PATCH v3 0/6] xl: convert exit codes related to domain subcommands to EXIT_[SUCCESS|FAILURE] Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160408124052.GE32191@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=dario.faggioli@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.