summaryrefslogtreecommitdiff
path: root/pkg/machine/qemu
diff options
context:
space:
mode:
authorBrent Baude <bbaude@redhat.com>2022-03-08 15:44:40 -0600
committerBrent Baude <bbaude@redhat.com>2022-03-08 15:47:32 -0600
commit5b51b42cc86d6fe394e13ae9dd91f2ddefdb543e (patch)
tree058fa39cea567f574df47631c2ded1b7d9338a35 /pkg/machine/qemu
parentf33b64d8b7d7b2bd22560cfacc90e25d1f9e16b4 (diff)
downloadpodman-5b51b42cc86d6fe394e13ae9dd91f2ddefdb543e.tar.gz
podman-5b51b42cc86d6fe394e13ae9dd91f2ddefdb543e.tar.bz2
podman-5b51b42cc86d6fe394e13ae9dd91f2ddefdb543e.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/machine/qemu')
-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 43a79dae8..92d8d1854 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)
}