summaryrefslogtreecommitdiff
path: root/pkg/machine
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/machine')
-rw-r--r--pkg/machine/qemu/machine.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/pkg/machine/qemu/machine.go b/pkg/machine/qemu/machine.go
index 5d1ba511c..81bc98098 100644
--- a/pkg/machine/qemu/machine.go
+++ b/pkg/machine/qemu/machine.go
@@ -439,6 +439,19 @@ func (v *MachineVM) Set(_ string, opts machine.SetOptions) error {
return nil
}
+ running, err := v.isRunning()
+ if err != nil {
+ return err
+ }
+
+ if running {
+ suffix := ""
+ if v.Name != machine.DefaultMachineName {
+ suffix = " " + v.Name
+ }
+ return errors.Errorf("cannot change setting while the vm is running, run 'podman machine stop%s' first", suffix)
+ }
+
changeCon, err := machine.AnyConnectionDefault(v.Name, v.Name+"-root")
if err != nil {
return err