Commit 66ec4a7
committed
xenmgr: Push ACPI power button multiple times
Sometimes the shutdown command does not work. It seems like the longer
the VM is up, the more likely it is to not shutdown. This is based on
Windows 10 without PV drivers.
The button press is seen by the VM to some extent because a DPMS off
(black) screen will turn back on, but shutdown is not initiated. A
second press will trigger it - that was the intent to the xl trigger
power line added in commit 1cfb6aa "xenmgr: Add xl trigger power to
HVM shutdown".
Re-work the code so a background thread is started that will push the
power buttons* 3 times each with a 1 second delay. This will hopefully
let the VM recognize the button press without going on for too long.
*HVMs have two power and two sleep buttons. One is Xen emulating
buttons for HVMs, and the second is from QEMU's acpi-pm-features.patch
and ACPI changes. xl trigger power is pushing the Xen one and the
xenstore hvm-shutdown write is triggering the QEMU one.
With forkIO, the `xl shutdown -F -ww` runs before the `xl trigger power`
commands. xl shutdown first tries PV shutdown and then (-F) fallback to
ACPI. So this would push the Xen ACPI button before the QEMU one in
pushPowerButton.
Signed-off-by: Jason Andryuk <[email protected]>1 parent 6419e6a commit 66ec4a7
1 file changed
+18
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
161 | 177 | | |
162 | 178 | | |
163 | 179 | | |
| |||
172 | 188 | | |
173 | 189 | | |
174 | 190 | | |
175 | | - | |
176 | | - | |
177 | | - | |
| 191 | + | |
| 192 | + | |
178 | 193 | | |
179 | 194 | | |
180 | 195 | | |
| |||
0 commit comments