---
  xen/common/domain.c     | 3 +++
  xen/include/xen/sched.h | 3 ++-
  2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 0ff1d52e3d..dbf055c559 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -633,6 +633,9 @@ struct domain *domain_create(domid_t domid,
          d->role |= ROLE_HARDWARE_DOMAIN;
      }
  
+    if ( d->options & XEN_DOMCTL_CDF_xs_domain )
+        d->role |= ROLE_XENSTORE_DOMAIN;
+
      TRACE_1D(TRC_DOM0_DOM_ADD, d->domain_id);
  
      lock_profile_register_struct(LOCKPROF_TYPE_PERDOM, d, domid);
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 695f240326..ec0f9baff6 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -470,6 +470,7 @@ struct domain
  #define ROLE_UNBOUNDED_DOMAIN  (1U<<0)
  #define ROLE_CONTROL_DOMAIN    (1U<<1)
  #define ROLE_HARDWARE_DOMAIN   (1U<<2)
+#define ROLE_XENSTORE_DOMAIN   (1U<<3)
      uint8_t          role;
      /* Can this guest access the Xen console? */
      bool             is_console;
@@ -1165,7 +1166,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->role & ROLE_XENSTORE_DOMAIN;
  }
  
  static always_inline bool is_iommu_enabled(const struct domain *d)
--
2.20.1