[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 1/2] xen: fix usage of ENODATA



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@xxxxxxxxxx>
> Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx
> Cc: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
> Cc: Anthony Perard <anthony.perard@xxxxxxxxxx>
> ---
>  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@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.