From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: peter.maydell@linaro.org
Cc: xen-devel@lists.xensource.com,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
qemu-devel@nongnu.org, Anthony Perard <anthony.perard@citrix.com>,
xen-devel@lists.xenproject.org,
Roger Pau Monne <roger.pau@citrix.com>
Subject: [PULL 1/3] xen: fix usage of ENODATA
Date: Fri, 1 Aug 2014 17:01:11 +0100 [thread overview]
Message-ID: <1406908873-17256-1-git-send-email-stefano.stabellini@eu.citrix.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1408011655020.2293@kaball.uk.xensource.com>
From: Roger Pau Monne <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>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Anthony Perard <anthony.perard@citrix.com>
---
xen-hvm.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/xen-hvm.c b/xen-hvm.c
index a2486cf..91de2e2 100644
--- a/xen-hvm.c
+++ b/xen-hvm.c
@@ -513,11 +513,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.10.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2014-08-01 16:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-01 16:00 [PULL 0/3] Xen tree 2014-08-01 Stefano Stabellini
2014-08-01 16:01 ` Stefano Stabellini [this message]
2014-08-01 16:01 ` [PULL 2/3] tap-bsd: implement a FreeBSD only version of tap_open Stefano Stabellini
2014-08-01 16:01 ` [PULL 3/3] qemu: support xen hvm direct kernel boot Stefano Stabellini
2014-08-04 12:06 ` [PULL 0/3] Xen tree 2014-08-01 Peter Maydell
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=1406908873-17256-1-git-send-email-stefano.stabellini@eu.citrix.com \
--to=stefano.stabellini@eu.citrix.com \
--cc=anthony.perard@citrix.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=roger.pau@citrix.com \
--cc=xen-devel@lists.xenproject.org \
--cc=xen-devel@lists.xensource.com \
/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).