Skip to content

Commit

Permalink
net: disable networking if no networks interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
quadrifoglio committed Oct 23, 2016
1 parent dcdc535 commit d30ded5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit d30ded5

Please sign in to comment.