From 30ccab472f263552428e5c1685d189336fad2872 Mon Sep 17 00:00:00 2001 From: bugbuilder Date: Sun, 17 Nov 2019 04:38:30 -0300 Subject: [PATCH] fix: persist default drive/device --- builder/qemu/step_run.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/builder/qemu/step_run.go b/builder/qemu/step_run.go index e8c327f4a..c50195631 100644 --- a/builder/qemu/step_run.go +++ b/builder/qemu/step_run.go @@ -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]...) + } } }