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>,
	Harmandeep Kaur <write.harmandeep@gmail.com>
Subject: [PATCH v3 4/6] xl : improve exit codes of debug related functions
Date: Fri, 08 Apr 2016 04:23:59 +0200	[thread overview]
Message-ID: <20160408022359.9058.49742.stgit@Solace.fritz.box> (raw)
In-Reply-To: <20160408022241.9058.86808.stgit@Solace.fritz.box>

From: Harmandeep Kaur <write.harmandeep@gmail.com>

by making them more consistent with other examples in xl.

Signed-off-by: Harmandeep Kaur <write.harmandeep@gmail.com>
Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
---
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
---
v3: Shorten changelog.

v2: Add main_sysrq(), main_debug_keys(), main_dmesg()
    Remove xvasprintf(), main_remus()
---
 tools/libxl/xl_cmdimpl.c |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 4a560d7..823cb46 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -5561,7 +5561,7 @@ static void button_press(uint32_t domid, const char *b)
         trigger = LIBXL_TRIGGER_SLEEP;
     } else {
         fprintf(stderr, "%s is an invalid button identifier\n", b);
-        exit(2);
+        exit(EXIT_FAILURE);
     }
 
     libxl_send_trigger(ctx, domid, trigger, 0);
@@ -7058,7 +7058,7 @@ int main_trigger(int argc, char **argv)
     trigger_name = argv[optind++];
     if (libxl_trigger_from_string(trigger_name, &trigger)) {
         fprintf(stderr, "Invalid trigger \"%s\"\n", trigger_name);
-        return -1;
+        return EXIT_FAILURE;
     }
 
     if (argv[optind]) {
@@ -7070,7 +7070,7 @@ int main_trigger(int argc, char **argv)
 
     libxl_send_trigger(ctx, domid, trigger, vcpuid);
 
-    return 0;
+    return EXIT_SUCCESS;
 }
 
 
@@ -7091,12 +7091,12 @@ int main_sysrq(int argc, char **argv)
     if (sysrq[1] != '\0') {
         fprintf(stderr, "Invalid sysrq.\n\n");
         help("sysrq");
-        return 1;
+        return EXIT_FAILURE;
     }
 
     libxl_send_sysrq(ctx, domid, sysrq[0]);
 
-    return 0;
+    return EXIT_SUCCESS;
 }
 
 int main_debug_keys(int argc, char **argv)
@@ -7112,10 +7112,10 @@ int main_debug_keys(int argc, char **argv)
 
     if (libxl_send_debug_keys(ctx, keys)) {
         fprintf(stderr, "cannot send debug keys: %s\n", keys);
-        return 1;
+        return EXIT_FAILURE;
     }
 
-    return 0;
+    return EXIT_SUCCESS;
 }
 
 int main_dmesg(int argc, char **argv)
@@ -7141,7 +7141,7 @@ int main_dmesg(int argc, char **argv)
 finish:
     if (cr)
         libxl_xen_console_read_finish(ctx, cr);
-    return ret;
+    return ret ? EXIT_FAILURE : EXIT_SUCCESS;
 }
 
 int main_top(int argc, char **argv)


_______________________________________________
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 ` Dario Faggioli [this message]
2016-04-08 12:40   ` [PATCH v3 4/6] xl : improve exit codes of debug related functions 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
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=20160408022359.9058.49742.stgit@Solace.fritz.box \
    --to=dario.faggioli@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=write.harmandeep@gmail.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).