From: Ian Campbell Date: Thu, 18 Jun 2015 09:35:06 +0000 (+0100) Subject: tools/libxc: drop xc_map_foreign_bulk_compat wrappers X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=6c767a37825c041369fdce609d46c51bbc07656b;p=people%2Fliuw%2Flibxenctrl-split%2Fxen.git tools/libxc: drop xc_map_foreign_bulk_compat wrappers On Solaris and NetBSD xc_map_foreign_bulk is implemented by calling xc_map_foreign_bulk_compat and xc_map_foreign_bulk_compat is exposed as a symbol by libxenctrl.so. Remove these wrappers and turn the compat function into the real thing surrounded by the appropriate ifdef. As this is a compat function all new ports should instead implement xc_map_foreign_bulk properly, hence the ifdef should never be expanded. Signed-off-by: Ian Campbell Acked-by: Wei Liu --- diff --git a/tools/libxc/xc_foreign_memory.c b/tools/libxc/xc_foreign_memory.c index 9c705b69d9..b205bca85e 100644 --- a/tools/libxc/xc_foreign_memory.c +++ b/tools/libxc/xc_foreign_memory.c @@ -50,10 +50,14 @@ void *xc_map_foreign_pages(xc_interface *xch, uint32_t dom, int prot, return res; } -/* stub for all not yet converted OSes */ -void *xc_map_foreign_bulk_compat(xc_interface *xch, - uint32_t dom, int prot, - const xen_pfn_t *arr, int *err, unsigned int num) +/* + * stub for all not yet converted OSes (NetBSD and Solaris). New OSes should + * just implement xc_map_foreign_bulk. + */ +#if defined(__NetBSD__) || defined(__sun__) +void *xc_map_foreign_bulk(xc_interface *xch, + uint32_t dom, int prot, + const xen_pfn_t *arr, int *err, unsigned int num) { xen_pfn_t *pfn; unsigned int i; @@ -90,6 +94,7 @@ void *xc_map_foreign_bulk_compat(xc_interface *xch, return ret; } +#endif /* * Local variables: diff --git a/tools/libxc/xc_netbsd.c b/tools/libxc/xc_netbsd.c index 5e3b343b77..d7f7f3169d 100644 --- a/tools/libxc/xc_netbsd.c +++ b/tools/libxc/xc_netbsd.c @@ -67,13 +67,6 @@ int osdep_privcmd_close(xc_interface *xch) return close(fd); } -void *xc_map_foreign_bulk(xc_interface *xch, - uint32_t dom, int prot, - const xen_pfn_t *arr, int *err, unsigned int num) -{ - return xc_map_foreign_bulk_compat(xch, dom, prot, arr, err, num); -} - void *xc_map_foreign_batch(xc_interface *xch, uint32_t dom, int prot, xen_pfn_t *arr, int num) diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h index c93df7fa37..ecf2451e9a 100644 --- a/tools/libxc/xc_private.h +++ b/tools/libxc/xc_private.h @@ -107,11 +107,6 @@ int osdep_privcmd_close(xc_interface *xch); void *osdep_alloc_hypercall_buffer(xc_interface *xch, int npages); void osdep_free_hypercall_buffer(xc_interface *xch, void *ptr, int npages); -/* Stub for not yet converted OSes */ -void *xc_map_foreign_bulk_compat(xc_interface *xch, - uint32_t dom, int prot, - const xen_pfn_t *arr, int *err, unsigned int num); - void xc_report_error(xc_interface *xch, int code, const char *fmt, ...) __attribute__((format(printf,3,4))); void xc_reportv(xc_interface *xch, xentoollog_logger *lg, xentoollog_level, diff --git a/tools/libxc/xc_solaris.c b/tools/libxc/xc_solaris.c index 18622fac31..5e72dee313 100644 --- a/tools/libxc/xc_solaris.c +++ b/tools/libxc/xc_solaris.c @@ -94,13 +94,6 @@ void *xc_map_foreign_batch(xc_interface *xch, } -void *xc_map_foreign_bulk(xc_interface *xch, - uint32_t dom, int prot, - const xen_pfn_t *arr, int *err, unsigned int num) -{ - return xc_map_foreign_bulk_compat(xch, dom, prot, arr, err, num); -} - void *xc_map_foreign_range(xc_interface *xch, uint32_t dom, int size, int prot,