mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
shutdown: Preserve shutdown cause through replay
With the recent addition of ShutdownCause, we want to be able to pass a cause through any shutdown request, and then faithfully replay that cause when later replaying the same sequence. The easiest way is to expand the reply event mechanism to track a series of values for EVENT_SHUTDOWN, one corresponding to each value of ShutdownCause. We are free to change the replay stream as needed, since there are already no guarantees about being able to use a replay stream by any other version of qemu than the one that generated it. The cause is not actually fed back until the next patch changes the signature for requesting a shutdown; a TODO marks that upcoming change. Yes, this uses the gcc/clang extension of a ranged case label, but this is not the first time we've used non-C99 constructs. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru> Message-Id: <20170515214114.15442-4-eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
parent
aedbe19297
commit
802f045a5f
4 changed files with 9 additions and 6 deletions
|
@ -22,8 +22,9 @@ enum ReplayEvents {
|
|||
EVENT_EXCEPTION,
|
||||
/* for async events */
|
||||
EVENT_ASYNC,
|
||||
/* for shutdown request */
|
||||
/* for shutdown requests, range allows recovery of ShutdownCause */
|
||||
EVENT_SHUTDOWN,
|
||||
EVENT_SHUTDOWN_LAST = EVENT_SHUTDOWN + SHUTDOWN_CAUSE__MAX,
|
||||
/* for character device write event */
|
||||
EVENT_CHAR_WRITE,
|
||||
/* for character device read all event */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue