|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 19/20] xen/domain: Call arch_domain_create() as early as possible in domain_create()
This is in preparation to set up d->max_cpus and d->vcpu[] in
arch_domain_create(), and allow later parts of domain construction to have
access to the values.
Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
CC: Jan Beulich <JBeulich@xxxxxxxx>
CC: Stefano Stabellini <sstabellini@xxxxxxxxxx>
CC: Julien Grall <julien.grall@xxxxxxx>
---
xen/common/domain.c | 34 +++++++++++++++++-----------------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/xen/common/domain.c b/xen/common/domain.c
index c86cf47..94a78d6 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -320,6 +320,23 @@ struct domain *domain_create(domid_t domid,
else
d->guest_type = guest_type_pv;
+ if ( !is_hardware_domain(d) )
+ d->nr_pirqs = nr_static_irqs + extra_domU_irqs;
+ else
+ d->nr_pirqs = extra_hwdom_irqs ? nr_static_irqs + extra_hwdom_irqs
+ : arch_hwdom_irqs(domid);
+ if ( d->nr_pirqs > nr_irqs )
+ d->nr_pirqs = nr_irqs;
+
+ radix_tree_init(&d->pirq_tree);
+ }
+
+ if ( (err = arch_domain_create(d, config)) != 0 )
+ goto fail;
+ init_status |= INIT_arch;
+
+ if ( !is_idle_domain(d) )
+ {
watchdog_domain_init(d);
init_status |= INIT_watchdog;
@@ -350,16 +367,6 @@ struct domain *domain_create(domid_t domid,
d->controller_pause_count = 1;
atomic_inc(&d->pause_count);
- if ( !is_hardware_domain(d) )
- d->nr_pirqs = nr_static_irqs + extra_domU_irqs;
- else
- d->nr_pirqs = extra_hwdom_irqs ? nr_static_irqs + extra_hwdom_irqs
- : arch_hwdom_irqs(domid);
- if ( d->nr_pirqs > nr_irqs )
- d->nr_pirqs = nr_irqs;
-
- radix_tree_init(&d->pirq_tree);
-
if ( (err = evtchn_init(d, config->max_evtchn_port)) != 0 )
goto fail;
init_status |= INIT_evtchn;
@@ -374,14 +381,7 @@ struct domain *domain_create(domid_t domid,
d->pbuf = xzalloc_array(char, DOMAIN_PBUF_SIZE);
if ( !d->pbuf )
goto fail;
- }
-
- if ( (err = arch_domain_create(d, config)) != 0 )
- goto fail;
- init_status |= INIT_arch;
- if ( !is_idle_domain(d) )
- {
if ( (err = sched_init_domain(d, 0)) != 0 )
goto fail;
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |