From patchwork Sat Oct 10 04:15:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 528528 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (li376-54.members.linode.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 09919140E3D for ; Sat, 10 Oct 2015 15:16:45 +1100 (AEDT) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 5819510B34; Fri, 9 Oct 2015 21:16:07 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx3v1.cudamail.com (mx3.cudamail.com [64.34.241.5]) by archives.nicira.com (Postfix) with ESMTPS id 57F4010B32 for ; Fri, 9 Oct 2015 21:16:06 -0700 (PDT) Received: from bar3.cudamail.com (bar1 [192.168.15.1]) by mx3v1.cudamail.com (Postfix) with ESMTP id C50D6619817 for ; Fri, 9 Oct 2015 22:16:05 -0600 (MDT) X-ASG-Debug-ID: 1444450565-03dd7b7d40115670001-byXFYA Received: from mx3-pf3.cudamail.com ([192.168.14.3]) by bar3.cudamail.com with ESMTP id lPte7BF2tFvWNsWP (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 09 Oct 2015 22:16:05 -0600 (MDT) X-Barracuda-Envelope-From: blp@nicira.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.3 Received: from unknown (HELO mail-pa0-f51.google.com) (209.85.220.51) by mx3-pf3.cudamail.com with ESMTPS (RC4-SHA encrypted); 10 Oct 2015 04:16:05 -0000 Received-SPF: unknown (mx3-pf3.cudamail.com: Multiple SPF records returned) X-Barracuda-RBL-Trusted-Forwarder: 209.85.220.51 Received: by pablk4 with SMTP id lk4so103947689pab.3 for ; Fri, 09 Oct 2015 21:16:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=P3sCE5oitKvTPgnRHSwW+C2CdUpBu1Vlya0fEXtbFVA=; b=GZm1A/Yb8SaKobLxDzxhhuzmnMz5rWGOCidjWqkIfMy1bZd1nn5PqiUzL1YLYrzNf2 /F7ftEdaVn1d7VJX1ppq3BM/a1djvMBz35ufTOpM8peTtjPmssdDszjmLE6RMGFR7MRJ I2zBmR1D+cEPLqyf9WmJDQe0Q9MPE7mzjbFWw9djIEKzWg0rFCMdcH2SSep0XTvGj4w/ tua20qbe5paaVewQR8sOD+LF4qkdwB/ZqhFH7OZEs/bpLuWwmRMP7ZuVxoMVWWMiBASw w7T0omAQMGbpSSdzbEWFiMvtb8+sPQ2sJU8QUwQaump8TpHyY7VQZ4e/3o76Vdsl3qzR sCVg== X-Gm-Message-State: ALoCoQl+iv6PCo+oguQODO3Vi9z0mSaP7N8UcbNBnDuPpnpBf7EEwQUyMSrwueeF3kabnGPhxvcQ X-Received: by 10.68.211.131 with SMTP id nc3mr19867599pbc.159.1444450564924; Fri, 09 Oct 2015 21:16:04 -0700 (PDT) Received: from sigabrt.gateway.sonic.net (173-228-112-112.dsl.dynamic.fusionbroadband.com. [173.228.112.112]) by smtp.gmail.com with ESMTPSA id bk8sm5386937pad.18.2015.10.09.21.16.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Oct 2015 21:16:03 -0700 (PDT) X-CudaMail-Envelope-Sender: blp@nicira.com X-Barracuda-Apparent-Source-IP: 173.228.112.112 From: Ben Pfaff To: dev@openvswitch.org X-CudaMail-Whitelist-To: dev@openvswitch.org X-CudaMail-MID: CM-V3-1008077233 X-CudaMail-DTE: 100915 X-CudaMail-Originating-IP: 209.85.220.51 Date: Fri, 9 Oct 2015 21:15:30 -0700 X-ASG-Orig-Subj: [##CM-V3-1008077233##][PATCH 09/23] patch: Bail out earlier if OVS IDL transactions cannot be executed. Message-Id: <1444450544-11845-10-git-send-email-blp@nicira.com> X-Mailer: git-send-email 2.1.3 In-Reply-To: <1444450544-11845-1-git-send-email-blp@nicira.com> References: <1444450544-11845-1-git-send-email-blp@nicira.com> X-Barracuda-Connect: UNKNOWN[192.168.14.3] X-Barracuda-Start-Time: 1444450565 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-ASG-Whitelist: Header =?UTF-8?B?eFwtY3VkYW1haWxcLXdoaXRlbGlzdFwtdG8=?= X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 Cc: Ben Pfaff Subject: [ovs-dev] [PATCH 09/23] patch: Bail out earlier if OVS IDL transactions cannot be executed. X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" The whole point of this module is side effects on the Open vSwitch database, so the whole thing can be skipped if those are impossible. Signed-off-by: Ben Pfaff Acked-by: Justin Pettit --- ovn/controller/patch.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ovn/controller/patch.c b/ovn/controller/patch.c index 0d192fa..1cce559 100644 --- a/ovn/controller/patch.c +++ b/ovn/controller/patch.c @@ -69,10 +69,6 @@ create_patch_port(struct controller_ctx *ctx, const struct ovsrec_bridge *b1, const struct ovsrec_bridge *b2) { - if (!ctx->ovs_idl_txn) { - return; - } - char *port_name = patch_port_name(b1, b2); char *peer_port_name = patch_port_name(b2, b1); @@ -218,6 +214,10 @@ parse_bridge_mappings(struct controller_ctx *ctx, void patch_run(struct controller_ctx *ctx, const struct ovsrec_bridge *br_int) { + if (!ctx->ovs_idl_txn) { + return; + } + const char *mappings_cfg = ""; const struct ovsrec_open_vswitch *cfg;