From: Ian Campbell <ian.campbell@citrix.com>
To: Wei Liu <wei.liu2@citrix.com>,
Xen-devel <xen-devel@lists.xenproject.org>
Cc: Dario Faggioli <dario.faggioli@citrix.com>,
Ian Jackson <ian.jackson@eu.citrix.com>,
Harmandeep Kaur <write.harmandeep@gmail.com>
Subject: Re: [PATCH] xl: don't print out uninitialised rc
Date: Wed, 4 Nov 2015 11:23:29 +0000 [thread overview]
Message-ID: <1446636209.6461.66.camel@citrix.com> (raw)
In-Reply-To: <1446635739-15430-1-git-send-email-wei.liu2@citrix.com>
On Wed, 2015-11-04 at 11:15 +0000, Wei Liu wrote:
> In 5b725e56 (xl: improve return and exit codes of vcpu related
> functions), the return value of libxl_cpu_bitmap_alloc was not stored in
> rc anymore. Yet the subsequent fprintf still used that.
>
> While it is trivial to reinstate the original implementation, xl's
> caller has no idea what a libxl error code is so printing out rc won't
> be that useful.
I don't buy this I'm afraid. xl prints the libxl error code in lots of
places and it is indeed useful for a person (e.g. a developer reading a bug
report) since they can go and look the number up.
I'm not sure where "xl's caller" comes into it, since this is only about
printing and not returning.
> Don't print out rc in that case.
>
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> ---
> Cc: Ian Campbell <ian.campbell@citrix.com>
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Dario Faggioli <dario.faggioli@citrix.com>
> Cc: Harmandeep Kaur <write.harmandeep@gmail.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 2756d2f..6056344 100644
> --- a/tools/libxl/xl_cmdimpl.c
> +++ b/tools/libxl/xl_cmdimpl.c
> @@ -5474,7 +5474,7 @@ static int vcpuset(uint32_t domid, const char*
> nr_vcpus, int check_host)
> return 1;
> }
> if (libxl_cpu_bitmap_alloc(ctx, &cpumap, max_vcpus)) {
> - fprintf(stderr, "libxl_cpu_bitmap_alloc failed, rc: %d\n", rc);
> + fprintf(stderr, "libxl_cpu_bitmap_alloc failed\n");
> return 1;
> }
> for (i = 0; i < max_vcpus; i++)
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2015-11-04 11:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-04 11:15 [PATCH] xl: don't print out uninitialised rc Wei Liu
2015-11-04 11:23 ` Ian Campbell [this message]
2015-11-04 11:25 ` Wei Liu
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=1446636209.6461.66.camel@citrix.com \
--to=ian.campbell@citrix.com \
--cc=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.