[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [qemu-upstream-unstable] xen: fix usage of ENODATA



commit fb97531e52d20b864f3eb2e62695d4694a77d530
Author:     Roger Pau Monne <roger.pau@xxxxxxxxxx>
AuthorDate: Fri May 23 17:57:47 2014 +0200
Commit:     Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
CommitDate: Mon Aug 4 16:36:12 2014 +0000

    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.

    upstream-commit-id: 74bc41511af5c389cd9f37956bd6e7fd7de35c49

    Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
    Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx
    Cc: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
    Cc: Anthony Perard <anthony.perard@xxxxxxxxxx>
---
 xen-hvm.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/xen-hvm.c b/xen-hvm.c
index a573a20..5c69a8d 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;
     }
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.