1
0
mirror of synced 2026-02-23 15:12:13 +00:00

Fix cases where maxmem is not defined

(which is fine)
This commit is contained in:
Axel Beckert
2013-10-28 21:57:10 +01:00
parent b676da079c
commit c82cb31adc

View File

@@ -377,17 +377,20 @@ sub createXenConfig
#
# The maxmem size: Convert Gb -> Mb.
#
if ( $ENV{ 'maxmem' } =~ /^(\d+)Gb?.*$/i )
{
$ENV{ 'maxmem' } = $1 * 1024;
}
if ( exists($ENV{ 'maxmem' }) and defined($ENV{ 'maxmem' })) {
if ($ENV{ 'maxmem' } =~ /^(\d+)Gb?.*$/i )
{
$ENV{ 'maxmem' } = $1 * 1024;
}
#
# Remove any trailing Mb.
#
if ( $ENV{ 'maxmem' } =~ /^(\d+)Mb?.*$/i )
{
$ENV{ 'maxmem' } = $1;
if ( $ENV{ 'maxmem' } =~ /^(\d+)Mb?.*$/i )
{
$ENV{ 'maxmem' } = $1;
}
}
#