tools/libs/foreignmemory: Support err == NULL to map.
authorIan Campbell <ian.campbell@citrix.com>
Fri, 27 Nov 2015 15:55:57 +0000 (15:55 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Fri, 22 Jan 2016 12:24:18 +0000 (12:24 +0000)
commitbd1c1ea4404fd374d91c266a10ddc6ac5d29e637
tree00d6b7047be705b89211f922eeeac3976777023a
parentc4f9e14dea6bf9723775332721af736f615cf24d
tools/libs/foreignmemory: Support err == NULL to map.

The existing xc_map_foreign_bulk-like interface encourages callers to
miss error checking for partial failure (by forgetting to scan the err
array).

Add support for passing err==NULL which behaves in a
xc_map_foreign_pages-like manner and returns a global error for any
failure.

While documenting this also clarify the overall behaviour and the
behaviour with err!=NULL.

With this the compat wrapper of xc_map_foreign_pages() can be
simplified.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libs/foreignmemory/core.c
tools/libs/foreignmemory/include/xenforeignmemory.h
tools/libxc/xc_foreign_memory.c