From patchwork Sat Jul 7 11:09:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Sitnicki X-Patchwork-Id: 940829 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41NBPR32jfz9rxs for ; Sat, 7 Jul 2018 22:54:18 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 60681DA5; Sat, 7 Jul 2018 12:54:15 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 06BA8BE1 for ; Sat, 7 Jul 2018 11:10:08 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 4F376318 for ; Sat, 7 Jul 2018 11:10:07 +0000 (UTC) Received: by mail-wr1-f49.google.com with SMTP id j33-v6so6401307wrj.5 for ; Sat, 07 Jul 2018 04:10:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=wuI6xS7U5dbtRxv35yJ8DmM+lbmugygyIYzyycwPRV0=; b=m2RECPr/wFjf2Cf11ZkALHF8uNT62rLp+6YtIyd/67fFQCgOarVaW0bGi/y7ksdCOn lmg3xOPXXPtZySc7/6ZiDr9VZs2vvPaumrO3DkZLI16x1KfUCMjdmyOThmCLTqOkj+Jn liSL15FrYWAwnIQmZB7RqCYQdeHWiJiuVirMhY6FLPpPow4n0lnoVv2xTzyTsgUopd0W YDscKM4r2ZYS7c5cy1UthZELstAVxZrjTfN1bXq3kri9ao9MapY6QOqELZORUXxT+llf /dpzNySm4hUBXPW1bP6RnGkr8irvITPQmeVU4xVuf0ClP0v7AgUi74AmRfN3Zv+c2E6F 0BUw== X-Gm-Message-State: AOUpUlEmaQmHKeWWXX4gQbM/hU/9uP0e0b5t3cGCyRCOVYuNL/OZGHvt Ok3w0ao9ta4Qb0av3aEbQQY47R6z/1Q= X-Google-Smtp-Source: AAOMgpd9SNAjfM9iG3ruNzODgqrsVNHBG8f9Uxnbl/m7zJmsB+jYHqKqfl8cNl55q9RB/Dqto/EqVw== X-Received: by 2002:adf:c684:: with SMTP id j4-v6mr3845659wrg.243.1530961805673; Sat, 07 Jul 2018 04:10:05 -0700 (PDT) Received: from redhat.com (218.red-2-136-166.dynamicip.rima-tde.net. [2.136.166.218]) by smtp.gmail.com with ESMTPSA id t3-v6sm5159139wrp.88.2018.07.07.04.10.04 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 07 Jul 2018 04:10:05 -0700 (PDT) From: Jakub Sitnicki To: dev@openvswitch.org Date: Sat, 7 Jul 2018 13:09:34 +0200 Message-Id: <20180707111004.8320-1-jkbs@redhat.com> X-Mailer: git-send-email 2.14.4 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org X-Mailman-Approved-At: Sat, 07 Jul 2018 12:54:13 +0000 Subject: [ovs-dev] [PATCH 00/30] Get rid of ctl_fatal() calls in ovn-nbctl (part 1) X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org 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