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

Commit 6026603

Browse files
author
Sebastien Boeuf
committed
qemu: Don't wait for the end of the VM
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>
1 parent eeacf8b commit 6026603

1 file changed

Lines changed: 1 addition & 14 deletions

File tree

qemu.go

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,6 @@ func (q *qemu) waitPod(timeout int) error {
803803
func (q *qemu) stopPod() error {
804804
cfg := ciaoQemu.QMPConfig{Logger: newQMPLogger()}
805805
disconnectCh := make(chan struct{})
806-
const timeout = time.Duration(10) * time.Second
807806

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

821-
if err := qmp.ExecuteQuit(q.qmpMonitorCh.ctx); err != nil {
822-
return err
823-
}
824-
825-
// Wait for the VM disconnection notification
826-
select {
827-
case <-disconnectCh:
828-
break
829-
case <-time.After(timeout):
830-
return fmt.Errorf("Did not receive the VM disconnection notification (timeout %ds)", timeout)
831-
}
832-
833-
return nil
820+
return qmp.ExecuteQuit(q.qmpMonitorCh.ctx)
834821
}
835822

836823
func (q *qemu) togglePausePod(pause bool) error {

0 commit comments

Comments
 (0)