do_initcalls();
/* Create initial domain 0. */
- hardware_domain = dom0 = domain_create(0, 0, 0);
+ dom0 = domain_create(0, 0, 0);
if ( IS_ERR(dom0) || (alloc_dom0_vcpu0(dom0) == NULL) )
panic("Error creating domain 0");
panic("Could not protect TXT memory regions");
/* Create initial domain 0. */
- hardware_domain = dom0 = domain_create(0, DOMCRF_s3_integrity, 0);
+ dom0 = domain_create(0, DOMCRF_s3_integrity, 0);
if ( IS_ERR(dom0) || (alloc_dom0_vcpu0(dom0) == NULL) )
panic("Error creating domain 0");
else if ( domcr_flags & DOMCRF_pvh )
d->guest_type = guest_type_pvh;
- if ( is_hardware_domain(d) )
+ if ( domid == 0 )
{
d->is_pinned = opt_dom0_vcpus_pin;
d->disable_migrate = 1;
+ hardware_domain = d;
}
rangeset_domain_initialise(d);
fail:
d->is_dying = DOMDYING_dead;
+ if ( hardware_domain == d )
+ hardware_domain = NULL;
atomic_set(&d->refcnt, DOMAIN_DESTROYED);
xfree(d->mem_event);
xfree(d->pbuf);
* Use this check when the following are both true:
* - Using this feature or interface requires full access to the hardware
* (that is, this would not be suitable for a driver domain)
- * - There is never a reason to deny dom0 access to this
+ * - There is never a reason to deny the hardware domain access to this
*/
-#define is_hardware_domain(_d) ((_d)->domain_id == 0)
+#define is_hardware_domain(_d) ((_d) == hardware_domain)
/* This check is for functionality specific to a control domain */
#define is_control_domain(_d) ((_d)->is_privileged)