mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 07:13:54 -06:00
qapi rocker: 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/rocker.json. Said commit explains the transformation in more detail. The invariant violations mentioned there do not occur here. Cc: Jiri Pirko <jiri@resnulli.us> Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20221104160712.3005652-23-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
This commit is contained in:
parent
d01c00463f
commit
05e0748860
3 changed files with 13 additions and 23 deletions
|
@ -2010,35 +2010,35 @@ void hmp_rocker_of_dpa_flows(Monitor *mon, const QDict *qdict)
|
|||
}
|
||||
}
|
||||
|
||||
if (key->has_eth_src) {
|
||||
if (key->eth_src) {
|
||||
if ((strcmp(key->eth_src, "01:00:00:00:00:00") == 0) &&
|
||||
(mask->has_eth_src) &&
|
||||
mask->eth_src &&
|
||||
(strcmp(mask->eth_src, "01:00:00:00:00:00") == 0)) {
|
||||
monitor_printf(mon, " src <any mcast/bcast>");
|
||||
} else if ((strcmp(key->eth_src, "00:00:00:00:00:00") == 0) &&
|
||||
(mask->has_eth_src) &&
|
||||
mask->eth_src &&
|
||||
(strcmp(mask->eth_src, "01:00:00:00:00:00") == 0)) {
|
||||
monitor_printf(mon, " src <any ucast>");
|
||||
} else {
|
||||
monitor_printf(mon, " src %s", key->eth_src);
|
||||
if (mask->has_eth_src) {
|
||||
if (mask->eth_src) {
|
||||
monitor_printf(mon, "(%s)", mask->eth_src);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (key->has_eth_dst) {
|
||||
if (key->eth_dst) {
|
||||
if ((strcmp(key->eth_dst, "01:00:00:00:00:00") == 0) &&
|
||||
(mask->has_eth_dst) &&
|
||||
mask->eth_dst &&
|
||||
(strcmp(mask->eth_dst, "01:00:00:00:00:00") == 0)) {
|
||||
monitor_printf(mon, " dst <any mcast/bcast>");
|
||||
} else if ((strcmp(key->eth_dst, "00:00:00:00:00:00") == 0) &&
|
||||
(mask->has_eth_dst) &&
|
||||
mask->eth_dst &&
|
||||
(strcmp(mask->eth_dst, "01:00:00:00:00:00") == 0)) {
|
||||
monitor_printf(mon, " dst <any ucast>");
|
||||
} else {
|
||||
monitor_printf(mon, " dst %s", key->eth_dst);
|
||||
if (mask->has_eth_dst) {
|
||||
if (mask->eth_dst) {
|
||||
monitor_printf(mon, "(%s)", mask->eth_dst);
|
||||
}
|
||||
}
|
||||
|
@ -2058,7 +2058,7 @@ void hmp_rocker_of_dpa_flows(Monitor *mon, const QDict *qdict)
|
|||
}
|
||||
}
|
||||
|
||||
if (key->has_ip_dst) {
|
||||
if (key->ip_dst) {
|
||||
monitor_printf(mon, " dst %s", key->ip_dst);
|
||||
}
|
||||
|
||||
|
@ -2137,7 +2137,7 @@ void hmp_rocker_of_dpa_groups(Monitor *mon, const QDict *qdict)
|
|||
group->set_vlan_id & VLAN_VID_MASK);
|
||||
}
|
||||
|
||||
if (group->has_set_eth_src) {
|
||||
if (group->set_eth_src) {
|
||||
if (!set) {
|
||||
set = true;
|
||||
monitor_printf(mon, " set");
|
||||
|
@ -2145,7 +2145,7 @@ void hmp_rocker_of_dpa_groups(Monitor *mon, const QDict *qdict)
|
|||
monitor_printf(mon, " src %s", group->set_eth_src);
|
||||
}
|
||||
|
||||
if (group->has_set_eth_dst) {
|
||||
if (group->set_eth_dst) {
|
||||
if (!set) {
|
||||
monitor_printf(mon, " set");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue