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>
This commit is contained in:
Markus Armbruster 2022-11-04 17:07:09 +01:00
parent 238e9202a2
commit 3f41a3adb4
6 changed files with 8 additions and 28 deletions

View file

@ -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);