aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2016-02-10 11:07:01 +0000
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>2016-02-10 12:01:16 +0000
commitedfb07ed2251c08a34d8f9d8f818deef50a1cba8 (patch)
treecced7905d4144204143ad1b6cc58df1ea0c3c9a6 /include
parentf075c89f0a9cb31daf38892371d2822177505706 (diff)
xen: drop support for Xen 4.1 and older.
Xen 4.2 become unsupported upstream in 09/2015 (see http://wiki.xen.org/wiki/Xen_Release_Features). However as far as the interfaces provided by the toolstack libraries go 4.2 and 4.3 are indistinguishable. Therefore drop support for Xen 4.1 and earlier which removes a whole pile of compatibility code which makes future work (to use stable library interfaces provided by upstream) more difficult. In particular all supported versions now use a pointer as a libxc handle (4.1 and earlier used an integer, resulting in various shim layers). Also Xen 4.2 was the first version of Xen to formally support upstream QEMU (as a preview) so that makes sense as a cut-off now. This change drops all the configure-y and resulting ifdefs in a mostly mechanical way. A follow up will refactor wrappers which are now unused. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Diffstat (limited to 'include')
-rw-r--r--include/hw/xen/xen.h4
-rw-r--r--include/hw/xen/xen_common.h146
2 files changed, 4 insertions, 146 deletions
diff --git a/include/hw/xen/xen.h b/include/hw/xen/xen.h
index c57735419c..df334818c1 100644
--- a/include/hw/xen/xen.h
+++ b/include/hw/xen/xen.h
@@ -48,8 +48,4 @@ void xen_modified_memory(ram_addr_t start, ram_addr_t length);
void xen_register_framebuffer(struct MemoryRegion *mr);
-#if defined(CONFIG_XEN) && CONFIG_XEN_CTRL_INTERFACE_VERSION < 400
-# define HVM_MAX_VCPUS 32
-#endif
-
#endif /* QEMU_HW_XEN_H */
diff --git a/include/hw/xen/xen_common.h b/include/hw/xen/xen_common.h
index 0d83891ab8..3a5b5374e2 100644
--- a/include/hw/xen/xen_common.h
+++ b/include/hw/xen/xen_common.h
@@ -16,11 +16,7 @@
#undef XC_WANT_COMPAT_MAP_FOREIGN_API
#include <xenctrl.h>
-#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 420
-# include <xs.h>
-#else
-# include <xenstore.h>
-#endif
+#include <xenstore.h>
#include <xen/io/xenbus.h>
#include "hw/hw.h"
@@ -30,129 +26,11 @@
#include "trace.h"
/*
- * We don't support Xen prior to 3.3.0.
+ * We don't support Xen prior to 4.2.0.
*/
-/* Xen before 4.0 */
-#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 400
-static inline void *xc_map_foreign_bulk(int xc_handle, uint32_t dom, int prot,
- xen_pfn_t *arr, int *err,
- unsigned int num)
-{
- return xc_map_foreign_batch(xc_handle, dom, prot, arr, num);
-}
-#endif
-
-
-/* Xen before 4.1 */
-#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 410
-
-typedef int XenXC;
-typedef int xenevtchn_handle;
-typedef int xengnttab_handle;
-typedef int xenforeignmemory_handle;
-
-# define XC_INTERFACE_FMT "%i"
-# define XC_HANDLER_INITIAL_VALUE -1
-
-static inline xenevtchn_handle *xenevtchn_open(void *logger,
- unsigned int open_flags)
-{
- xenevtchn_handle *h = malloc(sizeof(*h));
- if (!h) {
- return NULL;
- }
- *h = xc_evtchn_open();
- if (*h == -1) {
- free(h);
- h = NULL;
- }
- return h;
-}
-static inline int xenevtchn_close(xenevtchn_handle *h)
-{
- int rc = xc_evtchn_close(*h);
- free(h);
- return rc;
-}
-#define xenevtchn_fd(h) xc_evtchn_fd(*h)
-#define xenevtchn_pending(h) xc_evtchn_pending(*h)
-#define xenevtchn_notify(h, p) xc_evtchn_notify(*h, p)
-#define xenevtchn_bind_interdomain(h, d, p) xc_evtchn_bind_interdomain(*h, d, p)
-#define xenevtchn_unmask(h, p) xc_evtchn_unmask(*h, p)
-#define xenevtchn_unbind(h, p) xc_evtchn_unmask(*h, p)
-
-static inline xengnttab_handle *xengnttab_open(void *logger,
- unsigned int open_flags)
-{
- xengnttab_handle *h = malloc(sizeof(*h));
- if (!h) {
- return NULL;
- }
- *h = xc_gnttab_open();
- if (*h == -1) {
- free(h);
- h = NULL;
- }
- return h;
-}
-static inline int xengnttab_close(xengnttab_handle *h)
-{
- int rc = xc_gnttab_close(*h);
- free(h);
- return rc;
-}
-#define xengnttab_set_max_grants(h, n) xc_gnttab_set_max_grants(*h, n)
-#define xengnttab_map_grant_ref(h, d, r, p) xc_gnttab_map_grant_ref(*h, d, r, p)
-#define xengnttab_map_grant_refs(h, c, d, r, p) \
- xc_gnttab_map_grant_refs(*h, c, d, r, p)
-#define xengnttab_unmap(h, a, n) xc_gnttab_munmap(*h, a, n)
-
-static inline XenXC xen_xc_interface_open(void *logger, void *dombuild_logger,
- unsigned int open_flags)
-{
- return xc_interface_open();
-}
-
-/* See below for xenforeignmemory_* APIs */
-
-static inline int xc_domain_populate_physmap_exact
- (XenXC xc_handle, uint32_t domid, unsigned long nr_extents,
- unsigned int extent_order, unsigned int mem_flags, xen_pfn_t *extent_start)
-{
- return xc_domain_memory_populate_physmap
- (xc_handle, domid, nr_extents, extent_order, mem_flags, extent_start);
-}
-
-static inline int xc_domain_add_to_physmap(int xc_handle, uint32_t domid,
- unsigned int space, unsigned long idx,
- xen_pfn_t gpfn)
-{
- struct xen_add_to_physmap xatp = {
- .domid = domid,
- .space = space,
- .idx = idx,
- .gpfn = gpfn,
- };
-
- return xc_memory_op(xc_handle, XENMEM_add_to_physmap, &xatp);
-}
-
-static inline struct xs_handle *xs_open(unsigned long flags)
-{
- return xs_daemon_open();
-}
-
-static inline void xs_close(struct xs_handle *xsh)
-{
- if (xsh != NULL) {
- xs_daemon_close(xsh);
- }
-}
-
-
-/* Xen 4.1 thru 4.6 */
-#elif CONFIG_XEN_CTRL_INTERFACE_VERSION < 471
+/* Xen 4.2 thru 4.6 */
+#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 471
typedef xc_interface *XenXC;
typedef xc_interface *xenforeignmemory_handle;
@@ -205,27 +83,11 @@ static inline XenXC xen_xc_interface_open(void *logger, void *dombuild_logger,
}
#endif
-/* Xen before 4.2 */
-#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 420
-static inline int xen_xc_hvm_inject_msi(XenXC xen_xc, domid_t dom,
- uint64_t addr, uint32_t data)
-{
- return -ENOSYS;
-}
-/* The followings are only to compile op_discard related code on older
- * Xen releases. */
-#define BLKIF_OP_DISCARD 5
-struct blkif_request_discard {
- uint64_t nr_sectors;
- uint64_t sector_number;
-};
-#else
static inline int xen_xc_hvm_inject_msi(XenXC xen_xc, domid_t dom,
uint64_t addr, uint32_t data)
{
return xc_hvm_inject_msi(xen_xc, dom, addr, data);
}
-#endif
void destroy_hvm_domain(bool reboot);