mirror of
https://github.com/aljazceru/kata-containers.git
synced 2026-01-20 23:04:22 +01:00
Merge pull request #1959 from bergwolf/stopvm
qemu: do not try to stop qemu multiple times
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user