all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH qemu-server] machine: fix not trying to set S3/S4 ACPI power state for virt machine
@ 2026-02-03 14:10 Dominik Csapak
  2026-02-09 13:34 ` applied: " Fiona Ebner
  0 siblings, 1 reply; 2+ messages in thread
From: Dominik Csapak @ 2026-02-03 14:10 UTC (permalink / raw)
  To: pve-devel

For aarch64 the default machine is 'virt' already, so we have to consider
this case as well here.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
we could maybe also just skip this entire function if the arch is not
'x86_64'. Can send a v2 with that if that's preferred.

 src/PVE/QemuServer.pm         | 2 +-
 src/PVE/QemuServer/Machine.pm | 7 +++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index dae72c40..5d2dbe03 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -3730,7 +3730,7 @@ sub config_to_command {
         push @$machineFlags, 'accel=tcg';
     }
     my $power_state_flags =
-        PVE::QemuServer::Machine::get_power_state_flags($machine_conf, $version_guard);
+        PVE::QemuServer::Machine::get_power_state_flags($machine_conf, $arch, $version_guard);
     push $cmd->@*, $power_state_flags->@* if defined($power_state_flags);
 
     push @$machineFlags, 'smm=off' if should_disable_smm($conf, $vga, $machine_type);
diff --git a/src/PVE/QemuServer/Machine.pm b/src/PVE/QemuServer/Machine.pm
index 93a90c47..c5f0104a 100644
--- a/src/PVE/QemuServer/Machine.pm
+++ b/src/PVE/QemuServer/Machine.pm
@@ -468,9 +468,12 @@ sub check_and_pin_machine_string {
 # disable s3/s4 by default for 9.2+pve1 machine types
 # returns an arrayref of cmdline options for qemu or undef
 sub get_power_state_flags {
-    my ($machine_conf, $version_guard) = @_;
+    my ($machine_conf, $arch, $version_guard) = @_;
 
-    if (defined($machine_conf->{type}) && $machine_conf->{type} =~ /^virt/) {
+    if (
+        defined($machine_conf->{type}) && $machine_conf->{type} =~ /^virt/
+        || !defined($machine_conf->{type}) && $arch eq 'aarch64'
+    ) {
         return; # virt machines are normally ARM64 ones which have no concept of s3/s4
     }
 
-- 
2.47.3





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

* applied: [PATCH qemu-server] machine: fix not trying to set S3/S4 ACPI power state for virt machine
  2026-02-03 14:10 [PATCH qemu-server] machine: fix not trying to set S3/S4 ACPI power state for virt machine Dominik Csapak
@ 2026-02-09 13:34 ` Fiona Ebner
  0 siblings, 0 replies; 2+ messages in thread
From: Fiona Ebner @ 2026-02-09 13:34 UTC (permalink / raw)
  To: pve-devel, Dominik Csapak

On Tue, 03 Feb 2026 15:10:50 +0100, Dominik Csapak wrote:
> For aarch64 the default machine is 'virt' already, so we have to consider
> this case as well here.

Applied, with the below follow-up, thanks!

[1/1] machine: fix not trying to set S3/S4 ACPI power state for virt machine
      commit: 0c14d454f482bb0ded435782155d444ae9885db1

commit f68db077fe6a96c05081f5306bf63097a84ed79f (HEAD -> master, proxdev/master, origin/master)
Author: Fiona Ebner <f.ebner@proxmox.com>
Date:   Mon Feb 9 14:21:09 2026 +0100

    machine: power state flags: determine actual machine type up front to improve readability
    
    While it should not matter in practice, other functions check if the
    value is falsy rather than defined to apply the fallback, so do the
    same here to keep it consistent.
    
    Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 src/PVE/QemuServer/Machine.pm | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/PVE/QemuServer/Machine.pm b/src/PVE/QemuServer/Machine.pm
index c5f0104a..b87889b4 100644
--- a/src/PVE/QemuServer/Machine.pm
+++ b/src/PVE/QemuServer/Machine.pm
@@ -470,15 +470,13 @@ sub check_and_pin_machine_string {
 sub get_power_state_flags {
     my ($machine_conf, $arch, $version_guard) = @_;
 
-    if (
-        defined($machine_conf->{type}) && $machine_conf->{type} =~ /^virt/
-        || !defined($machine_conf->{type}) && $arch eq 'aarch64'
-    ) {
+    my $machine = $machine_conf->{type} || default_machine_for_arch($arch);
+
+    if ($machine =~ /^virt/) {
         return; # virt machines are normally ARM64 ones which have no concept of s3/s4
     }
 
-    my $object =
-        $machine_conf->{type} && ($machine_conf->{type} =~ m/q35/) ? "ICH9-LPC" : "PIIX4_PM";
+    my $object = ($machine =~ m/q35/) ? "ICH9-LPC" : "PIIX4_PM";
 
     my $default = 1;
     if ($version_guard->(9, 2, 1)) {





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

end of thread, other threads:[~2026-02-09 13:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-03 14:10 [PATCH qemu-server] machine: fix not trying to set S3/S4 ACPI power state for virt machine Dominik Csapak
2026-02-09 13:34 ` applied: " Fiona Ebner

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.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal