aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/domain.c
diff options
context:
space:
mode:
Diffstat (limited to 'xen/common/domain.c')
-rw-r--r--xen/common/domain.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 4ca9f58135..7f5d2bafe8 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -45,7 +45,7 @@ struct domain *do_createdomain(domid_t dom_id, unsigned int cpu)
spin_lock_init(&d->page_alloc_lock);
INIT_LIST_HEAD(&d->page_list);
- d->max_pages = d->tot_pages = 0;
+ INIT_LIST_HEAD(&d->xenpage_list);
/* Per-domain PCI-device list. */
spin_lock_init(&d->pcidev_lock);
@@ -53,12 +53,13 @@ struct domain *do_createdomain(domid_t dom_id, unsigned int cpu)
if ( d->domain != IDLE_DOMAIN_ID )
{
- if ( init_event_channels(d) != 0 )
+ if ( (init_event_channels(d) != 0) || (grant_table_create(d) != 0) )
{
+ destroy_event_channels(d);
free_domain_struct(d);
return NULL;
}
-
+
/* We use a large intermediate to avoid overflow in sprintf. */
sprintf(buf, "Domain-%u", dom_id);
strncpy(d->name, buf, MAX_DOMAIN_NAME);
@@ -256,6 +257,7 @@ void domain_destruct(struct domain *d)
write_unlock_irqrestore(&tasklist_lock, flags);
destroy_event_channels(d);
+ grant_table_destroy(d);
free_perdomain_pt(d);
free_xenheap_page((unsigned long)d->shared_info);