diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2008-07-24 17:34:50 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2008-07-24 17:34:50 +0100 |
commit | ae41a026ab89f2c8484851d341924e41a0106764 (patch) | |
tree | 2ba6d226a6b92855a8fb0f5e6f1a7b492b4cddc1 /tools/libxc/xc_minios.c | |
parent | b45184b0fc91b9acd1a6683851cefcfce081d93e (diff) | |
download | xen-ae41a026ab89f2c8484851d341924e41a0106764.tar.gz xen-ae41a026ab89f2c8484851d341924e41a0106764.tar.bz2 xen-ae41a026ab89f2c8484851d341924e41a0106764.zip |
minios: grant table map (gntdev) bug fixes
* Uninitialized dev_bus_addr argument to GNTTABOP_unmap_grant_ref
results in an angry hypervisor.
* Set errno in libxc and return -1 on error.
* op.status is a int16_t, so it should be printed with PRId16.
* Don't print domids[0] or refs[0] if the ptr is NULL. It's more
polite to crash later, after the message has been printed.
Signed-off-by: Diego Ongaro <diego.ongaro@citrix.com>
Diffstat (limited to 'tools/libxc/xc_minios.c')
-rw-r--r-- | tools/libxc/xc_minios.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/tools/libxc/xc_minios.c b/tools/libxc/xc_minios.c index f0c383bfd8..3781907d15 100644 --- a/tools/libxc/xc_minios.c +++ b/tools/libxc/xc_minios.c @@ -383,16 +383,28 @@ int xc_gnttab_munmap(int xcg_handle, void *start_address, uint32_t count) { - return gntmap_munmap(&files[xcg_handle].gntmap, - (unsigned long) start_address, - count); + int ret; + ret = gntmap_munmap(&files[xcg_handle].gntmap, + (unsigned long) start_address, + count); + if (ret < 0) { + errno = -ret; + return -1; + } + return ret; } int xc_gnttab_set_max_grants(int xcg_handle, uint32_t count) { - return gntmap_set_max_grants(&files[xcg_handle].gntmap, - count); + int ret; + ret = gntmap_set_max_grants(&files[xcg_handle].gntmap, + count); + if (ret < 0) { + errno = -ret; + return -1; + } + return ret; } /* |