Skip to content

Commit

Permalink
remove pid, sock, and qmp files on stop
Browse files Browse the repository at this point in the history
  • Loading branch information
idroz committed May 10, 2023
1 parent f3a7344 commit 67e7267
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions qemu/ops.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,18 @@ func (c *MachineConfig) Stop() error {
if procErr != nil {
return procErr
}

if err := p.Signal(syscall.SIGKILL); err != nil {
return err
}

pidFile := filepath.Join(c.Location, "alpine.pid")
sockFile := filepath.Join(c.Location, "alpine.sock")
qmpFile := filepath.Join(c.Location, "alpine.qmp")
os.Remove(pidFile)
os.Remove(sockFile)
os.Remove(qmpFile)

log.Println(c.Alias + " stopped")
return nil
} else {
Expand Down

0 comments on commit 67e7267

Please sign in to comment.