From patchwork Tue Mar 8 19:02:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harmandeep Kaur X-Patchwork-Id: 8536781 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 60EBA9F8A8 for ; Tue, 8 Mar 2016 19:05:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 899DE201FE for ; Tue, 8 Mar 2016 19:05:28 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ABEA020155 for ; Tue, 8 Mar 2016 19:05:27 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xen.org with esmtp (Exim 4.84) (envelope-from ) id 1adMuC-0000rj-PW; Tue, 08 Mar 2016 19:02:52 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.84) (envelope-from ) id 1adMuC-0000rP-7x for xen-devel@lists.xenproject.org; Tue, 08 Mar 2016 19:02:52 +0000 Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id D1/8B-03306-BD12FD65; Tue, 08 Mar 2016 19:02:51 +0000 X-Env-Sender: write.harmandeep@gmail.com X-Msg-Ref: server-7.tower-31.messagelabs.com!1457463770!20296695!1 X-Originating-IP: [74.125.82.68] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.11; banners=-,-,- X-VirusChecked: Checked Received: (qmail 27216 invoked from network); 8 Mar 2016 19:02:50 -0000 Received: from mail-wm0-f68.google.com (HELO mail-wm0-f68.google.com) (74.125.82.68) by server-7.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 8 Mar 2016 19:02:50 -0000 Received: by mail-wm0-f68.google.com with SMTP id n186so5919978wmn.0 for ; Tue, 08 Mar 2016 11:02:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=1Z0ac18VdKXycUK7gLmRzX3TnyGd0CYioVw/PYf3l84=; b=A9qRYUWsIP4ZjdGktG9PzMskrFRiJerCvXtYDwvadM2t7cyBP6oAe0yiNDk0VbqJuM i/Saq2QZIIZa49xp5ULNV/92guADvDXjwpoufkIMfiFmkZu3reVbDZUlhLucQQkMU7TC gcqxf3j+v9taWY1MlSCaMV+jLlAnzJ/2rjA9Jy3rILV2xVHt0PCN2vjw8N10KfERWhbs sqJpgYN/MSD1elMsWOmtly4ANoynISwki+BchhigJcbd1kSS7GGGcL2OaS0VBN31f4iQ 0XU/KC7OqxBu60NHBqGS6qNYUatYrhkc96SbZaSSzNZp4gyyZ+dqwlUrMI/o11HGvSub 4C4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=1Z0ac18VdKXycUK7gLmRzX3TnyGd0CYioVw/PYf3l84=; b=mg3TBKD4vw+kcl+bYtAJ7w0rcxUJTxaSPyZBg+FWkPC4Sd+Br5uCq5mT/VqnlXasj4 9ePkO0v4CZIvhLR7dmPcfvKVIYz3Xmoi9srI4B6pt6qLKNeWRi8ku9h6Awk1zTpSEJZt NwP1d6L7DCAG/ovXlLmOuFub73VUEV0bIJXEhPfavE7jBO+N0K0Dgcxceq8Nyik+tQwx 1WsPz7/CSZPuAH2O3TmuG73FFVKLKasZTso+0SWMXwt3wParbIox8j0JtPRdVPc2Bf4W +4OJ7ohU8j0gkPVyVxAJytiWBPgmHS2JH1wWm22UplXwBb1z2wN8eEkE1A2gyolidYN6 6+7g== X-Gm-Message-State: AD7BkJKoZg+F2QWvoiPWgRaJ1BUKKauWASg+Elr+eK1u++y8CDvltF/F96myJQBEvDB55A== X-Received: by 10.194.238.34 with SMTP id vh2mr35703101wjc.157.1457463770733; Tue, 08 Mar 2016 11:02:50 -0800 (PST) Received: from localhost.localdomain ([124.253.57.150]) by smtp.googlemail.com with ESMTPSA id hu1sm4310795wjb.36.2016.03.08.11.02.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 08 Mar 2016 11:02:50 -0800 (PST) From: Harmandeep Kaur To: xen-devel@lists.xenproject.org Date: Wed, 9 Mar 2016 00:32:05 +0530 Message-Id: <1457463730-4712-5-git-send-email-write.harmandeep@gmail.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1457463730-4712-1-git-send-email-write.harmandeep@gmail.com> References: <1457463730-4712-1-git-send-email-write.harmandeep@gmail.com> 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 Subject: [Xen-devel] [PATCH 4/9 v2] xl: Improve return and exit codes of console, vnc and core dump related functions. X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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)