Bug 473835 - disable auto-suspend for VMs by default to avoid virtio hang
Summary: disable auto-suspend for VMs by default to avoid virtio hang
Status: RESOLVED FIXED
Alias: None
Product: Powerdevil
Classification: Plasma
Component: general (show other bugs)
Version: 5.27.7
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Natalie Clarius
URL:
Keywords:
: 469975 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-08-28 07:06 UTC by Jens Petersen
Modified: 2023-09-09 21:25 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.27.8


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jens Petersen 2023-08-28 07:06:00 UTC
SUMMARY
When running KDE Plasma in a VM with virt-manager for example
virtio graphics is used by default which does not work with suspend currently.
This causes the VM to hang hard after 15min idle by default.
It would be better to disable auto-suspend when Plasma is running in a VM by default.
I believe that GNOME 45 will do this too (at least for Fedora 39).

Downstream bug is https://bugzilla.redhat.com/show_bug.cgi?id=2232711

STEPS TO REPRODUCE
1. Install Fedora KDE Plasma in a VM with virt-manager (with virtio driver)
2. Login and leave Plasma idle for 15min


OBSERVED RESULT
2. VM tries to suspend and hangs hard.

EXPECTED RESULT
Avoid auto-suspending by default in a VM where it is less useful anyway.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora Linux 39
KDE Plasma Version: 5.27.7
KDE Frameworks Version: 5.109.0
Qt Version: 5.15.10

ADDITIONAL INFORMATION
powerdevil-5.27.7

(Lol managed to hit this bug while writing the report ;o)
Comment 1 Bug Janitor Service 2023-08-31 18:22:30 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/powerdevil/-/merge_requests/230
Comment 2 Natalie Clarius 2023-08-31 18:23:41 UTC
To help me check whether this fix will work for you, could you please run 

qdbus --system org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.DBus.Properties.Get org.freedesktop.systemd1.Manager Virtualization

in a terminal on your VM setup and tell me whether it gives you any output? Thanks!
Comment 3 Adam Williamson 2023-08-31 21:15:46 UTC
That returns:

kvm
Comment 4 Natalie Clarius 2023-08-31 21:45:09 UTC
Thank you, that's good.
Comment 5 Natalie Clarius 2023-09-06 18:46:43 UTC
Git commit ebd288c351366b6232dad6b9be0ad60ce0e18c06 by Natalie Clarius.
Committed on 06/09/2023 at 18:10.
Pushed by nclarius into branch 'master'.

profiledefaults: don't automatically suspend by default if running in a virtual machine

To avoid hangs in virtual environments which don't suppport suspension, and ebecause it doesn't save any energy anyway.
FIXED-IN: 6.0

M  +3    -1    autotests/profilegenerator/generate_profiles.cpp
M  +3    -1    daemon/powerdevilcore.cpp
M  +21   -0    daemon/powerdevilpowermanagement.cpp
M  +1    -0    daemon/powerdevilpowermanagement.h
M  +12   -2    daemon/powerdevilprofiledefaults.cpp
M  +2    -2    daemon/powerdevilprofiledefaults.h
M  +4    -4    daemon/powerdevilprofilegenerator.cpp
M  +1    -2    daemon/powerdevilprofilegenerator.h
M  +2    -0    kcmodule/profiles/EditPage.cpp

https://invent.kde.org/plasma/powerdevil/-/commit/ebd288c351366b6232dad6b9be0ad60ce0e18c06
Comment 6 tagwerk19 2023-09-09 21:25:04 UTC
*** Bug 469975 has been marked as a duplicate of this bug. ***