public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [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
  2026-06-29 14:12 ` [PATCH qemu-server 1/2] test: mock query-version qmp command Fiona Ebner
  0 siblings, 2 replies; 7+ 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] 7+ 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
  2026-06-29 14:12   ` Fiona Ebner
  2026-06-29 14:12 ` [PATCH qemu-server 1/2] test: mock query-version qmp command Fiona Ebner
  1 sibling, 2 replies; 7+ 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] 7+ 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
  2026-06-29 14:12   ` Fiona Ebner
  1 sibling, 0 replies; 7+ 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] 7+ messages in thread

* Re: [PATCH qemu-server 1/2] test: mock query-version qmp command
  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-29 14:12 ` Fiona Ebner
  1 sibling, 0 replies; 7+ messages in thread
From: Fiona Ebner @ 2026-06-29 14:12 UTC (permalink / raw)
  To: Maximiliano Sandoval, pve-devel

Am 24.06.26 um 10:41 AM schrieb Maximiliano Sandoval:
> 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;

Please return an actual (dummy) result as the command would, to make the
testing more realistic.

>      }
>      die "mon_cmd (mocked) - implement me: $command";
>  }

Please use a cover letter when you send more than one patch. This makes
using tools like b4 easier.




^ permalink raw reply	[flat|nested] 7+ 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
@ 2026-06-29 14:12   ` Fiona Ebner
  2026-06-30  6:41     ` Maximiliano Sandoval
  2026-06-30  7:05     ` superseded: " Maximiliano Sandoval
  1 sibling, 2 replies; 7+ messages in thread
From: Fiona Ebner @ 2026-06-29 14:12 UTC (permalink / raw)
  To: Maximiliano Sandoval, pve-devel

Am 24.06.26 um 10:42 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 <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);

Typo: pgk

> +    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 {

This should live in QMPHelpers.pm. Then it's automatically clear that it
is queried via QMP when you're reading the code of a call site. Also,
maybe get_qemu_package_version() to be even more explicit.

> +    my ($vmid) = @_;
> +    my $res = mon_cmd($vmid, "query-version");
> +    return $res->{package};
> +}
> +
>  sub qemu_use_old_bios_files {
>      my ($machine_type) = @_;
>  





^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH qemu-server 2/2] vm start: log qemu version when starting a VM
  2026-06-29 14:12   ` Fiona Ebner
@ 2026-06-30  6:41     ` Maximiliano Sandoval
  2026-06-30  7:05     ` superseded: " Maximiliano Sandoval
  1 sibling, 0 replies; 7+ messages in thread
From: Maximiliano Sandoval @ 2026-06-30  6:41 UTC (permalink / raw)
  To: Fiona Ebner; +Cc: pve-devel

Fiona Ebner <f.ebner@proxmox.com> writes:

> Am 24.06.26 um 10:42 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 <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);
>
> Typo: pgk
>
>> +    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 {
>
> This should live in QMPHelpers.pm. Then it's automatically clear that it
> is queried via QMP when you're reading the code of a call site. Also,
> maybe get_qemu_package_version() to be even more explicit.
>

It is there because get_running_qemu_version is above.

>> +    my ($vmid) = @_;
>> +    my $res = mon_cmd($vmid, "query-version");
>> +    return $res->{package};
>> +}
>> +
>>  sub qemu_use_old_bios_files {
>>      my ($machine_type) = @_;
>>  

-- 
Maximiliano




^ permalink raw reply	[flat|nested] 7+ messages in thread

* superseded: [PATCH qemu-server 2/2] vm start: log qemu version when starting a VM
  2026-06-29 14:12   ` Fiona Ebner
  2026-06-30  6:41     ` Maximiliano Sandoval
@ 2026-06-30  7:05     ` Maximiliano Sandoval
  1 sibling, 0 replies; 7+ messages in thread
From: Maximiliano Sandoval @ 2026-06-30  7:05 UTC (permalink / raw)
  To: Fiona Ebner; +Cc: pve-devel

Fiona Ebner <f.ebner@proxmox.com> writes:

> Am 24.06.26 um 10:42 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 <m.sandoval@proxmox.com>

Superseded-by: https://lore.proxmox.com/all/20260630070351.55073-1-m.sandoval@proxmox.com/T/#u

-- 
Maximiliano




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-06-30  7:05 UTC | newest]

Thread overview: 7+ 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
2026-06-29 14:12   ` Fiona Ebner
2026-06-30  6:41     ` Maximiliano Sandoval
2026-06-30  7:05     ` superseded: " Maximiliano Sandoval
2026-06-29 14:12 ` [PATCH qemu-server 1/2] test: mock query-version qmp command Fiona Ebner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal