@@ -297,6 +297,16 @@ void unmap_xenbus(void *interface);
static inline int xenbus_master_domid(void) { return dom0_domid; }
+static inline bool domid_is_unprivileged(unsigned int domid)
+{
+ return domid != dom0_domid && domid != priv_domid;
+}
+
+static inline bool domain_is_unprivileged(const struct connection *conn)
+{
+ return conn && domid_is_unprivileged(conn->id);
+}
+
/* Return the event channel used by xenbus. */
evtchn_port_t xenbus_evtchn(void);
@@ -406,17 +406,6 @@ void handle_event(void)
barf_perror("Failed to write to event fd");
}
-static bool domid_is_unprivileged(unsigned int domid)
-{
- return domid != dom0_domid && domid != priv_domid;
-}
-
-bool domain_is_unprivileged(struct connection *conn)
-{
- return conn && conn->domain &&
- domid_is_unprivileged(conn->domain->domid);
-}
-
static char *talloc_domain_path(const void *context, unsigned int domid)
{
return talloc_asprintf(context, "/local/domain/%u", domid);
@@ -59,8 +59,6 @@ void ignore_connection(struct connection *conn, unsigned int err);
/* Returns the implicit path of a connection (only domains have this) */
const char *get_implicit_path(const struct connection *conn);
-bool domain_is_unprivileged(struct connection *conn);
-
/* Remove node permissions for no longer existing domains. */
int domain_adjust_node_perms(struct node *node);
int domain_alloc_permrefs(struct node_perms *perms);