[GH-1740] Fix cpu allocation bug

Signed-off-by: Fabio Rapposelli <fabio@vmware.com>
This commit is contained in:
Fabio Rapposelli 2015-08-20 15:38:31 +02:00
parent e416ac17d8
commit ffe1a7940b
1 changed files with 3 additions and 0 deletions

View File

@ -112,6 +112,9 @@ func (d *Driver) SetConfigFromFlags(flags drivers.DriverOptions) error {
// We support a maximum of 16 cpu to be consistent with Virtual Hardware 10
// specs.
if d.CPU < 1 {
d.CPU = int(runtime.NumCPU())
}
if d.CPU > 16 {
d.CPU = 16
}