@@ -818,9 +818,13 @@ static void qmp_query_uuid(Monitor *mon, QObject **ret_data)
*ret_data = qobject_from_jsonf("{ 'UUID': %s }", uuid);
}
-static void do_info_uuid_print(Monitor *mon, const QObject *data)
+static void do_info_uuid(Monitor *mon)
{
+ QObject *data;
+
+ qmp_query_uuid(NULL, &data);
monitor_printf(mon, "%s\n", qdict_get_str(qobject_to_qdict(data), "UUID"));
+ qobject_decref(data);
}
/* get the current CPU defined by the user */
@@ -2586,8 +2590,7 @@ static const mon_cmd_t info_cmds[] = {
.args_type = "",
.params = "",
.help = "show the current VM UUID",
- .user_print = do_info_uuid_print,
- .mhandler.info_new = qmp_query_uuid,
+ .mhandler.info = do_info_uuid,
},
#if defined(TARGET_PPC)
{
The new handler directly calls qmp_query_uuid() to gather data and then prints it. This change allows us to drop the user_print callback. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> --- monitor.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-)