From: Jakob Meng <c...@jakobmeng.de> This patch series builds upon [0] and brings the following changes: * Last patch in series shows how output format and other args could be passed via JSON-RPC API without the indirection introduced in the first patch (at the cost of inferiour error handling) * By default, the JSON output will not be prettyfied nor sorted * Added global option '--pretty' to ovs-appctl for prettyfy and sort the JSON output * Added missing check for supported output formats to server.py * Commented @enum.verify(enum.NAMED_FLAGS) because its available in Python 3.11+ only * Renamed 'fmt' to 'output_fmts' in Python code to highlight that multiple values are possible at the same time * Added NEWS entries for '--format' and '--pretty' options * Fixed flake8 errors * Replaced TODO with FIXME * Dropped option '--format' from ovs-dpctl * No longer mention OVS-DPDK in commit msgs * Adopted comments to style guide.
What has not been changed from previous series is the function type unixctl_cb_func in lib/unixctl.h: The output format continues to be passed via new arg 'enum ovs_output_fmt fmt'. We discussed whether this should be moved to 'struct unixctl_conn' or a new struct [1] but did not come to a conclusion yet. [0] https://patchwork.ozlabs.org/project/openvswitch/list/?series=379267&state=%2A&archive=both [1] https://patchwork.ozlabs.org/comment/3208683/ In particular, I would like to ask for your opinion on the last patch in the series: What do you think about both JSON-RPC API approaches? Thanks! Jakob Meng (6): Add global option for JSON output to ovs-appctl. python: Add global option for JSON output to Python tools. Migrate commands to extended unixctl API. ofproto: Add JSON output for 'dpif/show' command. appctl: Add option '--pretty' for pretty-printing JSON output. unixctl: Pass output format as command args via JSON-RPC API. NEWS | 7 ++ lib/bfd.c | 16 ++- lib/cfm.c | 13 ++- lib/command-line.c | 36 ++++++ lib/command-line.h | 10 ++ lib/coverage.c | 11 +- lib/dpctl.c | 129 +++++++++++++-------- lib/dpctl.h | 4 + lib/dpdk.c | 15 ++- lib/dpif-netdev-perf.c | 1 + lib/dpif-netdev-perf.h | 1 + lib/dpif-netdev.c | 84 ++++++++------ lib/dpif-netlink.c | 6 +- lib/lacp.c | 7 +- lib/memory.c | 5 +- lib/netdev-dpdk.c | 16 ++- lib/netdev-dummy.c | 30 +++-- lib/netdev-native-tnl.c | 4 +- lib/netdev-native-tnl.h | 4 +- lib/netdev-vport.c | 1 + lib/odp-execute.c | 10 +- lib/ovs-lldp.c | 16 ++- lib/ovs-router.c | 26 +++-- lib/rstp.c | 22 ++-- lib/stopwatch.c | 10 +- lib/stp.c | 20 ++-- lib/timeval.c | 13 ++- lib/tnl-neigh-cache.c | 35 +++--- lib/tnl-ports.c | 6 +- lib/unixctl.c | 206 ++++++++++++++++++++++++--------- lib/unixctl.h | 11 +- lib/vlog.c | 46 +++++--- ofproto/bond.c | 32 +++-- ofproto/ofproto-dpif-trace.c | 10 +- ofproto/ofproto-dpif-upcall.c | 81 +++++++++---- ofproto/ofproto-dpif.c | 187 +++++++++++++++++++++++++----- ofproto/ofproto.c | 10 +- ofproto/tunnel.c | 4 +- ovsdb/file.c | 4 +- ovsdb/ovsdb-client.c | 40 ++++--- ovsdb/ovsdb-server.c | 122 ++++++++++++++----- ovsdb/ovsdb.c | 4 +- ovsdb/raft.c | 28 +++-- python/ovs/unixctl/__init__.py | 19 +-- python/ovs/unixctl/client.py | 9 +- python/ovs/unixctl/server.py | 75 +++++++----- python/ovs/util.py | 8 ++ python/ovs/vlog.py | 12 +- tests/appctl.py | 7 +- tests/pmd.at | 33 ++++++ tests/test-netflow.c | 4 +- tests/test-sflow.c | 4 +- tests/test-unixctl.c | 33 ++++-- tests/test-unixctl.py | 25 ++-- tests/unixctl-py.at | 7 ++ utilities/ovs-appctl.c | 82 ++++++++++--- utilities/ovs-dpctl.c | 1 + utilities/ovs-ofctl.c | 43 ++++--- vswitchd/bridge.c | 25 ++-- vswitchd/ovs-vswitchd.c | 5 +- 60 files changed, 1250 insertions(+), 485 deletions(-) -- 2.39.2 _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev