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 1A3DE1FF141 for ; Tue, 30 Jun 2026 10:08:52 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id CADE22140F; Tue, 30 Jun 2026 10:08:50 +0200 (CEST) Message-ID: <30d7c444-a59b-48f9-89f5-47ebb6fcba01@proxmox.com> Date: Tue, 30 Jun 2026 10:08:41 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH qemu-server v2 2/2] vm start: log qemu version when starting a VM To: Maximiliano Sandoval , pve-devel@lists.proxmox.com References: <20260630070351.55073-1-m.sandoval@proxmox.com> <20260630070351.55073-3-m.sandoval@proxmox.com> Content-Language: en-US From: Fiona Ebner In-Reply-To: <20260630070351.55073-3-m.sandoval@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1782806914202 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: QY44DQDEEQMGODJI3R3I46PIERWMKO7H X-Message-ID-Hash: QY44DQDEEQMGODJI3R3I46PIERWMKO7H X-MailFrom: f.ebner@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: Am 30.06.26 um 9:04 AM schrieb Maximiliano Sandoval: > 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 | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm > index cdf66e89..3ecd16a7 100644 > --- a/src/PVE/QemuServer.pm > +++ b/src/PVE/QemuServer.pm > @@ -5853,7 +5853,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 = get_qemu_package_version($vmid); > + syslog("info", "VM $vmid started with PID $pid using $pkg_version."); > > PVE::QemuServer::RunState::create_cleanup_flag($vmid); > > @@ -8068,6 +8069,12 @@ sub get_running_qemu_version { > return "$res->{qemu}->{major}.$res->{qemu}->{minor}"; > } > > +sub get_qemu_package_version { If you want to keep it beside get_running_qemu_version(), then that one should be moved to QMPHelpers as well. The main QemuServer.pm module is already bloated enough. We should take the opportunities to reduce it. > + my ($vmid) = @_; > + my $res = mon_cmd($vmid, "query-version"); > + return $res->{package}; > +}> + > sub qemu_use_old_bios_files { > my ($machine_type) = @_; >