On Tue, 2008-03-11 at 23:50 -0500, Jerone Young wrote:
> # HG changeset patch
> # User Jerone Young <[EMAIL PROTECTED]>
> # 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 <[EMAIL PROTECTED]>

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/
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to