From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 3AF351FF0C2 for ; Thu, 22 Oct 2026 14:51:32 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 086D2217A7; Thu, 22 Oct 2026 14:51:32 +0200 (CEST) From: Jakob Klocker To: pve-devel@lists.proxmox.com Subject: [PATCH qemu-server v2 3/8] qm: do not restart VM when `reboot` is disabled Date: Thu, 22 Oct 2026 14:51:06 +0200 Message-ID: <20261022125111.236538-4-j.klocker@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261022125111.236538-1-j.klocker@proxmox.com> References: <20261022125111.236538-1-j.klocker@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1792673489081 X-SPAM-LEVEL: Spam detection results: 0 AWL 1.617 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: MMABTFRDE5OOSCDNFSKFEOIEGPDITMS5 X-Message-ID-Hash: MMABTFRDE5OOSCDNFSKFEOIEGPDITMS5 X-MailFrom: j.klocker@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 --- 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