WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 2/2] small cleanup for domain_create()

To: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH 2/2] small cleanup for domain_create()
From: Xiao Guangrong <xiaoguangrong@xxxxxxxxxxxxxx>
Date: Fri, 07 May 2010 16:52:46 +0800
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Fri, 07 May 2010 02:02:09 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4BE3D48E.3010803@xxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <4BE3D48E.3010803@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.24 (Windows/20100228)
'struct domain' is always set to zero when it allocated, the only
exception is not defined 'CONFIG_IA64_PICKLE_DOMAIN' in ia64 architecture,
so we set it to zero in this case instead of in domain_create() function.

Signed-off-by: Xiao Guangrong <xiaoguangrong@xxxxxxxxxxxxxx>

diff -r ccae861f52f7 -r 632487ba7f63 xen/arch/ia64/xen/domain.c
--- a/xen/arch/ia64/xen/domain.c        Thu May 06 11:59:55 2010 +0100
+++ b/xen/arch/ia64/xen/domain.c        Fri May 07 22:48:33 2010 +0800
@@ -407,20 +407,21 @@
 
 struct domain *alloc_domain_struct(void)
 {
+       struct domain *d;
 #ifdef CONFIG_IA64_PICKLE_DOMAIN
-       struct domain *d;
        /*
         * 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 -r ccae861f52f7 -r 632487ba7f63 xen/common/domain.c
--- a/xen/common/domain.c       Thu May 06 11:59:55 2010 +0100
+++ b/xen/common/domain.c       Fri May 07 22:48:33 2010 +0800
@@ -223,7 +223,6 @@
     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");


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>