All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Egger, Christoph" <chegger@amazon.de>
To: Roger Pau Monne <roger.pau@citrix.com>,
	qemu-devel@nongnu.org, xen-devel@lists.xenproject.org
Cc: Anthony Perard <anthony.perard@citrix.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [PATCH 1/2] xen: fix usage of ENODATA
Date: Tue, 15 Apr 2014 14:33:58 +0200	[thread overview]
Message-ID: <534D2736.4020307@amazon.de> (raw)
In-Reply-To: <1397550789-43232-2-git-send-email-roger.pau@citrix.com>

On 15.04.14 10:33, Roger Pau Monne wrote:
> ENODATA doesn't exist on FreeBSD, so ENODATA errors returned by the
> hypervisor are translated to ENOENT.
> 
> Also, the error code is returned in errno if the call returns -1, so
> compare the error code with the value in errno instead of the value
> returned by the function.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> Cc: xen-devel@lists.xenproject.org
> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> Cc: Anthony Perard <anthony.perard@citrix.com>
> ---
>  xen-all.c |    8 ++++++--
>  1 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/xen-all.c b/xen-all.c
> index 0b4d934..4026b7b 100644
> --- a/xen-all.c
> +++ b/xen-all.c
> @@ -499,11 +499,15 @@ static void xen_sync_dirty_bitmap(XenIOState *state,
>                                   start_addr >> TARGET_PAGE_BITS, npages,
>                                   bitmap);
>      if (rc < 0) {
> -        if (rc != -ENODATA) {
> +#ifdef ENODATA
> +        if (errno == ENODATA) {
> +#else
> +        if (errno == ENOENT) {
> +#endif

This does not look good to me.
I suggest this:

#ifndef ENODATA
#define ENODATA  ENOENT
#endif

Christoph

>              memory_region_set_dirty(framebuffer, 0, size);
>              DPRINTF("xen: track_dirty_vram failed (0x" TARGET_FMT_plx
>                      ", 0x" TARGET_FMT_plx "): %s\n",
> -                    start_addr, start_addr + size, strerror(-rc));
> +                    start_addr, start_addr + size, strerror(errno));
>          }
>          return;
>      }
> 


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

  parent reply	other threads:[~2014-04-15 12:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1397550789-43232-1-git-send-email-roger.pau@citrix.com>
2014-04-15  8:33 ` [PATCH 1/2] xen: fix usage of ENODATA Roger Pau Monne
2014-04-15  8:33 ` [PATCH 2/2] tap-bsd: implement a FreeBSD only version of tap_open Roger Pau Monne
     [not found] ` <1397550789-43232-2-git-send-email-roger.pau@citrix.com>
2014-04-15 12:33   ` Egger, Christoph [this message]
2014-04-16 14:31     ` [PATCH 1/2] xen: fix usage of ENODATA Roger Pau Monné
2014-04-15 16:15   ` Anthony PERARD
2014-04-15 16:28     ` Roger Pau Monné
     [not found]     ` <534D5E24.7030508@citrix.com>
2014-04-15 16:45       ` Andrew Cooper

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=534D2736.4020307@amazon.de \
    --to=chegger@amazon.de \
    --cc=anthony.perard@citrix.com \
    --cc=qemu-devel@nongnu.org \
    --cc=roger.pau@citrix.com \
    --cc=stefano.stabellini@eu.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.