Keeping the -machine type=pc if accelerator method set to "none"

This commit is contained in:
Matthew Baker 2014-08-07 04:08:50 -07:00
parent 99d15abfd2
commit b8c13d3e4d
1 changed files with 4 additions and 2 deletions

View File

@ -77,12 +77,14 @@ func getCommandArgs(bootDrive string, state multistep.StateBag) ([]string, error
}
defaultArgs["-name"] = vmName
accelMethod := ""
if config.Accelerator != "none" {
defaultArgs["-machine"] = fmt.Sprintf("type=pc,accel=%s", config.Accelerator)
accelMethod = fmt.Sprintf(",accel=%s", config.Accelerator)
} else {
ui.Message("WARNING: The VM will be started with no hardware acceleration.\n" +
"The installation will take considerably longer to finish\n")
"The installation may take considerably longer to finish\n")
}
defaultArgs["-machine"] = fmt.Sprintf("type=pc%s", accelMethod)
defaultArgs["-netdev"] = "user,id=user.0"
defaultArgs["-device"] = fmt.Sprintf("%s,netdev=user.0", config.NetDevice)
defaultArgs["-drive"] = fmt.Sprintf("file=%s,if=%s", imgPath, config.DiskInterface)