* [PATCH qemu-server 1/2] test: mock query-version qmp command
@ 2026-06-24 8:40 Maximiliano Sandoval
2026-06-24 8:40 ` [PATCH qemu-server 2/2] vm start: log qemu version when starting a VM Maximiliano Sandoval
0 siblings, 1 reply; 3+ messages in thread
From: Maximiliano Sandoval @ 2026-06-24 8:40 UTC (permalink / raw)
To: pve-devel
In the next commit we add a call to query-version to log the package
version when starting a VM.
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---
src/test/MigrationTest/QmMock.pm | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/test/MigrationTest/QmMock.pm b/src/test/MigrationTest/QmMock.pm
index 311dbb39..fa5c9989 100644
--- a/src/test/MigrationTest/QmMock.pm
+++ b/src/test/MigrationTest/QmMock.pm
@@ -54,6 +54,8 @@ my sub mocked_mon_cmd {
return [];
} elsif ($command eq 'qom-set') {
return;
+ } elsif ($command eq 'query-version') {
+ return;
}
die "mon_cmd (mocked) - implement me: $command";
}
--
2.47.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH qemu-server 2/2] vm start: log qemu version when starting a VM
2026-06-24 8:40 [PATCH qemu-server 1/2] test: mock query-version qmp command Maximiliano Sandoval
@ 2026-06-24 8:40 ` Maximiliano Sandoval
2026-06-24 8:44 ` Maximiliano Sandoval
0 siblings, 1 reply; 3+ messages in thread
From: Maximiliano Sandoval @ 2026-06-24 8:40 UTC (permalink / raw)
To: pve-devel
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 <m.sandoval@proxmox.com>
---
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 55e9f520..d6576a41 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -5839,7 +5839,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 $pgk_version = get_package_version($vmid);
+ syslog("info", "VM $vmid started with PID $pid using $pgk_version.");
PVE::QemuServer::RunState::create_cleanup_flag($vmid);
@@ -8054,6 +8055,12 @@ sub get_running_qemu_version {
return "$res->{qemu}->{major}.$res->{qemu}->{minor}";
}
+sub get_package_version {
+ my ($vmid) = @_;
+ my $res = mon_cmd($vmid, "query-version");
+ return $res->{package};
+}
+
sub qemu_use_old_bios_files {
my ($machine_type) = @_;
--
2.47.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH qemu-server 2/2] vm start: log qemu version when starting a VM
2026-06-24 8:40 ` [PATCH qemu-server 2/2] vm start: log qemu version when starting a VM Maximiliano Sandoval
@ 2026-06-24 8:44 ` Maximiliano Sandoval
0 siblings, 0 replies; 3+ messages in thread
From: Maximiliano Sandoval @ 2026-06-24 8:44 UTC (permalink / raw)
To: pve-devel
Maximiliano Sandoval <m.sandoval@proxmox.com> writes:
> 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 <m.sandoval@proxmox.com>
Reading the ->{package} directly from 'query-version', instead of using
get_running_qemu_version, was:
Suggested-by: Fiona Ebner <f.ebner@proxmox.com>
--
Maximiliano
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-06-24 8:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-24 8:40 [PATCH qemu-server 1/2] test: mock query-version qmp command Maximiliano Sandoval
2026-06-24 8:40 ` [PATCH qemu-server 2/2] vm start: log qemu version when starting a VM Maximiliano Sandoval
2026-06-24 8:44 ` Maximiliano Sandoval
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.