tools: xentoolcore_restrict_all: use domid_t
authorIan Jackson <ian.jackson@eu.citrix.com>
Thu, 14 Sep 2017 17:12:57 +0000 (18:12 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Wed, 11 Oct 2017 11:51:22 +0000 (12:51 +0100)
This necessitates adding $(CFLAGS_xeninclude) to all the depending
libraries (which can be done via Rules.mk), so that the definition of
domid_t (in xen.h) can be found.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
tools/libs/call/core.c
tools/libs/devicemodel/core.c
tools/libs/foreignmemory/core.c
tools/libs/gnttab/gnttab_core.c
tools/libs/toolcore/Makefile
tools/libs/toolcore/handlereg.c
tools/libs/toolcore/include/xentoolcore.h
tools/libs/toolcore/include/xentoolcore_internal.h
tools/xenstore/xs.c

index d6ce73db348f16cb6743073aaa4fefa93800d97e..b256fce98c815327d70e15dd33e7943f978abdff 100644 (file)
@@ -17,7 +17,7 @@
 
 #include "private.h"
 
-static int all_restrict_cb(Xentoolcore__Active_Handle *ah, uint32_t domid) {
+static int all_restrict_cb(Xentoolcore__Active_Handle *ah, domid_t domid) {
     xencall_handle *xcall = CONTAINER_OF(ah, *xcall, tc_ah);
     return xentoolcore__restrict_by_dup2_null(xcall->fd);
 }
index ce3af749bd726f857040863c34f619bc16451cb6..b66d4f92948757a84b2b45e01b571b9c3c1e038b 100644 (file)
@@ -21,7 +21,7 @@
 
 #include "private.h"
 
-static int all_restrict_cb(Xentoolcore__Active_Handle *ah, uint32_t domid) {
+static int all_restrict_cb(Xentoolcore__Active_Handle *ah, domid_t domid) {
     xendevicemodel_handle *dmod = CONTAINER_OF(ah, *dmod, tc_ah);
 
     if (dmod->fd < 0)
index b48ecba8de3f83d492a09a03d82cf1a3a131ccaf..79b24d273b738f9d66eeac4ec0172956f761d299 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "private.h"
 
-static int all_restrict_cb(Xentoolcore__Active_Handle *ah, uint32_t domid) {
+static int all_restrict_cb(Xentoolcore__Active_Handle *ah, domid_t domid) {
     xenforeignmemory_handle *fmem = CONTAINER_OF(ah, *fmem, tc_ah);
 
     if (fmem->fd < 0)
index bc8811060a88617ca9ca5b00cad8a58277331cae..5f761e54693c66d317ea480a5e8faf6e2243f2ab 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "private.h"
 
-static int all_restrict_cb(Xentoolcore__Active_Handle *ah, uint32_t domid) {
+static int all_restrict_cb(Xentoolcore__Active_Handle *ah, domid_t domid) {
     xengnttab_handle *xgt = CONTAINER_OF(ah, *xgt, tc_ah);
     return xentoolcore__restrict_by_dup2_null(xgt->fd);
 }
index 73db0bdef1de5c33c2ac996dfcbdb950d076b55c..8b1d48b7c201eaaa33feda6c2b86567ba90fdba2 100644 (file)
@@ -7,6 +7,7 @@ SHLIB_LDFLAGS += -Wl,--version-script=libxentoolcore.map
 
 CFLAGS += -Werror -Wmissing-prototypes
 CFLAGS += -I./include
+CFLAGS += $(CFLAGS_xeninclude)
 
 SRCS-y += handlereg.c
 
index 8bd9062b1010fd78678b2f350b47248f0dda2e56..baec55e2a4dc77ef1eb81e5fcb8d6ae52d941eb5 100644 (file)
@@ -55,7 +55,7 @@ void xentoolcore__deregister_active_handle(Xentoolcore__Active_Handle *ah) {
     unlock();
 }
 
-int xentoolcore_restrict_all(uint32_t domid) {
+int xentoolcore_restrict_all(domid_t domid) {
     int r;
     Xentoolcore__Active_Handle *ah;
 
index 881ff110ca012db230b3d6c58865e885ad32fb51..be6c570815d6ca59accf8ab3771b202ffc49b042 100644 (file)
 #define XENTOOLCORE_H
 
 #include <stdint.h>
+#include <xen/xen.h>
 
 /*
- * int xentoolcore_restrict_all(uint32_t domid);
+ * int xentoolcore_restrict_all(domid_t domid);
  *
  * Arranges that Xen library handles (fds etc.) which are currently held
  * by Xen libraries, can no longer be used other than to affect domid.
@@ -65,7 +66,7 @@
  *     xen_some[other]library_open|close or xentoolcore_restrict_all
  *
  */
-int xentoolcore_restrict_all(uint32_t domid);
+int xentoolcore_restrict_all(domid_t domid);
 
 #endif /* XENTOOLCORE_H */
 
index 7e96a48810660fae7a0bda260781999c4e22cca9..dbdb1dd28721dc8644cfa0422d9039921770a61d 100644 (file)
@@ -81,7 +81,7 @@
 typedef struct Xentoolcore__Active_Handle Xentoolcore__Active_Handle;
 
 typedef int Xentoolcore__Restrict_Callback(Xentoolcore__Active_Handle*,
-                                           uint32_t domid);
+                                           domid_t domid);
 
 struct Xentoolcore__Active_Handle {
     Xentoolcore__Restrict_Callback *restrict_callback;
index ae4b87829430829c87b6dcee99e59eb2c0e31c07..23f3f09c8c9aebbd63d2ae9af5e90a190573cef6 100644 (file)
@@ -223,7 +223,7 @@ static int get_dev(const char *connect_to)
        return open(connect_to, O_RDWR);
 }
 
-static int all_restrict_cb(Xentoolcore__Active_Handle *ah, uint32_t domid) {
+static int all_restrict_cb(Xentoolcore__Active_Handle *ah, domid_t domid) {
     struct xs_handle *h = CONTAINER_OF(ah, *h, tc_ah);
     return xentoolcore__restrict_by_dup2_null(h->fd);
 }