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-ppc-devel

Re: [XenPPC][Patch] memory alignment check for allocMem

To: geyi <kudva@xxxxxxxxxxxxxx>
Subject: Re: [XenPPC][Patch] memory alignment check for allocMem
From: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
Date: Mon, 20 Nov 2006 11:20:00 -0500
Cc: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Mon, 20 Nov 2006 08:20:07 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <4561BF3C.60009@xxxxxxxxxxxxxx>
List-help: <mailto:xen-ppc-devel-request@lists.xensource.com?subject=help>
List-id: Xen PPC development <xen-ppc-devel.lists.xensource.com>
List-post: <mailto:xen-ppc-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=unsubscribe>
References: <4561BF3C.60009@xxxxxxxxxxxxxx>
Sender: xen-ppc-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thanks Yi, Actually the typo was that I wanted to use "%" for modulo. I'd prefer that because number bigger than int are a little wierd in python (at least to me).

BTW: why do you have 2 hunks in your diff?
-JX
On Nov 20, 2006, at 9:44 AM, geyi wrote:



--
Yi Ge <kudva@xxxxxxxxxxxxxx>
# HG changeset patch
# User gy@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
# Date 1163804143 18000
# Node ID 210a82811d4e76edc319c67aae95361c1fd1908f
# Parent  8b64454006bbf0166b022728c1fc15b71fea426e
[XenPPC] change the memory size alignment check

Signed-off-by: Yi Ge <kudva@xxxxxxxxxxxxxx>

diff -r 8b64454006bb -r 210a82811d4e tools/python/xen/xend/ XendDomainInfo.py --- a/tools/python/xen/xend/XendDomainInfo.py Fri Nov 17 17:46:25 2006 -0500 +++ b/tools/python/xen/xend/XendDomainInfo.py Fri Nov 17 17:55:43 2006 -0500
@@ -1382,7 +1382,7 @@ class Common_XendDomainInfo:
         if memory < rma_kb:
raise ValueError("Domain memory must be at least %d KB" % rma_kb)

-        if memory & (16 << 10):
+        if memory & ((16 << 10) - 1):
raise ValueError("Domain memory %dKB must be a multiple of 16MB"
                              % memory)

@@ -2080,7 +2080,7 @@ class XendDomainInfo (Common_XendDomainI
         if memory < rma_kb:
raise ValueError("Domain memory must be at least %d KB" % rma_kb)

-        if memory & (16 << 10):
+        if memory & ((16 << 10) - 1):
raise ValueError("Domain memory %dKB must be a multiple of 16MB"
                              % memory)


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


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