]> xenbits.xensource.com Git - people/andrewcoop/xen.git/commitdiff
xen/domain: Initialise the domain handle before inserting into the domlist
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 7 Mar 2025 16:38:26 +0000 (16:38 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 10 Mar 2025 15:05:09 +0000 (15:05 +0000)
As soon as the the domain is in the domlist, it can be queried via various
means, ahead of being fully constructed.  Ensure it has the toolstack-given
UUID prior to becoming visible.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/common/domain.c

index fd98534c889f90860bcfd298030a1c3ee6d0b0a6..585fd726a94124197701c4541cd02edc3d74cbd6 100644 (file)
@@ -901,6 +901,8 @@ struct domain *domain_create(domid_t domid,
      */
     ASSERT(config);
 
+    memcpy(d->handle, config->handle, sizeof(d->handle));
+
 #ifdef CONFIG_HAS_PIRQ
     if ( !is_hardware_domain(d) )
         d->nr_pirqs = nr_static_irqs + extra_domU_irqs;
@@ -962,7 +964,6 @@ struct domain *domain_create(domid_t domid,
     domlist_insert(d);
 
     domain_changed_state(d);
-    memcpy(d->handle, config->handle, sizeof(d->handle));
 
     return d;