From d26ff71201365afe1f3a5eeb87033a465dafbe87 Mon Sep 17 00:00:00 2001 From: Peng Tao Date: Thu, 15 Aug 2019 11:11:12 +0800 Subject: [PATCH] Revert: "sandbox: remove network before stopping vm" This reverts commit 794e08e243a63947f063ac0c68be7d91db65aee3. 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 --- virtcontainers/sandbox.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/virtcontainers/sandbox.go b/virtcontainers/sandbox.go index 7b8a79352c..f8f744fd5a 100644 --- a/virtcontainers/sandbox.go +++ b/virtcontainers/sandbox.go @@ -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 { return err } @@ -1486,6 +1481,11 @@ func (s *Sandbox) Stop(force bool) error { return err } + // Remove the network. + if err := s.removeNetwork(); err != nil && !force { + return err + } + if err := s.storeSandbox(); err != nil { return err }