qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Roger Pau Monne <roger.pau@citrix.com>
To: qemu-devel@nongnu.org, xen-devel@lists.xenproject.org
Cc: Anthony Perard <anthony.perard@citrix.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: [Qemu-devel] [PATCH v2 1/3] xen: fix usage of ENODATA
Date: Fri, 23 May 2014 17:57:47 +0200	[thread overview]
Message-ID: <1400860669-21593-2-git-send-email-roger.pau@citrix.com> (raw)
In-Reply-To: <1400860669-21593-1-git-send-email-roger.pau@citrix.com>

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>
---
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(-)

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 != -ENODATA) {
+#ifndef ENODATA
+#define ENODATA  ENOENT
+#endif
+        if (errno == 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;
     }
-- 
1.7.7.5 (Apple Git-26)

  reply	other threads:[~2014-05-23 16:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-23 15:57 [Qemu-devel] [PATCH v2 0/3] qemu-freebsd: fixes for running Xen guests Roger Pau Monne
2014-05-23 15:57 ` Roger Pau Monne [this message]
2014-05-23 15:57 ` [Qemu-devel] [PATCH v2 2/3] tap-bsd: implement a FreeBSD only version of tap_open Roger Pau Monne
     [not found]   ` <20140527132943.GD31463@stefanha-thinkpad.redhat.com>
2014-07-22 11:46     ` Roger Pau Monné
2014-07-22 12:26       ` Stefano Stabellini
2014-07-23 10:38         ` Stefan Hajnoczi
2014-07-23 14:00         ` Roger Pau Monné
2014-07-23 14:03           ` Stefano Stabellini
2014-05-23 15:57 ` [Qemu-devel] [PATCH v2 3/3] serial: poll the serial console with G_IO_HUP Roger Pau Monne
2014-06-13 15:35   ` Roger Pau Monné
2014-06-30 11:00     ` Roger Pau Monné
2014-06-30 12:23       ` Paolo Bonzini

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=1400860669-21593-2-git-send-email-roger.pau@citrix.com \
    --to=roger.pau@citrix.com \
    --cc=anthony.perard@citrix.com \
    --cc=qemu-devel@nongnu.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).