All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	xen-devel@lists.xenproject.org, ian.jackson@eu.citrix.com,
	stefano.stabellini@eu.citrix.com, ian.campbell@citrix.com,
	wei.liu2@citrix.com
Subject: Re: [PATCH RFC 02/14] libxc: xc_core_arch_memory_map_get populate errno
Date: Fri, 13 Mar 2015 20:20:32 +0000	[thread overview]
Message-ID: <55034690.3070302@citrix.com> (raw)
In-Reply-To: <1426275083-8454-3-git-send-email-konrad.wilk@oracle.com>

On 13/03/15 19:31, Konrad Rzeszutek Wilk wrote:
> with proper value (ENOMEM) when reporting failures.
>
> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> ---
>  tools/libxc/xc_core_arm.c | 1 +
>  tools/libxc/xc_core_x86.c | 1 +
>  2 files changed, 2 insertions(+)
>
> diff --git a/tools/libxc/xc_core_arm.c b/tools/libxc/xc_core_arm.c
> index 16508e7..888a3ac 100644
> --- a/tools/libxc/xc_core_arm.c
> +++ b/tools/libxc/xc_core_arm.c
> @@ -55,6 +55,7 @@ xc_core_arch_memory_map_get(xc_interface *xch, struct xc_core_arch_context *unus
>      if ( map == NULL )
>      {
>          PERROR("Could not allocate memory");
> +        errno = ENOMEM;

PERROR catches and prints errno, so set ENOMEM before the PERROR() call
to correct the error message.

~Andrew

>          return -1;
>      }
>  
> diff --git a/tools/libxc/xc_core_x86.c b/tools/libxc/xc_core_x86.c
> index d8846f1..37b8522 100644
> --- a/tools/libxc/xc_core_x86.c
> +++ b/tools/libxc/xc_core_x86.c
> @@ -60,6 +60,7 @@ xc_core_arch_memory_map_get(xc_interface *xch, struct xc_core_arch_context *unus
>      if ( map == NULL )
>      {
>          PERROR("Could not allocate memory");
> +        errno = ENOMEM;
>          return -1;
>      }
>  

  reply	other threads:[~2015-03-13 20:20 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-13 19:31 [PATCH RFC v1] Fix up libxc errno and return mismatch Konrad Rzeszutek Wilk
2015-03-13 19:31 ` [PATCH RFC 01/14] libxc: Replaces tabs with spaces in xc_cpupool_freeinfo Konrad Rzeszutek Wilk
2015-03-13 19:31 ` [PATCH RFC 02/14] libxc: xc_core_arch_memory_map_get populate errno Konrad Rzeszutek Wilk
2015-03-13 20:20   ` Andrew Cooper [this message]
2015-03-13 20:34     ` Konrad Rzeszutek Wilk
2015-03-13 19:31 ` [PATCH RFC 03/14] libxc: Fix xc_domain_get_tsc_info returning -Exx instead of -1 Konrad Rzeszutek Wilk
2015-03-13 19:40   ` Konrad Rzeszutek Wilk
2015-03-14  7:55     ` Ian Campbell
2015-03-16 14:11       ` Konrad Rzeszutek Wilk
2015-03-16 14:23         ` Ian Campbell
2015-03-16 14:38           ` Konrad Rzeszutek Wilk
2015-03-16 14:57             ` Ian Campbell
2015-03-13 19:31 ` [PATCH RFC 04/14] libxl: xc_physdev_map return -1 and populate errno Konrad Rzeszutek Wilk
2015-03-13 19:31 ` [PATCH RFC 05/14] libxl: Return negative value and stash error in errno for xc_offline_page API Konrad Rzeszutek Wilk
2015-03-13 19:31 ` [PATCH RFC 06/14] libxl: Fix xc_pm API calls to return negative error and stash error in errno Konrad Rzeszutek Wilk
2015-03-13 19:31 ` [PATCH RFC 07/14] libxl: Fix xc_tmem_control to return proper error Konrad Rzeszutek Wilk
2015-03-13 19:31 ` [PATCH RFC 08/14] libxl: Check xc_domain_maximum_gpfn for negative return values Konrad Rzeszutek Wilk
2015-03-13 19:31 ` [PATCH RFC 09/14] libxl: Check xc_maximum_ram_page " Konrad Rzeszutek Wilk
2015-03-13 19:31 ` [PATCH RFC 10/14] libxl: If xc_domain_add_to_physmap fails, include errno value Konrad Rzeszutek Wilk
2015-03-13 19:31 ` [PATCH RFC 11/14] libxl: Print xc_domain_decrease_reservation proper " Konrad Rzeszutek Wilk
2015-03-13 19:31 ` [PATCH RFC 12/14] libxl: Check xc_sharing_* for proper return values Konrad Rzeszutek Wilk
2015-03-13 19:31 ` [PATCH RFC 13/14] libxl: Don't assign return value to errno for E820 get/set xc_ calls Konrad Rzeszutek Wilk
2015-03-13 19:31 ` [PATCH RFC 14/14] libxl: Fix do_memory_op to return negative value on errors Konrad Rzeszutek Wilk

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=55034690.3070302@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=konrad.wilk@oracle.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 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.