From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Stabellini Subject: Re: [PATCH v2 1/3] xen: fix usage of ENODATA Date: Tue, 27 May 2014 18:18:35 +0100 Message-ID: References: <1400860669-21593-1-git-send-email-roger.pau@citrix.com> <1400860669-21593-2-git-send-email-roger.pau@citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="1342847746-460967671-1401211115=:4779" Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WpL1m-0007Zs-Q7 for xen-devel@lists.xenproject.org; Tue, 27 May 2014 17:19:07 +0000 In-Reply-To: <1400860669-21593-2-git-send-email-roger.pau@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Roger Pau Monne Cc: Anthony Perard , xen-devel@lists.xenproject.org, qemu-devel@nongnu.org, Stefano Stabellini List-Id: xen-devel@lists.xenproject.org --1342847746-460967671-1401211115=:4779 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: QUOTED-PRINTABLE On Fri, 23 May 2014, Roger Pau Monne wrote: > ENODATA doesn't exist on FreeBSD, so ENODATA errors returned by the > hypervisor are translated to ENOENT. >=20 > 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. >=20 > Signed-off-by: Roger Pau Monn=C3=A9 > Cc: xen-devel@lists.xenproject.org > Cc: Stefano Stabellini > Cc: Anthony Perard > --- > Changes since v1: > - Define ENODATA to ENOENT for platforms that don't have ENODATA. > --- > xen-hvm.c | 7 +++++-- > 1 files changed, 5 insertions(+), 2 deletions(-) >=20 > diff --git a/xen-hvm.c b/xen-hvm.c > index a64486c..a414105 100644 > --- a/xen-hvm.c > +++ b/xen-hvm.c > @@ -499,11 +499,14 @@ static void xen_sync_dirty_bitmap(XenIOState *state= , > start_addr >> TARGET_PAGE_BITS, npages, > bitmap); > if (rc < 0) { > - if (rc !=3D -ENODATA) { > +#ifndef ENODATA > +#define ENODATA ENOENT > +#endif I wonder if it makes sense to have this in a more generic header, lile include/qemu/osdep.h? > + if (errno =3D=3D ENODATA) { > 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; > } > --=20 > 1.7.7.5 (Apple Git-26) >=20 --1342847746-460967671-1401211115=:4779 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --1342847746-460967671-1401211115=:4779--