1
0
mirror of synced 2026-03-09 11:56:04 +00:00

Merge pull request #64 from TeamOS3/master

Add support for specifying guest type
This commit is contained in:
Axel Beckert
2023-12-11 23:54:55 +01:00
committed by GitHub
2 changed files with 12 additions and 1 deletions

View File

@@ -215,6 +215,8 @@ and EVMS EXAMPLE.
Set the number of vcpus that the new instance will
have instead of the default value of "1".
--type=type Specify the VM type to use for the new guest.
Valid choices are 'pv' (default), 'pvh', or 'pvh'.
Installation options:
@@ -1345,6 +1347,7 @@ sub setupDefaultOptions
$CONFIG{ 'ipfile' } = '/etc/xen-tools/ips.txt';
$CONFIG{ 'output' } = '/etc/xen';
$CONFIG{ 'extension' } = '.cfg';
$CONFIG{ 'type' } = 'pv'; # Arno: as per man xl.cfg
#
# Installation method defaults to "debootstrap" using
@@ -1490,6 +1493,10 @@ sub checkOption
vlan => {
check => qr/^([1-9][0-9]{0,2}|10[01][0-9]|102[0-4])$/i,
message => "must be a number between 1 and 1024.\n",
}, # Arno
guestType => {
check => qr/^pv|pvh|hvm$/, # man xl.cfg
message => "must be 'pv', 'pvh' or 'hvm'.\n",
},
);
@@ -1529,6 +1536,7 @@ sub checkOption
hash_method => 'hashMethod',
apt_proxy => 'uri',
vlan => 'vlan',
type => 'guestType', # Arno
);
# If given option does not exists in optionsTypes,
@@ -1685,7 +1693,8 @@ sub parseCommandLineArguments
"extension:s", \&checkOption,
"dontformat", \&checkOption,
"lvm_thin=s", \$CONFIG{ 'lvm_thin' },
"type:s", \&checkOption, # Arno
# Help options
"debug!", \$CONFIG{ 'debug' },
"help", \$HELP,
@@ -2719,6 +2728,7 @@ sub showSummary
}
}
logprint("Guest type : $CONFIG{'type'}\n");
logprint("Image type : $CONFIG{'image'}\n");
logprint("Memory size : $CONFIG{'memory'}\n");

View File

@@ -30,6 +30,7 @@ memory = '{$memory}'
$OUT .= "maxmem = '$maxmem'\n";
}
}
type = '{$type}'
#
# Disk device(s).