Renamed both `cpu_count` and `memory_size` to `cpus` and `memory` (respective).
This commit is contained in:
parent
5467edbbc0
commit
fb7ce9f2b5
|
@ -12,8 +12,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"`
|
||||
|
||||
// network type and adapter
|
||||
Network string `mapstructure:"network"`
|
||||
|
@ -33,7 +33,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 {
|
||||
|
@ -41,7 +41,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 amount of memory was specified (memory < 0): %d", c.MemorySize))
|
||||
c.MemorySize = 0
|
||||
}
|
||||
if c.MemorySize == 0 {
|
||||
|
|
|
@ -98,7 +98,7 @@ builder.
|
|||
five seconds and one minute 30 seconds, respectively. If this isn't
|
||||
specified, the default is `10s` or 10 seconds.
|
||||
|
||||
- `cpu_count` (number) - The number of cpus to use when building the VM.
|
||||
- `cpus` (number) - The number of cpus to use when building the VM.
|
||||
Defaults to building with just one.
|
||||
|
||||
- `cdrom_adapter_type` (string) - The adapter type (or bus) that will be used
|
||||
|
@ -224,7 +224,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 when building the VM
|
||||
- `memory` (number) - The amount of memory to use when building the VM
|
||||
in megabytes. Defaults to `512` megabytes.
|
||||
|
||||
- `network` (string) - This is the network type that the virtual machine will
|
||||
|
|
Loading…
Reference in New Issue