Skip to content

Add a new -action parameter

Alejandro Jimenez qemu-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest4 patches 1 replyIn review
  2. v24 patches 5 repliesSuperseded
  3. v14 patches 3 repliesSuperseded

Changes in v3 from the cover letter

- Replaced the no_reboot and no_shutdown internal flags with enumerations that hold the current action selected in case of reboot or shutdown events. The same approach is used for panic and watchdog events.
- Ensured that -no-shutdown option overrides any previously issued action panic=poweroff setting.
- Added TODO comment to add more panic actions if viable (debug, reset).
- Modified QMP command to take multiple optional args specifying actions for each event type, and added 'allow-preconfig': true

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4vl: Add an -action option to respond to guest eventsMAINTAINERS include/sysemu/runstate-action.h include/sysemu/sysemu.h +7 more+272 -120 replies
2/4vl: Add option to avoid stopping VM upon guest panicinclude/sysemu/runstate-action.h qapi/run-state.json qemu-options.hx +2 more+66 -50 replies
3/4qmp: Allow setting -action parameters on the flyqapi/run-state.json softmmu/runstate-action.c+63 -00 replies
4/4qtest/pvpanic: Test panic option that allows VM to continuetests/qtest/pvpanic-test.c+25 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/4] Add a new -action parameter

v3:
- Replaced the no_reboot and no_shutdown internal flags with enumerations that hold the current action selected in case of reboot or shutdown events. The same approach is used for panic and watchdog events.
- Ensured that -no-shutdown option overrides any previously issued action panic=poweroff setting.
- Added TODO comment to add more panic actions if viable (debug, reset).
- Modified QMP command to take multiple optional args specifying actions for each event type, and added 'allow-preconfig': true

v2:
- Replaced the individual qmp commands in patch 3/4 for a generic set-action command that takes a RunStateAction parameter, specifying an event|action pair.
- Removed qmp_ prefix from X_set_action() functions in runstate-action.c

***

This is a follow up to the proposal to add a "-no-panicstop" option to QEMU that would allow us to control whether the VM is paused or allowed to continue running without intervention from a management layer when a guest panic occurs. See the inital thread and replies for details:

https://lore.kernel.org/qemu-devel/[email protected]/

From that discussion came a request for a generic mechanism to group options like -no-shutdown, -no-reboot, etc, that specify an action taken by QEMU in response to a guest event (reboot, shutdown, panic, and watchdog expiration are the current options). The existing options would translate to the new option, like:

* -no-reboot --> "-action reboot=shutdown"
* -no-shutdown --> "-action shutdown=pause"

Please share any questions or comments.

Regards,
Alejandro

Alejandro Jimenez (4):
vl: Add an -action option to respond to guest events
vl: Add option to avoid stopping VM upon guest panic
qmp: Allow setting -action parameters on the fly qtest/pvpanic: Test panic option that allows VM to continue

 MAINTAINERS                      |   2 +
 include/sysemu/runstate-action.h |  22 ++++++
 include/sysemu/sysemu.h          |   1 -
 monitor/qmp-cmds.c               |   3 +-
 qapi/run-state.json              | 149 +++++++++++++++++++++++++++++++++++++++
 qemu-options.hx                  |  25 +++++++
 softmmu/meson.build              |   1 +
 softmmu/runstate-action.c        | 142 +++++++++++++++++++++++++++++++++++++
 softmmu/vl.c                     |  64 ++++++++++++++---
 tests/qtest/pvpanic-test.c       |  26 ++++++-
 ui/sdl2.c                        |   5 +-
 11 files changed, 424 insertions(+), 16 deletions(-)
 create mode 100644 include/sysemu/runstate-action.h
 create mode 100644 softmmu/runstate-action.c
Signature · 1 line
1.8.3.1