diff options
author | Roger Pau Monne <roger.pau@citrix.com> | 2014-05-23 17:57:47 +0200 |
---|---|---|
committer | Stefano Stabellini <stefano.stabellini@eu.citrix.com> | 2014-08-01 15:57:28 +0000 |
commit | 74bc41511af5c389cd9f37956bd6e7fd7de35c49 (patch) | |
tree | 3ac3141be2dad8be31e92eb75dce281cdd5a314f | |
parent | 541bbb07eb197a870661ed702ae1f15c7d46aea6 (diff) | |
download | qemu-74bc41511af5c389cd9f37956bd6e7fd7de35c49.zip qemu-74bc41511af5c389cd9f37956bd6e7fd7de35c49.tar.gz qemu-74bc41511af5c389cd9f37956bd6e7fd7de35c49.tar.bz2 |
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: 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>
-rw-r--r-- | xen-hvm.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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; } |