From 0f019407d6347d8229a86d53001cfe340e624cdf Mon Sep 17 00:00:00 2001 From: Ali Rizvi-Santiago Date: Thu, 22 Nov 2018 20:48:00 -0600 Subject: [PATCH] Updated things related to the general hw config in the virtualbox builders to correspond to @azr's suggestions. --- builder/virtualbox/common/hw_config.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/builder/virtualbox/common/hw_config.go b/builder/virtualbox/common/hw_config.go index 6da48bf7d..9e7079237 100644 --- a/builder/virtualbox/common/hw_config.go +++ b/builder/virtualbox/common/hw_config.go @@ -23,7 +23,6 @@ func (c *HWConfig) Prepare(ctx *interpolate.Context) []error { // Hardware and cpu options if c.CpuCount < 0 { errs = append(errs, fmt.Errorf("An invalid number of cpus was specified (cpus < 0): %d", c.CpuCount)) - c.CpuCount = 0 } if c.CpuCount == 0 { c.CpuCount = 1 @@ -31,7 +30,6 @@ func (c *HWConfig) Prepare(ctx *interpolate.Context) []error { if c.MemorySize < 0 { errs = append(errs, fmt.Errorf("An invalid memory size was specified (memory < 0): %d", c.MemorySize)) - c.MemorySize = 0 } if c.MemorySize == 0 { c.MemorySize = 512 @@ -42,5 +40,5 @@ func (c *HWConfig) Prepare(ctx *interpolate.Context) []error { c.Sound = "none" } - return nil + return errs }