From 442021849dd52ea1bf31d4cded4bc733e02b54fe Mon Sep 17 00:00:00 2001 From: Axel Beckert Date: Tue, 13 Nov 2012 22:55:53 +0100 Subject: [PATCH] Also recognize M and G as size unit for --memory (Closes: #691320) Document all recognized units. --- bin/xen-create-image | 3 +++ bin/xt-create-xen-config | 4 ++-- debian/changelog | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/xen-create-image b/bin/xen-create-image index 719bba4..5df3afe 100755 --- a/bin/xen-create-image +++ b/bin/xen-create-image @@ -106,6 +106,9 @@ xen-create-image - Easily create new Xen instances with networking and OpenSSH. --memory=size Setup the amount of memory allocated to the new instance. + As suffix recognized size units are "M", "MB", "G" and + "GB" (case does not matter). If there's no unit given, + megabytes are assumed. --modules=/path/to/modules Set the path to the kernel modules to use for domU. diff --git a/bin/xt-create-xen-config b/bin/xt-create-xen-config index cddc865..8ec6e60 100755 --- a/bin/xt-create-xen-config +++ b/bin/xt-create-xen-config @@ -375,7 +375,7 @@ sub createXenConfig # # The memory size: Convert Gb -> Mb. # - if ( $ENV{ 'memory' } =~ /^(\d+)Gb.*$/i ) + if ( $ENV{ 'memory' } =~ /^(\d+)Gb?.*$/i ) { $ENV{ 'memory' } = $1 * 1024; } @@ -383,7 +383,7 @@ sub createXenConfig # # Remove any trailing Mb. # - if ( $ENV{ 'memory' } =~ /^(\d+)Mb.*$/i ) + if ( $ENV{ 'memory' } =~ /^(\d+)Mb?.*$/i ) { $ENV{ 'memory' } = $1; } diff --git a/debian/changelog b/debian/changelog index a9c4628..24e55ac 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,8 @@ xen-tools (4.3.1+dev-1) UNRELEASED; urgency=low - Move code for --boot feature to END block. Fixes missing SSH fingerprint display if --boot was used. (Closes: #679183) - Use local parameter instead of global variable in unMountImage. + - Also recognize "M" and "G" instead of "MB" and "GB" as size unit for + --memory. (Closes: #691320) Document the recognized units. -- Axel Beckert Tue, 13 Nov 2012 18:05:05 +0100