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 1A3B91FF141 for ; Tue, 30 Jun 2026 13:05:26 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id BD68D2140E; Tue, 30 Jun 2026 13:05:20 +0200 (CEST) From: Maximiliano Sandoval To: pve-devel@lists.proxmox.com Subject: [PATCH qemu-server v3 3/3] vm start: log qemu version when starting a VM Date: Tue, 30 Jun 2026 13:04:39 +0200 Message-ID: <20260630110446.314299-4-m.sandoval@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260630110446.314299-1-m.sandoval@proxmox.com> References: <20260630110446.314299-1-m.sandoval@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1782817474414 X-SPAM-LEVEL: Spam detection results: 0 DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) 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: QAOCQ75IJZF6PW65M2L2AJVKS7UP4VNS X-Message-ID-Hash: QAOCQ75IJZF6PW65M2L2AJVKS7UP4VNS X-MailFrom: m.sandoval@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: Previously, having the system journal and task logs from a boot was not enough to determine which qemu version is installed nor the running QEMU version of a VM. This is addressed by logging pve-qemu-kvm's package version when starting the VM. The package version is obtained with the 'query-version' qmp command. Signed-off-by: Maximiliano Sandoval --- Notes: sample output in the journal: Jun 24 10:39:14 pve-148 qm[26137]: VM 100 started with PID 26166 using pve-qemu-kvm_11.0.0-4. src/PVE/QemuServer.pm | 3 ++- src/PVE/QemuServer/QMPHelpers.pm | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm index 12ac5d2d..8d88e456 100644 --- a/src/PVE/QemuServer.pm +++ b/src/PVE/QemuServer.pm @@ -5854,7 +5854,8 @@ sub vm_start_nolock { eval { PVE::QemuServer::PCI::reserve_pci_usage($pci_reserve_list, $vmid, undef, $pid) }; warn $@ if $@; - syslog("info", "VM $vmid started with PID $pid."); + my $pkg_version = PVE::QemuServer::QMPHelpers::get_qemu_package_version($vmid); + syslog("info", "VM $vmid started with PID $pid using $pkg_version."); PVE::QemuServer::RunState::create_cleanup_flag($vmid); diff --git a/src/PVE/QemuServer/QMPHelpers.pm b/src/PVE/QemuServer/QMPHelpers.pm index 4275ebb2..6f956080 100644 --- a/src/PVE/QemuServer/QMPHelpers.pm +++ b/src/PVE/QemuServer/QMPHelpers.pm @@ -19,6 +19,11 @@ sub nbd_stop($vmid) { mon_cmd($vmid, 'nbd-server-stop', timeout => 25); } +sub get_qemu_package_version($vmid) { + my $res = mon_cmd($vmid, 'query-version'); + return $res->{package}; +} + sub get_running_qemu_version($vmid) { my $res = mon_cmd($vmid, 'query-version'); return "$res->{qemu}->{major}.$res->{qemu}->{minor}"; -- 2.47.3