Merge pull request #8380 from bennu/qemu-args

fix: persist default drive/device
This commit is contained in:
Megan Marsh 2019-11-18 11:05:45 -08:00 committed by GitHub
commit ef137a8f08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 7 deletions

View File

@ -266,13 +266,10 @@ func getCommandArgs(bootDrive string, state multistep.StateBag) ([]string, error
arg = defaultArgs[key].([]string)
}
inArgs[key] = arg
}
}
// Check if we are missing the netDevice #6804
if x, ok := inArgs["-device"]; ok {
if !strings.Contains(strings.Join(x, ""), config.NetDevice) {
inArgs["-device"] = append(inArgs["-device"], fmt.Sprintf("%s,netdev=user.0", config.NetDevice))
} else {
if key == "-device" || key == "-drive" {
inArgs[key] = append(defaultArgs[key].([]string), inArgs[key]...)
}
}
}