mbox series

[ovs-dev,v10,0/6] Add global option to output JSON from ovs-appctl cmds.

Message ID 20240516072015.18455-1-jmeng@redhat.com
Headers show
Series Add global option to output JSON from ovs-appctl cmds. | expand

Message

Jakob Meng May 16, 2024, 7:20 a.m. UTC
From: Jakob Meng <code@jakobmeng.de>

v10 addresses all of Ilya's comments for v9 [0], most importantly:

* Output formatting has been moved from unixctl_client_transact() in unixctl.c to ovs-appctl.c; same for Python code.
* unixctl_command_reply_error() will never wrap plain-text in JSON.
* unixctl_command_reply_error_json() has been dropped.
* Home-grown args parsing in unixctl_set_options() has been replaced with ovs_cmdl_parse_all().
* ovs-appctl manpage has been updated with '--format' and '--pretty' options.
* JSON output is always sorted now (also for non-pretty).
* JSON output of 'list-commands' will now be a dictionary, not an array.
* JSON output of 'dpif/show' command changed (last patch).
* NEWS entries have been sorted, clarified and shortened.
* Trailing newline has been moved from program version string to ovs_print_version(). For cleaner JSON output in new 'version' test.

[0] https://patchwork.ozlabs.org/project/openvswitch/list/?series=402752&archive=both&state=*

Thanks again, Ilya, for your thorough review and helpful suggestions☺️ I hope, the patches are getting better now!

Best regards,
Jakob

Jakob Meng (6):
  Add global option for JSON output to ovs-appctl.
  python: Add option for JSON output to unixctl classes and appctl.py.
  appctl: Add option '--pretty' for pretty-printing JSON output.
  python: Add option for pretty-printing JSON output to appctl.py.
  vswitchd: Add JSON output for 'list-commands' command.
  ofproto: Add JSON output for 'dpif/show' command.

 Documentation/ref/ovs-appctl.8.rst |  19 +++
 NEWS                               |   9 ++
 lib/unixctl.c                      | 239 ++++++++++++++++++++++-------
 lib/unixctl.h                      |  20 ++-
 lib/util.c                         |   6 +-
 ofproto/ofproto-dpif.c             | 120 +++++++++++++--
 python/ovs/unixctl/client.py       |   5 +-
 python/ovs/unixctl/server.py       |  55 +++++--
 python/ovs/util.py                 |   8 +
 tests/appctl.py                    |  40 ++++-
 tests/ovs-vswitchd.at              |  29 ++++
 tests/pmd.at                       |  23 +++
 tests/unixctl-py.at                |   8 +
 utilities/ovs-appctl.c             | 152 +++++++++++++++---
 14 files changed, 625 insertions(+), 108 deletions(-)