network: Always bind back physical interfaces

In case of physical network interfaces, we explicitly
pass through them to the VM. We need to bind them back to
the host driver when the sandbox is stopped, irrespective if
the network namespace has been created by virtcontainers or not.

Fixes #384

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
This commit is contained in:
Archana Shinde
2018-06-11 12:46:08 -07:00
parent 1aff702a38
commit f2d9632bc0
5 changed files with 48 additions and 30 deletions

View File

@@ -918,11 +918,7 @@ func (s *Sandbox) createNetwork() error {
}
func (s *Sandbox) removeNetwork() error {
if s.networkNS.NetNsCreated {
return s.network.remove(s, s.networkNS)
}
return nil
return s.network.remove(s, s.networkNS, s.networkNS.NetNsCreated)
}
// startVM starts the VM.