From 1ce968d96064d71099bed11992e9e2b40f0a5cb1 Mon Sep 17 00:00:00 2001 From: Andrew Cooper Date: Fri, 7 Mar 2025 16:38:26 +0000 Subject: [PATCH] xen/domain: Initialise the domain handle before inserting into the domlist 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 Reviewed-by: Jan Beulich --- xen/common/domain.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/common/domain.c b/xen/common/domain.c index fd98534c88..585fd726a9 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -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; -- 2.39.5