Revert: "sandbox: remove network before stopping vm"

This reverts commit 794e08e243.

It breaks vfio device passthru as we need to bind the device
back to host when removing the endpoint. And that is not possible
when qemu is still running (thus holding reference to the device).

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
This commit is contained in:
Peng Tao 2019-08-15 11:11:12 +08:00
parent 99e04ac8cd
commit d26ff71201

View File

@ -1473,11 +1473,6 @@ func (s *Sandbox) Stop(force bool) error {
} }
} }
// Remove the network.
if err := s.removeNetwork(); err != nil && !force {
return err
}
if err := s.stopVM(); err != nil && !force { if err := s.stopVM(); err != nil && !force {
return err return err
} }
@ -1486,6 +1481,11 @@ func (s *Sandbox) Stop(force bool) error {
return err return err
} }
// Remove the network.
if err := s.removeNetwork(); err != nil && !force {
return err
}
if err := s.storeSandbox(); err != nil { if err := s.storeSandbox(); err != nil {
return err return err
} }