aboutsummaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorBrent Baude <bbaude@redhat.com>2022-03-08 15:44:40 -0600
committerJason T. Greene <jason.greene@redhat.com>2022-03-18 15:06:57 -0500
commit35b2d951b2f648632f4b358ddb470acd2a41483f (patch)
tree60474eb1e7b79e43564e414bd2480a557270b273 /pkg
parent76a910b16934cc801fabc5dfa2c6c25731efbe97 (diff)
downloadpodman-35b2d951b2f648632f4b358ddb470acd2a41483f.tar.gz
podman-35b2d951b2f648632f4b358ddb470acd2a41483f.tar.bz2
podman-35b2d951b2f648632f4b358ddb470acd2a41483f.zip
machine rm -f stops and removes machine
If you want to remove a running machine, you can now pass the --force/-f to podman machine rm and the machine will be stopped and removed without confirmations. Fixes: #13448 [NO NEW TESTS NEEDED] Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'pkg')
-rw-r--r--pkg/machine/qemu/machine.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/machine/qemu/machine.go b/pkg/machine/qemu/machine.go
index 2f399b60e..e4e2824d2 100644
--- a/pkg/machine/qemu/machine.go
+++ b/pkg/machine/qemu/machine.go
@@ -679,7 +679,7 @@ func (v *MachineVM) Remove(name string, opts machine.RemoveOptions) (string, fun
if err != nil {
return "", nil, err
}
- if running {
+ if running && !opts.Force {
return "", nil, errors.Errorf("running vm %q cannot be destroyed", v.Name)
}