提交 74bc4151 编写于 作者: R Roger Pau Monne 提交者: Stefano Stabellini

xen: fix usage of ENODATA

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: NRoger Pau Monné <roger.pau@citrix.com>
Signed-off-by: NStefano 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>
上级 541bbb07
...@@ -513,11 +513,14 @@ static void xen_sync_dirty_bitmap(XenIOState *state, ...@@ -513,11 +513,14 @@ static void xen_sync_dirty_bitmap(XenIOState *state,
start_addr >> TARGET_PAGE_BITS, npages, start_addr >> TARGET_PAGE_BITS, npages,
bitmap); bitmap);
if (rc < 0) { if (rc < 0) {
if (rc != -ENODATA) { #ifndef ENODATA
#define ENODATA ENOENT
#endif
if (errno == ENODATA) {
memory_region_set_dirty(framebuffer, 0, size); memory_region_set_dirty(framebuffer, 0, size);
DPRINTF("xen: track_dirty_vram failed (0x" TARGET_FMT_plx DPRINTF("xen: track_dirty_vram failed (0x" TARGET_FMT_plx
", 0x" TARGET_FMT_plx "): %s\n", ", 0x" TARGET_FMT_plx "): %s\n",
start_addr, start_addr + size, strerror(-rc)); start_addr, start_addr + size, strerror(errno));
} }
return; return;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册