Files
xen/tools/libxc/xc_evtchn_compat.c
T
Ian Campbell b7f76a699d tools: Refactor /dev/xen/evtchn wrappers into libxenevtchn.
libxenevtchn will provide a stable API and ABI for accessing the
evtchn device.

The functions are moved into the xenevtchn namespace to make a clean
break from libxc and avoid ambiguity regarding which interfaces are
stable.

All in-tree users are updated to use the new names.

Upon request (via #define XC_WANT_COMPAT_EVTCHN_API) libxenctrl will
provide a compat API for the old names. This is used by qemu-xen for
the time being. qemu-xen-traditional is updated in lockstep.

This leaves a few event channel related functions which go via privcmd
(EVTCHNOP) rather than ioctls on the /dev/xen/evtchn device in
libxenctrl. Specifically:

 - xc_evtchn_alloc_unbound
 - xc_evtchn_reset
 - xc_evtchn_status

Note that xc_evtchn_alloc_unbound's functionality is also provided by
xenevtchn_bind_unbound_port() (née xc_evtchn_bind_unbound_port) and is
probably redundant.

These functions do not appear to be needed by qemu-dm, qemu-pv
(provision of device model to HVM guests and PV backends respectively)
or by libvchan suggesting they are not needed by non-toolstack uses of
event channels. QEMU does use these in hw/xenpv/xen_domainbuild.c but
that is a "toolstack use".

The new library uses a version script to ensure that only expected
symbols are exported and to version them such that ABI guarantees can
be kept in the future.

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>
[ ijc -- updated MINIOS_UPSTREAM_REVISION and QEMU_TRADITIONAL_REVISION ]
2016-01-22 12:21:07 +00:00

76 lines
1.5 KiB
C

/*
* Compat shims for use of 3rd party consumers of libxenctrl xc_evtchn
* functionality which has been split into separate libraries.
*/
#include <xenevtchn.h>
#define XC_WANT_COMPAT_EVTCHN_API
#include "xenctrl.h"
xc_evtchn *xc_evtchn_open(xentoollog_logger *logger,
unsigned open_flags)
{
return xenevtchn_open(logger, open_flags);
}
int xc_evtchn_close(xc_evtchn *xce)
{
return xenevtchn_close(xce);
}
int xc_evtchn_fd(xc_evtchn *xce)
{
return xenevtchn_fd(xce);
}
int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port)
{
return xenevtchn_notify(xce, port);
}
evtchn_port_or_error_t
xc_evtchn_bind_unbound_port(xc_evtchn *xce, int domid)
{
return xenevtchn_bind_unbound_port(xce, domid);
}
evtchn_port_or_error_t
xc_evtchn_bind_interdomain(xc_evtchn *xce, int domid,
evtchn_port_t remote_port)
{
return xenevtchn_bind_interdomain(xce, domid, remote_port);
}
evtchn_port_or_error_t
xc_evtchn_bind_virq(xc_evtchn *xce, unsigned int virq)
{
return xenevtchn_bind_virq(xce, virq);
}
int xc_evtchn_unbind(xc_evtchn *xce, evtchn_port_t port)
{
return xenevtchn_unbind(xce, port);
}
evtchn_port_or_error_t
xc_evtchn_pending(xc_evtchn *xce)
{
return xenevtchn_pending(xce);
}
int xc_evtchn_unmask(xc_evtchn *xce, evtchn_port_t port)
{
return xenevtchn_unmask(xce, port);
}
/*
* Local variables:
* mode: C
* c-file-style: "BSD"
* c-basic-offset: 4
* tab-width: 4
* indent-tabs-mode: nil
* End:
*/