From d30ded5b5b924effb417a77f69a3ef2bdde32b9b Mon Sep 17 00:00:00 2001 From: quadrifoglio Date: Sun, 23 Oct 2016 14:33:17 +0200 Subject: [PATCH] net: disable networking if no networks interfaces --- machine.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/machine.go b/machine.go index ee74638..74b549d 100644 --- a/machine.go +++ b/machine.go @@ -76,6 +76,11 @@ func (m *Machine) Start(arch string, kvm bool) (*os.Process, error) { args = append(args, fmt.Sprintf("file=%s,format=%s", drive.Path, drive.Format)) } + if len(m.ifaces) == 0 { + args = append(args, "-net") + args = append(args, "none") + } + for _, iface := range m.ifaces { s := fmt.Sprintf("%s,id=%s", iface.Type, iface.ID) if len(iface.IfName) > 0 {