SHLIB_libxentoolcore = $(SHDEPS_libxentoolcore) -Wl,-rpath-link=$(XEN_LIBXENTOOLCORE)
CFLAGS_libxenevtchn = -I$(XEN_LIBXENEVTCHN)/include $(CFLAGS_xeninclude)
-SHDEPS_libxenevtchn =
+SHDEPS_libxenevtchn = $(SHLIB_libxentoolcore)
LDLIBS_libxenevtchn = $(SHDEPS_libxenevtchn) $(XEN_LIBXENEVTCHN)/libxenevtchn$(libextension)
SHLIB_libxenevtchn = $(SHDEPS_libxenevtchn) -Wl,-rpath-link=$(XEN_LIBXENEVTCHN)
CFLAGS += -Werror -Wmissing-prototypes
CFLAGS += -I./include $(CFLAGS_xeninclude)
-CFLAGS += $(CFLAGS_libxentoollog)
+CFLAGS += $(CFLAGS_libxentoollog) $(CFLAGS_libxentoolcore)
SRCS-y += core.c
SRCS-$(CONFIG_Linux) += linux.c
$(SYMLINK_SHLIB) $< $@
libxenevtchn.so.$(MAJOR).$(MINOR): $(PIC_OBJS) libxenevtchn.map
- $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenevtchn.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(PIC_OBJS) $(LDLIBS_libxentoollog) $(APPEND_LDFLAGS)
+ $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenevtchn.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(PIC_OBJS) $(LDLIBS_libxentoollog) $(LDLIBS_libxentoolcore) $(APPEND_LDFLAGS)
.PHONY: install
install: build
#include "private.h"
+static int all_restrict_cb(Xentoolcore__Active_Handle *ah, domid_t domid) {
+ xenevtchn_handle *xce = CONTAINER_OF(ah, *xce, tc_ah);
+
+ if (xce->fd < 0)
+ /* just in case */
+ return 0;
+
+ return xenevtchn_restrict(xce, domid);
+}
+
xenevtchn_handle *xenevtchn_open(xentoollog_logger *logger, unsigned open_flags)
{
xenevtchn_handle *xce = malloc(sizeof(*xce));
xce->logger = logger;
xce->logger_tofree = NULL;
+ xce->tc_ah.restrict_callback = all_restrict_cb;
+ xentoolcore__register_active_handle(&xce->tc_ah);
+
if (!xce->logger) {
xce->logger = xce->logger_tofree =
(xentoollog_logger*)
#include <xentoollog.h>
#include <xenevtchn.h>
+#include <xentoolcore_internal.h>
+
#include <xen/xen.h>
struct xenevtchn_handle {
xentoollog_logger *logger, *logger_tofree;
int fd;
+ Xentoolcore__Active_Handle tc_ah;
};
int osdep_evtchn_open(xenevtchn_handle *xce);
*
* Does not prevent effects that amount only to
* - denial of service, possibly host-wide, by resource exhaustion etc.
- * - leak of not-very-interesting metainformation about other domains
- * eg, specifically, event channel signals relating to other domains
*
* If this cannot be achieved, returns -1 and sets errno.
* If called again with the same domid, it may succeed, or it may