aboutsummaryrefslogtreecommitdiff
path: root/monitor
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2022-11-04 17:07:09 +0100
committerMarkus Armbruster <armbru@redhat.com>2022-12-14 20:05:07 +0100
commit3f41a3adb4aaaeea45c761edca9269dbd53ec5d9 (patch)
treef566789072c6c4bd3b096eb535a4ca6c4cde4680 /monitor
parent238e9202a25bbac9dfc3cfc2c87a3c095cb2268c (diff)
qapi ui: Elide redundant has_FOO in generated C
The has_FOO for pointer-valued FOO are redundant, except for arrays. They are also a nuisance to work with. Recent commit "qapi: Start to elide redundant has_FOO in generated C" provided the means to elide them step by step. This is the step for qapi/ui.json. Said commit explains the transformation in more detail. The invariant violations mentioned there do not occur here. Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20221104160712.3005652-28-armbru@redhat.com>
Diffstat (limited to 'monitor')
-rw-r--r--monitor/hmp-cmds.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
index 3ada344d77..263b7762ab 100644
--- a/monitor/hmp-cmds.c
+++ b/monitor/hmp-cmds.c
@@ -548,11 +548,9 @@ static void hmp_info_vnc_clients(Monitor *mon, VncClientInfoList *client)
hmp_info_VncBasicInfo(mon, qapi_VncClientInfo_base(cinfo), "Client");
monitor_printf(mon, " x509_dname: %s\n",
- cinfo->has_x509_dname ?
- cinfo->x509_dname : "none");
+ cinfo->x509_dname ?: "none");
monitor_printf(mon, " sasl_username: %s\n",
- cinfo->has_sasl_username ?
- cinfo->sasl_username : "none");
+ cinfo->sasl_username ?: "none");
client = client->next;
}
@@ -597,7 +595,7 @@ void hmp_info_vnc(Monitor *mon, const QDict *qdict)
hmp_info_vnc_authcrypt(mon, " ", info->auth,
info->has_vencrypt ? &info->vencrypt : NULL);
}
- if (info->has_display) {
+ if (info->display) {
monitor_printf(mon, " Display: %s\n", info->display);
}
info2l = info2l->next;
@@ -1401,7 +1399,6 @@ void hmp_set_password(Monitor *mon, const QDict *qdict)
}
if (opts.protocol == DISPLAY_PROTOCOL_VNC) {
- opts.u.vnc.has_display = !!display;
opts.u.vnc.display = (char *)display;
}
@@ -1429,7 +1426,6 @@ void hmp_expire_password(Monitor *mon, const QDict *qdict)
}
if (opts.protocol == DISPLAY_PROTOCOL_VNC) {
- opts.u.vnc.has_display = !!display;
opts.u.vnc.display = (char *)display;
}
@@ -1714,7 +1710,7 @@ hmp_screendump(Monitor *mon, const QDict *qdict)
goto end;
}
- qmp_screendump(filename, id != NULL, id, id != NULL, head,
+ qmp_screendump(filename, id, id != NULL, head,
input_format != NULL, format, &err);
end:
hmp_handle_error(mon, err);