Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
Revert: "sandbox: remove network before stopping vm"
Browse files Browse the repository at this point in the history
This reverts commit 794e08e.

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 <[email protected]>
  • Loading branch information
bergwolf committed Aug 15, 2019
1 parent 99e04ac commit d26ff71
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions virtcontainers/sandbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -1473,16 +1473,16 @@ func (s *Sandbox) Stop(force bool) error {
}
}

// Remove the network.
if err := s.removeNetwork(); err != nil && !force {
if err := s.stopVM(); err != nil && !force {
return err
}

if err := s.stopVM(); err != nil && !force {
if err := s.setSandboxState(types.StateStopped); err != nil {
return err
}

if err := s.setSandboxState(types.StateStopped); err != nil {
// Remove the network.
if err := s.removeNetwork(); err != nil && !force {
return err
}

Expand Down

0 comments on commit d26ff71

Please sign in to comment.