On Wed, Aug 30, 2017 at 01:01:41PM -0400, Jeff Cody wrote:
> From: Jeffrey Cody <jc...@redhat.com>
> 
> If configured without live block operations enabled, unregister the
> live block operation commands.
> 
> Signed-off-by: Jeff Cody <jc...@redhat.com>
> ---
>  monitor.c | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/monitor.c b/monitor.c
> index e0f8801..de0a70e 100644
> --- a/monitor.c
> +++ b/monitor.c
> @@ -998,6 +998,22 @@ static void qmp_unregister_commands_hack(void)
>      && !defined(TARGET_S390X)
>      qmp_unregister_command(&qmp_commands, "query-cpu-definitions");
>  #endif
> +#ifndef CONFIG_LIVE_BLOCK_OPS
> +    qmp_unregister_command(&qmp_commands, "block-stream");
> +    qmp_unregister_command(&qmp_commands, "block-commit");
> +    qmp_unregister_command(&qmp_commands, "drive-mirror");
> +    qmp_unregister_command(&qmp_commands, "blockdev-mirror");
> +    qmp_unregister_command(&qmp_commands, "drive-backup");
> +    qmp_unregister_command(&qmp_commands, "blockdev-backup");
> +    qmp_unregister_command(&qmp_commands, "blockdev-snapshot");
> +    qmp_unregister_command(&qmp_commands, "blockdev-snapshot-sync");
> +    qmp_unregister_command(&qmp_commands, "block-job-set-speed");
> +    qmp_unregister_command(&qmp_commands, "block-job-cancel");
> +    qmp_unregister_command(&qmp_commands, "block-job-pause");
> +    qmp_unregister_command(&qmp_commands, "block-job-resume");
> +    qmp_unregister_command(&qmp_commands, "block-job-complete");
> +    qmp_unregister_command(&qmp_commands, "query-block-jobs");
> +#endif

I suggest using the new mechanisms added by:

  [PATCH 00/26] qapi: add #if pre-processor conditions to generated code

-- 
Eduardo

Reply via email to