qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 13/19] qapi: introduce x-query-skeys QMP command


From: Thomas Huth
Subject: Re: [PATCH v3 13/19] qapi: introduce x-query-skeys QMP command
Date: Tue, 12 Oct 2021 09:12:23 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

On 30/09/2021 15.23, 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é <berrange@redhat.com>
---
...
+void hmp_info_skeys(Monitor *mon, const QDict *qdict)
+{
+    Error *err = NULL;
+    g_autoptr(HumanReadableText) info = NULL;
+    uint64_t addr = qdict_get_int(qdict, "addr");
+
+    info = qmp_x_query_skeys(addr, &err);
+    if (err) {
+        error_report_err(err);

Shouldn't that rather be:

           monitor_printf(mon, "%s\n", error_get_pretty(err));

or something similar?

          return;
      }
- monitor_printf(mon, " key: 0x%X\n", key);
+    monitor_printf(mon, "%s", info->human_readable_text);
  }

Apart the question above, patch looks fine to me.

 Thomas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]