diff options
author | Ian Campbell <ian.campbell@citrix.com> | 2016-01-15 13:23:39 +0000 |
---|---|---|
committer | Stefano Stabellini <stefano.stabellini@eu.citrix.com> | 2016-01-26 17:19:28 +0000 |
commit | c1345a88785b50ba2bf5e87b83c7e22f6b4ec83d (patch) | |
tree | b33273e1cc6b0ed2fbcc10525e46f539525e3b74 /hw/xen | |
parent | a2db2a1edd06a50b8a862c654cf993368cf9f1d9 (diff) |
xen: Switch to libxengnttab interface for compat shims.
In Xen 4.7 we are refactoring parts libxenctrl into a number of
separate libraries which will provide backward and forward API and ABI
compatiblity.
One such library will be libxengnttab which provides access to grant
tables.
In preparation for this switch the compatibility layer in xen_common.h
(which support building with older versions of Xen) to use what will
be the new library API. This means that the gnttab shim will disappear
for versions of Xen which include libxengnttab.
To simplify things for the <= 4.0.0 support we wrap the int fd in a
malloc(sizeof int) such that the handle is always a pointer. This
leads to less typedef headaches and the need for
XC_HANDLER_INITIAL_VALUE etc for these interfaces.
Note that this patch does not add any support for actually using
libxengnttab, it just adjusts the existing shims.
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 'hw/xen')
-rw-r--r-- | hw/xen/xen_backend.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c index ae2a1f01bd..966e34f3cb 100644 --- a/hw/xen/xen_backend.c +++ b/hw/xen/xen_backend.c @@ -252,15 +252,15 @@ static struct XenDevice *xen_be_get_xendev(const char *type, int dom, int dev, fcntl(xenevtchn_fd(xendev->evtchndev), F_SETFD, FD_CLOEXEC); if (ops->flags & DEVOPS_FLAG_NEED_GNTDEV) { - xendev->gnttabdev = xen_xc_gnttab_open(NULL, 0); - if (xendev->gnttabdev == XC_HANDLER_INITIAL_VALUE) { + xendev->gnttabdev = xengnttab_open(NULL, 0); + if (xendev->gnttabdev == NULL) { xen_be_printf(NULL, 0, "can't open gnttab device\n"); xenevtchn_close(xendev->evtchndev); g_free(xendev); return NULL; } } else { - xendev->gnttabdev = XC_HANDLER_INITIAL_VALUE; + xendev->gnttabdev = NULL; } QTAILQ_INSERT_TAIL(&xendevs, xendev, next); @@ -309,8 +309,8 @@ static struct XenDevice *xen_be_del_xendev(int dom, int dev) if (xendev->evtchndev != NULL) { xenevtchn_close(xendev->evtchndev); } - if (xendev->gnttabdev != XC_HANDLER_INITIAL_VALUE) { - xc_gnttab_close(xendev->gnttabdev); + if (xendev->gnttabdev != NULL) { + xengnttab_close(xendev->gnttabdev); } QTAILQ_REMOVE(&xendevs, xendev, next); |