From: Jakob Klocker <j.klocker@proxmox.com>
To: pve-devel@lists.proxmox.com
Cc: Jakob Klocker <j.klocker@proxmox.com>
Subject: [PATCH qemu-server 1/6] qm: do not restart VM when 'reboot' is disabled
Date: Thu, 13 Aug 2026 13:27:12 +0200 [thread overview]
Message-ID: <20260813112717.272254-2-j.klocker@proxmox.com> (raw)
In-Reply-To: <20260813112717.272254-1-j.klocker@proxmox.com>
The `reboot` option is documented as making the VM exit instead of
rebooting when set to `0`, but `qm cleanup` restarts it regardless.
Only restart if the option is not disabled. This also covers reboots
requested through `qm reboot` or the API, which so far restarted the VM
even with `reboot` set to '0'.
Signed-off-by: Jakob Klocker <j.klocker@proxmox.com>
---
src/PVE/CLI/qm.pm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/PVE/CLI/qm.pm b/src/PVE/CLI/qm.pm
index b903c1f1..f35b8a30 100755
--- a/src/PVE/CLI/qm.pm
+++ b/src/PVE/CLI/qm.pm
@@ -1160,8 +1160,9 @@ __PACKAGE__->register_method({
PVE::GuestHelpers::exec_hookscript($conf, $vmid, 'post-stop');
}
- $restart = eval { PVE::QemuServer::clear_reboot_request($vmid) };
+ my $reboot_requested = eval { PVE::QemuServer::clear_reboot_request($vmid) };
warn $@ if $@;
+ $restart = $reboot_requested && ($conf->{reboot} // 1);
},
);
--
2.47.3
next prev parent reply other threads:[~2026-08-13 11:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-13 11:27 [PATCH docs/manager/qemu-server 0/6] fix #7213: add `powercycle` reboot behavior Jakob Klocker
2026-08-13 11:27 ` Jakob Klocker [this message]
2026-08-13 11:27 ` [PATCH qemu-server 2/6] fix #7213: config: add `powercycle` sub-property to `reboot` Jakob Klocker
2026-08-13 11:27 ` [PATCH qemu-server 3/6] fix #7213: qm: cleanup: add `reset` parameter to honor `powercycle` Jakob Klocker
2026-08-13 11:27 ` [PATCH qemu-server 4/6] fix #7213: qmeventd: pass `reset` to `qm cleanup` Jakob Klocker
2026-08-13 11:27 ` [PATCH pve-manager 5/6] ui: qemu: options: add editor for reboot behavior Jakob Klocker
2026-08-13 11:27 ` [PATCH pve-docs 6/6] qm: add reboot behavior information Jakob Klocker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260813112717.272254-2-j.klocker@proxmox.com \
--to=j.klocker@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox