From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 9BFAC1FF0C2 for ; Thu, 22 Oct 2026 14:52:01 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 4E546218C7; Thu, 22 Oct 2026 14:51:34 +0200 (CEST) From: Jakob Klocker To: pve-devel@lists.proxmox.com Subject: [PATCH qemu-server v2 7/8] vm_reboot: warn when rebooting a VM with `reboot` disabled Date: Thu, 22 Oct 2026 14:51:10 +0200 Message-ID: <20261022125111.236538-8-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: 1792673489410 X-SPAM-LEVEL: Spam detection results: 0 AWL 1.551 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: JVE3JYQ3SUOYXD7E7Q5OL3WJGUIV3TUP X-Message-ID-Hash: JVE3JYQ3SUOYXD7E7Q5OL3WJGUIV3TUP 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: When `reboot` is set to 0, a reboot requested via `qm reboot` or the API only stops the VM. Log a warning in the task log so users know why the VM was not restarted. Signed-off-by: Jakob Klocker --- src/PVE/QemuServer.pm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm index 011d175f..f5ba04f0 100644 --- a/src/PVE/QemuServer.pm +++ b/src/PVE/QemuServer.pm @@ -6248,6 +6248,15 @@ sub vm_reboot { my $storecfg = PVE::Storage::config(); _do_vm_stop($storecfg, $vmid, undef, undef, $timeout, 1); + # Load the config only after the stop: a pending change to 'reboot' is applied + # when the VM stops, so this is the value that decides whether it gets restarted + my $conf = PVE::QemuConfig->load_config($vmid); + my $reboot = parse_reboot($conf->{reboot}); + if (!($reboot->{enabled} // 1)) { + my $rpcenv = PVE::RPCEnvironment::get(); + $rpcenv->warn("VM $vmid: reboot is disabled -" + . " the VM was shut down instead of rebooted."); + } }; if (my $err = $@) { # avoid that the next normal shutdown will be confused for a reboot -- 2.47.3