Skip to contentSkip to conversation

xen/domain: Reposition config copying in domain_create()

PATCH In review Andrew Cooper 2 participants 2 messages Jan 18, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/domain: Reposition config copying in domain_create()

This is cleanup for two pending series which will copy more data than just flags from config.

---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Wei Liu <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Julien Grall <[email protected]>
CC: Volodymyr Babchuk <[email protected]>

The series in question are my fault-ttl series, and Michal's Processor Trace series.

---
 xen/common/domain.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
xen/common/domain.c +3 -2
index d151be3f36..164c9d14e9 100644
@@ -421,14 +421,15 @@ struct domain *domain_create(domid_t domid,
     if ( (d = alloc_domain_struct()) == NULL )
         return ERR_PTR(-ENOMEM);
 
-    d->options = config ? config->flags : 0;
-
     /* Sort out our idea of is_system_domain(). */
     d->domain_id = domid;
 
     /* Debug sanity. */
     ASSERT(is_system_domain(d) ? config == NULL : config != NULL);
 
+    if ( config )
+        d->options = config->flags;
+
     /* Sort out our idea of is_control_domain(). */
     d->is_privileged = is_priv;
 
Signature · 1 line
2.11.0