Skip to content
This repository has been archived by the owner on Apr 3, 2018. It is now read-only.

Commit

Permalink
qemu: Don't wait for the end of the VM
Browse files Browse the repository at this point in the history
This patch brings in a real improvement about the time it takes
to delete the pod. This is because it does not wait anymore for
the end of the VM. Indeed, as long as we have called into QMP to
shutdown the VM, this is not Clear Containers responsibility if
the VM cannot be stopped for any reason. It basically should not
happen.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
  • Loading branch information
Sebastien Boeuf committed Nov 16, 2017
1 parent eeacf8b commit 6026603
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,6 @@ func (q *qemu) waitPod(timeout int) error {
func (q *qemu) stopPod() error {
cfg := ciaoQemu.QMPConfig{Logger: newQMPLogger()}
disconnectCh := make(chan struct{})
const timeout = time.Duration(10) * time.Second

q.Logger().Info("Stopping Pod")
qmp, _, err := ciaoQemu.QMPStart(q.qmpControlCh.ctx, q.qmpControlCh.path, cfg, disconnectCh)
Expand All @@ -818,19 +817,7 @@ func (q *qemu) stopPod() error {
return err
}

if err := qmp.ExecuteQuit(q.qmpMonitorCh.ctx); err != nil {
return err
}

// Wait for the VM disconnection notification
select {
case <-disconnectCh:
break
case <-time.After(timeout):
return fmt.Errorf("Did not receive the VM disconnection notification (timeout %ds)", timeout)
}

return nil
return qmp.ExecuteQuit(q.qmpMonitorCh.ctx)
}

func (q *qemu) togglePausePod(pause bool) error {
Expand Down

0 comments on commit 6026603

Please sign in to comment.