From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: [PATCH XEN v2 11/15] tools/libxc: drop xc_map_foreign_bulk_compat wrappers Date: Wed, 15 Jul 2015 16:46:59 +0100 Message-ID: <1436975223-11098-11-git-send-email-ian.campbell@citrix.com> References: <1436975173.32371.121.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1436975173.32371.121.camel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: ian.jackson@eu.citrix.com, wei.liu2@citrix.com, xen-devel@lists.xen.org Cc: roger.pau@citrix.com, Ian Campbell , stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org 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 --- docs/misc/toolstack-library-abis.pandoc | 4 ---- tools/libxc/xc_foreign_memory.c | 13 +++++++++---- tools/libxc/xc_netbsd.c | 7 ------- tools/libxc/xc_private.h | 5 ----- tools/libxc/xc_solaris.c | 7 ------- 5 files changed, 9 insertions(+), 27 deletions(-) diff --git a/docs/misc/toolstack-library-abis.pandoc b/docs/misc/toolstack-library-abis.pandoc index 8339834..271e4b5 100644 --- a/docs/misc/toolstack-library-abis.pandoc +++ b/docs/misc/toolstack-library-abis.pandoc @@ -276,10 +276,6 @@ Interface Underlying interface Known external `xc_map_foreign_ranges` `xc_map_foreign_batch` `xc_map_foreign_bulk` `IOCTL_PRIVCMD_MMAPBATCH_V2` qemu-dm -`xc_map_foreign_bulk_compat` private - -`xc_map_foreign_bulk_compat` is a stub for all not yet converted OSes -and is used by netbsd & solaris. ### Managing guest memory map diff --git a/tools/libxc/xc_foreign_memory.c b/tools/libxc/xc_foreign_memory.c index 53b6c9a..da77e9d 100644 --- a/tools/libxc/xc_foreign_memory.c +++ b/tools/libxc/xc_foreign_memory.c @@ -51,10 +51,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; @@ -91,6 +95,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 78683a2..a61e52f 100644 --- a/tools/libxc/xc_netbsd.c +++ b/tools/libxc/xc_netbsd.c @@ -68,13 +68,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 2288660..c8c2bdc 100644 --- a/tools/libxc/xc_private.h +++ b/tools/libxc/xc_private.h @@ -108,11 +108,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 cbac826..1e1a0c4 100644 --- a/tools/libxc/xc_solaris.c +++ b/tools/libxc/xc_solaris.c @@ -95,13 +95,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, -- 2.1.4