• Eric Blake's avatar
    shutdown: Preserve shutdown cause through replay · 802f045a
    Eric Blake authored
    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: 's avatarEric Blake <eblake@redhat.com>
    Reviewed-by: 's avatarPavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
    Message-Id: <20170515214114.15442-4-eblake@redhat.com>
    Reviewed-by: 's avatarMarkus Armbruster <armbru@redhat.com>
    Signed-off-by: 's avatarMarkus Armbruster <armbru@redhat.com>
replay-internal.h 5.8 KB