[ovs-dev] [PATCH 00/30] Get rid of ctl_fatal() calls in ovn-nbctl (part 1)

Jakub Sitnicki jkbs at redhat.com
Sat Jul 7 11:09:34 UTC 2018


This series is a follow-up to recent work done in db-ctl-base module [1].  The
goal is to avoid using ctl_fatal() that terminates the process on error so that
ovn-nbctl, or other db-ctl tools, can run as long-lived processes (such as
servers or daemons).

First couple of patches are fix-ups for bugs and oversights in the mentioned
earlier series [1]. The rest of the patches convert selected helper functions
and command handlers in ovn-nbctl to propagate the error instead of calling
ctl_fatal().

There are still many more functions in ovn-nbctl left to convert [2]. This first
batch targets ones that have their error paths covered by the ovn-nbct test
suite (tests/ovn-nbctl.at).

Having these functions converted will give us a good testing ground for nbctl
daemon changes which I have in working shape [3] and am planning to post soon.

Thanks,
Jakub

[1] https://mail.openvswitch.org/pipermail/ovs-dev/2018-July/348911.html
[2] git grep -W ctl_fatal ovn/utilities/ovn-nbctl.c \
    | grep 'ovn/utilities/ovn-nbctl.c=' \
    | perl -n -e '/=([^(]+)\(/ and print $1, "\n";'
[3] https://github.com/jsitnicki/ovs/commits/wip-nbctl-daemon

Jakub Sitnicki (30):
  db-ctl-base: Don't die in cmd_add() on error.
  ovn-nbctl: Report the actual error from the command handler.
  ovn-nbctl: Don't die in ls_by_name_or_uuid().
  ovn-nbctl: Don't die in lsp_by_name_or_uuid().
  ovn-nbctl: Don't die in lb_by_name_or_uuid()
  ovn-nbctl: Don't die in lr_by_name_or_uuid().
  ovn-nbctl: Don't die in lrp_by_name_or_uuid().
  ovn-nbctl: Don't die in acl_cmd_get_pg_or_ls().
  ovn-nbctl: Don't die in parse_enabled().
  ovn-nbctl: Don't die in nbctl_ls_add().
  ovn-nbctl: Don't die in nbctl_ls_del().
  ovn-nbctl: Don't die in nbctl_lsp_add().
  ovn-nbctl: Don't die in nbctl_acl().
  ovn-nbctl: Don't die in nbctl_qos_add().
  ovn-nbctl: Don't die in nbctl_lr_nat_add().
  ovn-nbctl: Don't die in nbctl_lr_nat_del().
  ovn-nbctl: Don't die in nbctl_lb_add().
  ovn-nbctl: Don't die in nbctl_lb_del()
  ovn-nbctl: Don't die in nbctl_ls_lb_add().
  ovn-nbctl: Don't die in nbctl_lr_lb_add().
  ovn-nbctl: Don't die in nbctl_lr_add().
  ovn-nbctl: Don't die in nbctl_lr_del().
  ovn-nbctl: Don't die in nbctl_lrp_add().
  ovn-nbctl: Don't die in nbctl_lrp_set_gateway_chassis().
  ovn-nbctl: Don't die in nbctl_lrp_get_gateway_chassis().
  ovn-nbctl: Don't die in nbctl_lrp_del_gateway_chassis().
  ovn-nbctl: Don't die in nbctl_lrp_set_enabled().
  ovn-nbctl: Don't die in nbctl_lr_route_add().
  ovn-nbctl: Don't die in nbctl_lr_route_del().
  ovn-nbctl: Don't die in nbctl_lsp_set_type().

 lib/db-ctl-base.c         |   3 +-
 ovn/utilities/ovn-nbctl.c | 731 +++++++++++++++++++++++++++++++++-------------
 2 files changed, 525 insertions(+), 209 deletions(-)

--
2.14.4


More information about the dev mailing list