From 5b51b42cc86d6fe394e13ae9dd91f2ddefdb543e Mon Sep 17 00:00:00 2001 From: Brent Baude Date: Tue, 8 Mar 2022 15:44:40 -0600 Subject: 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 --- pkg/machine/qemu/machine.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkg') 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) } -- cgit v1.2.3-54-g00ecf