On 1/13/20 8:31 PM, zhenwei pi wrote:
Handle bit 1 write, then post event to monitor.

Suggested by Paolo, declear a new event, using GUEST_PANICKED could
cause upper layers to react by shutting down or rebooting the guest.

In advance for extention, add GuestPanicInformation in event message.

Signed-off-by: zhenwei pi <pizhen...@bytedance.com>
---

+++ b/qapi/run-state.json
@@ -357,6 +357,26 @@
    'data': { 'action': 'GuestPanicAction', '*info': 'GuestPanicInformation' } }
##
+# @GUEST_CRASHLOADED:
+#
+# Emitted when guest OS crash loaded is detected
+#
+# @action: action that has been taken, currently always "run"
+#
+# @info: information about a panic (since 2.9)
+#
+# Since: 5.0

Paolo already caught that the 'since 2.9' makes no sense if the interface itself is since 5.0.

+#
+# Example:
+#
+# <- { "event": "GUEST_CRASHLOADED",
+#      "data": { "action": "run" } }
+#
+##
+{ 'event': 'GUEST_CRASHLOADED',
+  'data': { 'action': 'GuestPanicAction', '*info': 'GuestPanicInformation' } }
+
+##
  # @GuestPanicAction:
  #
  # An enumeration of the actions taken when guest OS panic is detected
@@ -366,7 +386,7 @@
  # Since: 2.1 (poweroff since 2.8)
  ##
  { 'enum': 'GuestPanicAction',
-  'data': [ 'pause', 'poweroff' ] }
+  'data': [ 'pause', 'poweroff', 'run' ] }

But the comment here could be updated to mention 'run' since 5.0, alongside poweroff since 2.8. Not the end of the world if we don't annotate it, though, since instrospection still shows the difference.


--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org


Reply via email to