From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hollis Blanchard Subject: Re: [kvm-ppc-devel] [PATCH 7 of 7] Add ability to specify ram on command line for bamboo board model Date: Wed, 12 Mar 2008 21:23:26 -0500 Message-ID: <1205375006.9736.8.camel@basalt> References: <8b1dd3609551efefbd66.1205297446@thinkpad.austin.ibm.com> Reply-To: Hollis Blanchard Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-ppc-devel@lists.sourceforge.net, kvm-devel@lists.sourceforge.net To: Jerone Young Return-path: In-Reply-To: <8b1dd3609551efefbd66.1205297446@thinkpad.austin.ibm.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces@lists.sourceforge.net Errors-To: kvm-devel-bounces@lists.sourceforge.net List-Id: kvm.vger.kernel.org On Tue, 2008-03-11 at 23:50 -0500, Jerone Young wrote: > # HG changeset patch > # User Jerone Young > # Date 1205296680 18000 > # Branch merge > # Node ID 8b1dd3609551efefbd6633ac6fe4caa3a6cbe5e9 > # Parent 3a891d8fada96166089b5796f3241087d4aae50f > Add ability to specify ram on command line for bamboo board model > > This patch adds the ability to now specify ram sizes on the command line. > Due to the nature of the code there are restictions on exactly how > much ram and the multiple that the size must match. > > Signed-off-by: Jerone Young NAK, this is both brittle and overcomplicated. Try translating the following Python to C: ram = 144 reg = [0, 0, 0, 0] sizes = (256, 128, 64, 32, 16, 8) for i in range(len(reg)): for size in sizes: if ram / size: reg[i] = size ram -= size break if ram: print "warning: %d left over" % ram print reg -- Hollis Blanchard IBM Linux Technology Center ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/