Pavel Dovgalyuk <pavel.dovga...@ispras.ru> writes: > This patch introduces 'info replay' monitor command and > corresponding qmp request. > These commands request the current record/replay mode, replay log file > name, and the instruction count (number of recorded/replayed > instructions). The instruction count can be used with the > replay_seek/replay_break commands added in the next two patches. > > Signed-off-by: Pavel Dovgalyuk <pavel.dovga...@ispras.ru> > Acked-by: Dr. David Alan Gilbert <dgilb...@redhat.com> [...] > diff --git a/qapi/block-core.json b/qapi/block-core.json > index 6d45c29..d70e584 100644 > --- a/qapi/block-core.json > +++ b/qapi/block-core.json > @@ -28,7 +28,8 @@ > # > # @icount: Current instruction count. Appears when execution record/replay > # is enabled. Used for "time-traveling" to match the moment > -# in the recorded execution with the snapshots. (since 4.0) > +# in the recorded execution with the snapshots. This counter may > +# be obtained through @query-replay command (since 4.0) > # > # Since: 1.3 > # > diff --git a/qapi/replay.json b/qapi/replay.json > index 9e13551..ef2fb4b 100644 > --- a/qapi/replay.json > +++ b/qapi/replay.json > @@ -24,3 +24,42 @@ > ## > { 'enum': 'ReplayMode', > 'data': [ 'none', 'record', 'play' ] } > + > +## > +# @ReplayInfo: > +# > +# Record/replay information. > +# > +# @mode: current mode. > +# > +# @filename: name of the record/replay log file. > +# It is present only in record or replay modes, when the log > +# is recorded or replayed. > +# > +# @icount: current number of executed instructions. > +# > +# Since: 4.0 > +# > +## > +{ 'struct': 'ReplayInfo', > + 'data': { 'mode': 'ReplayMode', '*filename': 'str', 'icount': 'int' } } > + > +## > +# @query-replay: > +# > +# Retrieves the record/replay information.
Imperative mood: Retrieve the record/replay information. > +# It includes current instruction count which may be used for replay-break > and > +# replay-seek commands. Please wrap comment lines around column 70. > +# > +# Returns: record/replay information. > +# > +# Since: 4.0 > +# > +# Example: > +# > +# -> { "execute": "query-replay" } > +# <- { "return": { "mode": "play", "filename": "log.rr", "icount": 220414 } } > +# > +## > +{ 'command': 'query-replay', > + 'returns': 'ReplayInfo' } Preferably with these minor touch-ups, QAPI schema part Acked-by: Markus Armbruster <arm...@redhat.com> [...]