mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-29 16:57:18 +00:00
qemu: do not try to stop qemu multiple times
We've cleaned it up the first time. Future stop will only fail. Fixes: #1958 Signed-off-by: Peng Tao <bergwolf@hyper.sh>
This commit is contained in:
parent
9ea469bcfa
commit
b58ab66f05
@ -93,6 +93,8 @@ type qemu struct {
|
||||
ctx context.Context
|
||||
|
||||
nvdimmCount int
|
||||
|
||||
stopped bool
|
||||
}
|
||||
|
||||
const (
|
||||
@ -835,8 +837,16 @@ func (q *qemu) stopSandbox() error {
|
||||
span, _ := q.trace("stopSandbox")
|
||||
defer span.Finish()
|
||||
|
||||
defer q.cleanupVM()
|
||||
q.Logger().Info("Stopping Sandbox")
|
||||
if q.stopped {
|
||||
q.Logger().Info("Already stopped")
|
||||
return nil
|
||||
}
|
||||
|
||||
defer func() {
|
||||
q.cleanupVM()
|
||||
q.stopped = true
|
||||
}()
|
||||
|
||||
err := q.qmpSetup()
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user