Commit 04938c6
committed
init: reboot after reporting the workload exit code
KRUN_EXIT_CODE_IOCTL is used only as a transfer workload exit code
Guest, no generic VMM shutdown mechanism is provided.
In the past init logged the workload exit code and simply returned.
On platforms where there is no shutdown/reset path to wake VMM later, the guest
Can continue running after the workload exits.
Keep ioctl for exit code transmission once reported by init
Workload exit code requesting kernel-mediated reboot/reset for VMM
Still exit via existing platform closure path.
On x86 guests, it is important to use the reboot/reset path as powering off may cause
Fallback to a stopped state, which does not trigger libkrun's VM exit path.
Add end-to-end tests to verify that the runner exits with the workload
Exit code.
Signed-off-by: Zewei Yang <yangzewei@loongson.cn>1 parent 788cf91 commit 04938c6
1 file changed
Lines changed: 16 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
1003 | 1004 | | |
1004 | 1005 | | |
1005 | 1006 | | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
1006 | 1021 | | |
1007 | 1022 | | |
1008 | 1023 | | |
| |||
1241 | 1256 | | |
1242 | 1257 | | |
1243 | 1258 | | |
1244 | | - | |
1245 | | - | |
1246 | 1259 | | |
1247 | 1260 | | |
1248 | 1261 | | |
1249 | 1262 | | |
1250 | 1263 | | |
| 1264 | + | |
1251 | 1265 | | |
1252 | 1266 | | |
1253 | 1267 | | |
| |||
0 commit comments