[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH v2 46/49] replay: replay_info command
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [RFC PATCH v2 46/49] replay: replay_info command |
Date: |
Fri, 18 Jul 2014 09:55:15 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 |
On 07/17/2014 05:06 AM, Pavel Dovgalyuk wrote:
> This patch adds support for replay_info monitor command. This command
> returns the information about replay execution (replay mode and current step).
>
> Signed-off-by: Pavel Dovgalyuk <address@hidden>
> ---
> +++ b/qapi-schema.json
> @@ -3491,3 +3491,30 @@
> # Since: 2.1
> ##
> { 'command': 'rtc-reset-reinjection' }
> +
> +##
> +# @ReplayInfo:
> +#
> +# Information about replay process
> +#
> +# @mode: replay mode (none, play, record)
> +#
> +# @submode: play submode
What are the valid submodes? Does the set of submodes differ according
to the main mode? If so, is it better to use a flat union, where the
subtype is strongly typed to the correct limited possibilities according
to the mode?
> +#
> +# @step: current step of record or play
> +#
> +# Since: 2.2
> +##
> +{ 'type': 'ReplayInfo',
> + 'data': {'mode': 'str', 'submode': 'str', 'step': 'uint64'} }
Using 'str' to open-code a finite set of strings is not nice. Please add:
{ 'enum': 'ReplayMode', 'data': [ 'none', 'play', 'record' ] }
then use 'mode': 'ReplayMode'.
> +++ b/qmp-commands.hx
> @@ -3755,3 +3755,17 @@ Example:
> <- { "return": {} }
>
> EQMP
> +
> + {
> + .name = "replay_info",
> + .args_type = "",
> + .mhandler.cmd_new = qmp_marshal_input_replay_info,
> + },
> +
> +SQMP
> +replay_info
> +-----------
> +
> +Shows information about replay process.
> +
No example?
> +
> +const char *replay_get_mode_name(void)
> +{
> + switch (replay_mode) {
> + case REPLAY_NONE:
> + return "none";
> + case REPLAY_PLAY:
> + return "replay";
> + case REPLAY_SAVE:
> + return "record";
> + default:
> + return "unknown";
> + }
> +}
> +
No need to open-code this. If you properly set up an enum type in the
.json file, then you get the conversions between enum values and strings
for free from the generated QAPI framework.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [RFC PATCH v2 07/49] kvmapic: fixing loading vmstate, (continued)
- [Qemu-devel] [RFC PATCH v2 07/49] kvmapic: fixing loading vmstate, Pavel Dovgalyuk, 2014/07/17
- [Qemu-devel] [RFC PATCH v2 06/49] serial: fixing vmstate for save/restore, Pavel Dovgalyuk, 2014/07/17
- [Qemu-devel] [RFC PATCH v2 08/49] hpet: fixing saving and loading process, Pavel Dovgalyuk, 2014/07/17
- [Qemu-devel] [RFC PATCH v2 10/49] rtl8139: adding new fields to vmstate, Pavel Dovgalyuk, 2014/07/17
- [Qemu-devel] [RFC PATCH v2 09/49] pckbd: adding new fields to vmstate, Pavel Dovgalyuk, 2014/07/17
- [Qemu-devel] [RFC PATCH v2 42/49] replay: network packets record/replay, Pavel Dovgalyuk, 2014/07/17
- [Qemu-devel] [RFC PATCH v2 44/49] replay: serial port, Pavel Dovgalyuk, 2014/07/17
- [Qemu-devel] [RFC PATCH v2 43/49] replay: audio data record/replay, Pavel Dovgalyuk, 2014/07/17
- [Qemu-devel] [RFC PATCH v2 45/49] replay: USB passthrough, Pavel Dovgalyuk, 2014/07/17
- [Qemu-devel] [RFC PATCH v2 46/49] replay: replay_info command, Pavel Dovgalyuk, 2014/07/17
- [Qemu-devel] [RFC PATCH v2 47/49] replay: replay_break command, Pavel Dovgalyuk, 2014/07/17
- [Qemu-devel] [RFC PATCH v2 49/49] gdbstub: reverse debugging, Pavel Dovgalyuk, 2014/07/17
- [Qemu-devel] [RFC PATCH v2 48/49] replay: replay_seek_step command, Pavel Dovgalyuk, 2014/07/17
- [Qemu-devel] [RFC PATCH v2 25/49] target-i386: instructions counting code for replay, Pavel Dovgalyuk, 2014/07/17
- [Qemu-devel] [RFC PATCH v2 17/49] target-i386: update fp status fix, Pavel Dovgalyuk, 2014/07/17
- [Qemu-devel] [RFC PATCH v2 27/49] vga: do not use virtual clock for blinking cursor, Pavel Dovgalyuk, 2014/07/17
- [Qemu-devel] [RFC PATCH v2 15/49] softmmu: fixing usage of cpu_st/ld* from helpers, Pavel Dovgalyuk, 2014/07/17