From: Dario Faggioli <dario.faggioli@citrix.com>
To: Harmandeep Kaur <write.harmandeep@gmail.com>,
xen-devel@lists.xenproject.org
Cc: lars.kurth@citrix.com, wei.liu2@citrix.com,
ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com,
ian.jackson@eu.citrix.com, george.dunlap@citrix.com
Subject: Re: [PATCH v3 5/5] xl: improve return and exit codes of parse related functions
Date: Tue, 27 Oct 2015 12:41:15 +0100 [thread overview]
Message-ID: <1445946075.2937.111.camel@citrix.com> (raw)
In-Reply-To: <1445939452-8091-6-git-send-email-write.harmandeep@gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 2399 bytes --]
On Tue, 2015-10-27 at 15:20 +0530, Harmandeep Kaur wrote:
> Turning parsing related functions exit codes towards using the
> EXIT_[SUCCESS|FAILURE] constants, instead of instead of arbitrary
> numbers
> or libxl return codes.
> - for main_*: arbitrary -> EXIT_SUCCESS|EXIT_FAILURE.
> - for internal fucntion: arbitrary -> 0/1.
>
> Don't touch parse_config_data() which is big enough to deserve its
> own patch.
>
> Signed-off-by: Harmandeep Kaur <write.harmandeep@gmail.com>
> ---
> v2->v3: Reverted return of parse_mem_size_kb() to -1.
> And exculded out of scope changes.
>
There are a couple more of out of scope changes, though, at least
according to me. So, as Wei also said for patch 1, if you send v4 of
this series and, as far as this patch is concerned, you only...
> diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
> index 76d9af6..1ddf144 100644
> --- a/tools/libxl/xl_cmdimpl.c
> +++ b/tools/libxl/xl_cmdimpl.c
> @@ -3118,6 +3118,7 @@ void help(const char *command)
> }
> }
>
> +/* Function returns -1 if the parsing fails */
> static int64_t parse_mem_size_kb(const char *mem)
> {
> char *endptr;
> @@ -3264,7 +3265,7 @@ static int set_memory_max(uint32_t domid, const
> char *mem)
> memorykb = parse_mem_size_kb(mem);
> if (memorykb == -1) {
> fprintf(stderr, "invalid memory size: %s\n", mem);
> - exit(3);
> + exit(EXIT_FAILURE);
> }
>
> rc = libxl_domain_setmaxmem(ctx, domid, memorykb);
> @@ -3302,7 +3303,7 @@ static void set_memory_target(uint32_t domid,
> const char *mem)
> memorykb = parse_mem_size_kb(mem);
> if (memorykb == -1) {
> fprintf(stderr, "invalid memory size: %s\n", mem);
> - exit(3);
> + exit(EXIT_FAILURE);
> }
>
> libxl_set_memory_target(ctx, domid, memorykb, 0, /* enforce */
> 1);
>
... Leave these two functions alone (set_memory_max() and
set_memory_target()), then you can add the following tag to the
changelog:
Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
Thanks and Regards,
Dario
--
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
prev parent reply other threads:[~2015-10-27 11:41 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-27 9:50 [PATCH v3 0/5] xl: convert exit codes to EXIT_[SUCCESS|FAILURE] Harmandeep Kaur
2015-10-27 9:50 ` [PATCH v3 1/5] xl: convert main() " Harmandeep Kaur
2015-10-27 11:11 ` Wei Liu
2015-10-27 11:20 ` Dario Faggioli
2015-10-27 9:50 ` [PATCH v3 2/5] xl: improve return and exit codes of scheduling related functions Harmandeep Kaur
2015-10-27 11:25 ` Dario Faggioli
2015-10-27 9:50 ` [PATCH v3 3/5] xl: improve return and exit codes of vcpu " Harmandeep Kaur
2015-10-27 11:27 ` Dario Faggioli
2015-10-27 9:50 ` [PATCH v3 4/5] xl: improve return and exit codes of cpupool " Harmandeep Kaur
2015-10-27 11:29 ` Dario Faggioli
2015-10-27 9:50 ` [PATCH v3 5/5] xl: improve return and exit codes of parse " Harmandeep Kaur
2015-10-27 11:41 ` Dario Faggioli [this message]
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=1445946075.2937.111.camel@citrix.com \
--to=dario.faggioli@citrix.com \
--cc=george.dunlap@citrix.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=lars.kurth@citrix.com \
--cc=stefano.stabellini@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).