mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-09-02 05:37:51 +00:00
Merge pull request #20841 from ashley-cui/wsldeadlock
Fix locking error in WSL machine rm -f
This commit is contained in:
commit
f2f7d60741
1 changed files with 3 additions and 3 deletions
|
|
@ -1591,9 +1591,6 @@ func readWinProxyTid(v *MachineVM) (uint32, uint32, string, error) {
|
|||
func (v *MachineVM) Remove(name string, opts machine.RemoveOptions) (string, func() error, error) {
|
||||
var files []string
|
||||
|
||||
v.lock.Lock()
|
||||
defer v.lock.Unlock()
|
||||
|
||||
if v.isRunning() {
|
||||
if !opts.Force {
|
||||
return "", nil, &machine.ErrVMRunningCannotDestroyed{Name: v.Name}
|
||||
|
|
@ -1603,6 +1600,9 @@ func (v *MachineVM) Remove(name string, opts machine.RemoveOptions) (string, fun
|
|||
}
|
||||
}
|
||||
|
||||
v.lock.Lock()
|
||||
defer v.lock.Unlock()
|
||||
|
||||
// Collect all the files that need to be destroyed
|
||||
if !opts.SaveKeys {
|
||||
files = append(files, v.IdentityPath, v.IdentityPath+".pub")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue