domain_create: No need to zero new domain struct as done by arch-dep code
authorKeir Fraser <keir.fraser@citrix.com>
Fri, 7 May 2010 09:02:14 +0000 (10:02 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Fri, 7 May 2010 09:02:14 +0000 (10:02 +0100)
Fix ia64 to always make this the case.

Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
xen/arch/ia64/xen/domain.c
xen/common/domain.c

index 7e48b66d40bcd4c3a18ec110b1118fe3cad24f76..a15f9405612e12452831fbaf10bee7573d15a272 100644 (file)
@@ -407,20 +407,21 @@ void relinquish_vcpu_resources(struct vcpu *v)
 
 struct domain *alloc_domain_struct(void)
 {
-#ifdef CONFIG_IA64_PICKLE_DOMAIN
        struct domain *d;
+#ifdef CONFIG_IA64_PICKLE_DOMAIN
        /*
         * We pack the MFN of the domain structure into a 32-bit field within
         * the page_info structure. Hence the MEMF_bits() restriction.
         */
        d = alloc_xenheap_pages(get_order_from_bytes(sizeof(*d)),
                                MEMF_bits(32 + PAGE_SHIFT));
+#else
+       d = xmalloc(struct domain);
+#endif
+
        if ( d != NULL )
                memset(d, 0, sizeof(*d));
        return d;
-#else
-       return xmalloc(struct domain);
-#endif
 }
 
 void free_domain_struct(struct domain *d)
index 2cd867e814440c588360f950a39ec67839b79887..2759972b76a48409b0e4bd660e9f1a8492d79f7a 100644 (file)
@@ -223,7 +223,6 @@ struct domain *domain_create(
     if ( (d = alloc_domain_struct()) == NULL )
         return NULL;
 
-    memset(d, 0, sizeof(*d));
     d->domain_id = domid;
 
     lock_profile_register_struct(LOCKPROF_TYPE_PERDOM, d, domid, "Domain");