From 7d8f1c01c43b2dd1bfbe74897e1411719382b3be Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Tue, 3 Dec 2019 04:42:11 -0800 Subject: [PATCH] Revert "fix: persist default drive/device" (#8440) This reverts commit 30ccab4 which introduced the issue 8436. --- builder/qemu/step_run.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/builder/qemu/step_run.go b/builder/qemu/step_run.go index c50195631..e8c327f4a 100644 --- a/builder/qemu/step_run.go +++ b/builder/qemu/step_run.go @@ -266,10 +266,13 @@ func getCommandArgs(bootDrive string, state multistep.StateBag) ([]string, error arg = defaultArgs[key].([]string) } inArgs[key] = arg - } else { - if key == "-device" || key == "-drive" { - inArgs[key] = append(defaultArgs[key].([]string), inArgs[key]...) - } + } + } + + // 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)) } }