diff mbox series

[RFC,03/10] xenstore: migrate to default privilege model

Message ID 20210514205437.13661-4-dpsmith@apertussolutions.com (mailing list archive)
State New, archived
Headers show
Series xsm: introducing domain roles | expand

Commit Message

Daniel P. Smith May 14, 2021, 8:54 p.m. UTC
Move to using a check for the Xenstore Domain role for the is_xenstore_domain
check.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/common/domain.c     | 3 +++
 xen/include/xen/sched.h | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 26bba8666d..1f2c569e5d 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -551,6 +551,9 @@  struct domain *domain_create(domid_t domid,
     {
         d->options = config->flags;
         d->vmtrace_size = config->vmtrace_size;
+
+        if (config->flags & XEN_DOMCTL_CDF_xs_domain)
+            d->xsm_roles = XSM_XENSTORE;
     }
 
     /* Sort out our idea of is_control_domain(). */
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 66b79d9c9f..9a88e5b00f 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -1129,7 +1129,7 @@  static inline bool is_vcpu_online(const struct vcpu *v)
 
 static inline bool is_xenstore_domain(const struct domain *d)
 {
-    return d->options & XEN_DOMCTL_CDF_xs_domain;
+    return d->xsm_roles & XSM_XENSTORE;
 }
 
 static always_inline bool is_iommu_enabled(const struct domain *d)