Renamed both `cpu_count` and `memory_size` to `cpus` and `memory` (respective).

pull/7018/head
Ali Rizvi-Santiago 8 years ago
parent 57f00dfc49
commit 24140131c7

@ -9,8 +9,8 @@ import (
type HWConfig struct {
// cpu information
CpuCount int `mapstructure:"cpu_count"`
MemorySize int `mapstructure:"memory_size"`
CpuCount int `mapstructure:"cpus"`
MemorySize int `mapstructure:"memory"`
// device presence
Sound bool `mapstructure:"sound"`
@ -22,7 +22,7 @@ func (c *HWConfig) Prepare(ctx *interpolate.Context) []error {
// Hardware and cpu options
if c.CpuCount < 0 {
errs = append(errs, fmt.Errorf("An invalid cpu_count was specified (cpu_count < 0): %d", c.CpuCount))
errs = append(errs, fmt.Errorf("An invalid number of cpus was specified (cpus < 0): %d", c.CpuCount))
c.CpuCount = 0
}
if c.CpuCount == 0 {
@ -30,7 +30,7 @@ func (c *HWConfig) Prepare(ctx *interpolate.Context) []error {
}
if c.MemorySize < 0 {
errs = append(errs, fmt.Errorf("An invalid memory_size was specified (memory_size < 0): %d", c.MemorySize))
errs = append(errs, fmt.Errorf("An invalid memory size was specified (memory < 0): %d", c.MemorySize))
c.MemorySize = 0
}
if c.MemorySize == 0 {

@ -102,7 +102,7 @@ builder.
five seconds and one minute 30 seconds, respectively. If this isn't
specified, the default is 10 seconds.
- `cpu_count` (number) - The number of cpus to use for building the VM.
- `cpus` (number) - The number of cpus to use for building the VM.
Defaults to building with just one.
- `disk_size` (number) - The size, in megabytes, of the hard disk to create
@ -176,7 +176,7 @@ builder.
URLs must point to the same file (same checksum). By default this is empty
and `iso_url` is used. Only one of `iso_url` or `iso_urls` can be specified.
- `memory_size` (number) - The amount of memory to use for building the VM in
- `memory` (number) - The amount of memory to use for building the VM in
megabytes. Defaults to `512` megabytes.
- `output_directory` (string) - This is the path to the directory where the

Loading…
Cancel
Save