xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Harmandeep Kaur <write.harmandeep@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: wei.liu2@citrix.com, ian.campbell@citrix.com,
	stefano.stabellini@eu.citrix.com, dario.faggioli@citrix.com,
	ian.jackson@eu.citrix.com,
	Harmandeep Kaur <write.harmandeep@gmail.com>
Subject: [PATCH 4/9 v2] xl: Improve return and exit codes of console, vnc and core dump related functions.
Date: Wed,  9 Mar 2016 00:32:05 +0530	[thread overview]
Message-ID: <1457463730-4712-5-git-send-email-write.harmandeep@gmail.com> (raw)
In-Reply-To: <1457463730-4712-1-git-send-email-write.harmandeep@gmail.com>

autoconnect_vncviewer(), main_console(), main_vncviewer(),
core_dump_domain() and main_dump_core() in the file
xl_cmdimpl are fixed.

Signed-off-by: Harmandeep Kaur <write.harmandeep@gmail.com>
---
v2: Add autoconnect_vncviewer().
---
 tools/libxl/xl_cmdimpl.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 9ec3b2a..5cedfe8 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -219,7 +219,7 @@ static void autoconnect_vncviewer(uint32_t domid, int autopass)
 
     sleep(1);
     vncviewer(domid, autopass);
-    _exit(1);
+    _exit(EXIT_FAILURE);
 }
 
 static int acquire_lock(void)
@@ -3430,7 +3430,7 @@ int main_console(int argc, char **argv)
             type = LIBXL_CONSOLE_TYPE_SERIAL;
         else {
             fprintf(stderr, "console type supported are: pv, serial\n");
-            return 2;
+            return EXIT_FAILURE;
         }
         break;
     case 'n':
@@ -3444,7 +3444,7 @@ int main_console(int argc, char **argv)
     else
         libxl_console_exec(ctx, domid, num, type);
     fprintf(stderr, "Unable to attach console\n");
-    return 1;
+    return EXIT_FAILURE;
 }
 
 int main_vncviewer(int argc, char **argv)
@@ -3466,8 +3466,8 @@ int main_vncviewer(int argc, char **argv)
     domid = find_domain(argv[optind]);
 
     if (vncviewer(domid, autopass))
-        return 1;
-    return 0;
+        return EXIT_FAILURE;
+    return EXIT_SUCCESS;
 }
 
 static void pcilist(uint32_t domid)
@@ -4022,7 +4022,7 @@ static void core_dump_domain(uint32_t domid, const char *filename)
     int rc;
 
     rc=libxl_domain_core_dump(ctx, domid, filename, NULL);
-    if (rc) { fprintf(stderr,"core dump failed (rc=%d)\n",rc);exit(-1); }
+    if (rc) { fprintf(stderr,"core dump failed (rc=%d)\n",rc);exit(EXIT_FAILURE); }
 }
 
 #ifndef LIBXL_HAVE_NO_SUSPEND_RESUME
@@ -4789,7 +4789,7 @@ int main_dump_core(int argc, char **argv)
     }
 
     core_dump_domain(find_domain(argv[optind]), argv[optind + 1]);
-    return 0;
+    return EXIT_SUCCESS;
 }
 
 int main_pause(int argc, char **argv)
-- 
2.5.0


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

  parent reply	other threads:[~2016-03-08 19:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-08 19:02 [PATCH 0/9 v2] xl: convert exit codes related to domain subcommands to EXIT_[SUCCESS|FAILURE] Harmandeep Kaur
2016-03-08 19:02 ` [PATCH 1/9 v2] xl: Improve return and exit codes of memory related functions Harmandeep Kaur
2016-03-08 19:02 ` [PATCH 2/9 v2] xl: Improve return and exit codes of restore and save " Harmandeep Kaur
2016-03-08 19:02 ` [PATCH 3/9 v2] xl: Improve return and exit codes of migrate " Harmandeep Kaur
2016-03-08 19:02 ` Harmandeep Kaur [this message]
2016-03-08 19:02 ` [PATCH 5/9 v2] xl: Improve return and exit codes of pause, destroy and shutdown " Harmandeep Kaur
2016-03-08 19:02 ` [PATCH 6/9 v2] xl: Improve return and exit codes of list " Harmandeep Kaur
2016-03-08 19:02 ` [PATCH 7/9 v2] xl: Improve return and exit codes of create, config_update and rename " Harmandeep Kaur
2016-03-08 19:02 ` [PATCH 8/9 v2] xl : Improve return and exit codes debugging, special keys and triggering " Harmandeep Kaur
2016-03-08 19:02 ` [PATCH 9/9 v2] xl: Improve return and exit codes of domain id and name " Harmandeep Kaur

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=1457463730-4712-5-git-send-email-write.harmandeep@gmail.com \
    --to=write.harmandeep@gmail.com \
    --cc=dario.faggioli@citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=stefano.stabellini@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).