From: Keir Fraser Date: Fri, 7 May 2010 09:02:14 +0000 (+0100) Subject: domain_create: No need to zero new domain struct as done by arch-dep code X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~12216 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=5c89fad4283102c1d3b4781cb3e283d0e7302284;p=xen.git domain_create: No need to zero new domain struct as done by arch-dep code Fix ia64 to always make this the case. Signed-off-by: Xiao Guangrong --- diff --git a/xen/arch/ia64/xen/domain.c b/xen/arch/ia64/xen/domain.c index 7e48b66d40..a15f940561 100644 --- a/xen/arch/ia64/xen/domain.c +++ b/xen/arch/ia64/xen/domain.c @@ -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) diff --git a/xen/common/domain.c b/xen/common/domain.c index 2cd867e814..2759972b76 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -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");