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; }