From 14fa7e2fb5c820b3fcafec2dcdff1bd4b9b94d74 Mon Sep 17 00:00:00 2001 From: steve Date: Fri, 1 Dec 2006 12:57:55 +0000 Subject: [PATCH] 2006-12-01 12:57:55 by steve Don't ignore Mb/Gb on memory size. --- bin/xt-create-xen-config | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/bin/xt-create-xen-config b/bin/xt-create-xen-config index f38d770..121fe38 100755 --- a/bin/xt-create-xen-config +++ b/bin/xt-create-xen-config @@ -96,7 +96,7 @@ xt-create-config - Create a Xen configuration file for a new guest -- http://www.steve.org.uk/ - $Id: xt-create-xen-config,v 1.25 2006-11-29 23:35:20 steve Exp $ + $Id: xt-create-xen-config,v 1.26 2006-12-01 12:57:55 steve Exp $ =cut @@ -203,7 +203,7 @@ sub parseCommandLineArguments if ( $VERSION ) { - my $REVISION = '$Revision: 1.25 $'; + my $REVISION = '$Revision: 1.26 $'; if ( $REVISION =~ /1.([0-9.]+) / ) { $REVISION = $1; @@ -302,9 +302,17 @@ sub createXenConfig # - # The memory size: Strip any trailing size characters "M", "G", etc. + # The memory size: Convert Gb -> Mb. # - if ( $ENV{'memory'} =~ /([0-9]+)/ ) + if ( $EMV{'memory'} =~ /^(\d+)Gb*$/i ) + { + $ENV{'memory'} = $1 * 1024; + } + + # + # Remove any trailing Mb. + # + if ( $ENV{'memory'} =~ /^(\d+)Mb*$/i ) { $ENV{'memory'} = $1; }