On 10/28/21 17:54, Daniel P. Berrangé wrote:
> This is a counterpart to the HMP "info skeys" command. It is being
> added with an "x-" prefix because this QMP command is intended as an
> adhoc debugging tool and will thus not be modelled in QAPI as fully
> structured data, nor will it have long term guaranteed stability.
> The existing HMP command is rewritten to call the QMP command.
>
> Including 'common.json' into 'machine-target.json' created a little
> problem because the static marshalling method for HumanReadableText
> is generated unconditionally. It is only used, however, conditionally
> on certain target architectures.
>
> To deal with this we change the QAPI code generator to simply mark
> all static marshalling functions with G_GNUC_UNSED to hide the
> compiler warning.
>
> Signed-off-by: Daniel P. Berrangé <[email protected]>
> ---
> hw/s390x/s390-skeys.c | 35 +++++++++++++++++++++++++++--------
> qapi/machine-target.json | 17 +++++++++++++++++
> scripts/qapi/commands.py | 1 +
> 3 files changed, 45 insertions(+), 8 deletions(-)
> diff --git a/scripts/qapi/commands.py b/scripts/qapi/commands.py
> index 3654825968..01d8d1ea2c 100644
> --- a/scripts/qapi/commands.py
> +++ b/scripts/qapi/commands.py
> @@ -91,6 +91,7 @@ def gen_call(name: str,
> def gen_marshal_output(ret_type: QAPISchemaType) -> str:
> return mcgen('''
>
> +G_GNUC_UNUSED
> static void qmp_marshal_output_%(c_name)s(%(c_type)s ret_in,
> QObject **ret_out, Error **errp)
> {
>
I think 1/ this change should be in a separate patch,
but 2/ Markus is not going to accept it:
https://lore.kernel.org/qemu-devel/[email protected]/
I'll see if we can get ride of it with Kconfig rules.
Meanwhile, could we get the series merged without it?