From e40c90423f5ea05edbed7806f2c3bc49820f8e92 Mon Sep 17 00:00:00 2001 From: Ed Maxwell-Lyte <2248005+edwardmlyte@users.noreply.github.com> Date: Tue, 8 Jan 2019 14:14:21 +0000 Subject: [PATCH] Reverse default port count virtualbox argument As we know the exact versions that used the old `sataportcount` option, it's safe to assume we want to use the newer `portcount` option for everything else. Reversed the option check and use the `portcount` option by default. Prevents needing to update this for future major versions of VirtualBox. --- builder/virtualbox/common/driver_4_2.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/builder/virtualbox/common/driver_4_2.go b/builder/virtualbox/common/driver_4_2.go index b5dc64c67..54ec4ddde 100644 --- a/builder/virtualbox/common/driver_4_2.go +++ b/builder/virtualbox/common/driver_4_2.go @@ -24,9 +24,9 @@ func (d *VBox42Driver) CreateSATAController(vmName string, name string, portcoun return err } - portCountArg := "--sataportcount" - if strings.HasPrefix(version, "4.3") || strings.HasPrefix(version, "5.") || strings.HasPrefix(version, "6.") { - portCountArg = "--portcount" + portCountArg = "--portcount" + if strings.HasPrefix(version, "1.") || strings.HasPrefix(version, "2.") || strings.HasPrefix(version, "3.") || strings.HasPrefix(version, "4.0") || strings.HasPrefix(version, "4.1") || strings.HasPrefix(version, "4.2") { + portCountArg := "--sataportcount" } command := []string{