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

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>
---
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

  parent reply	other threads:[~2016-04-08  2:24 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 ` Dario Faggioli [this message]
2016-04-08 12:40   ` [PATCH v3 5/6] xl: make return type of create_domain() more consistent Wei Liu
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=20160408022407.9058.8250.stgit@Solace.fritz.box \
    --to=dario.faggioli@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=wei.liu2@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).