[adding Dan in cc] On 04/27/2017 09:13 PM, Eric Blake wrote: > Since all reset/shutdown requests have been associated with a > reason, we can expose the full reason rather than a simple bool > to the guest. Document that any future additions to the enum > type will still use a 'host-' or 'guest-' prefix. > > Signed-off-by: Eric Blake > This is RFC because I really want to know whether libvirt and upper layer management apps will care about the various causes, or if exposing just a boolean is okay. We can maintain backwards compatibility if we release with just a boolean and later decide we want to expose the enum, but it's easier to start with a design that meets everyone's needs that it is to have to add stuff later or wish that we hadn't exposed quite so many enum values. > +++ b/qapi/event.json > @@ -10,9 +10,7 @@ > # Emitted when the virtual machine has shut down, indicating that qemu is > # about to exit. > # > -# @guest: If true, the shutdown was triggered by a guest request (such as > -# a guest-initiated ACPI shutdown request or other hardware-specific action) > -# rather than a host request (such as sending qemu a SIGINT). (since 2.10) > +# @reason: What triggered the reset. (since 2.10) > # > # Note: If the command-line option "-no-shutdown" has been specified, qemu will > # not exit, and a STOP event will eventually follow the SHUTDOWN event > @@ -21,11 +19,11 @@ > # > # Example: > # > -# <- { "event": "SHUTDOWN", "data": { "guest": true }, > +# <- { "event": "SHUTDOWN", "data": { "reason": "guest-shutdown" }, > # "timestamp": { "seconds": 1267040730, "microseconds": 682951 } } > # > ## > -{ 'event': 'SHUTDOWN', 'data': { 'guest': 'bool' } } > +{ 'event': 'SHUTDOWN', 'data': { 'reason': 'ShutdownCause' } } > -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org