From patchwork Thu Jul 12 13:40:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Sitnicki X-Patchwork-Id: 943049 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 41RHFT4hp2z9s1R for ; Thu, 12 Jul 2018 23:43:09 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 07233D2A; Thu, 12 Jul 2018 13:40:30 +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 8B02DD1E for ; Thu, 12 Jul 2018 13:40:27 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 0D72A4FA for ; Thu, 12 Jul 2018 13:40:26 +0000 (UTC) Received: by mail-wr1-f48.google.com with SMTP id c4-v6so9087767wrs.12 for ; Thu, 12 Jul 2018 06:40:26 -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:cc:subject:date:message-id:in-reply-to :references; bh=pxKWi5+pOX80hJROYOcWfAVOe/s4QnwiG4+fddWZ/Es=; b=H5aNNL2Qk3KF75Qb5+Oyhckw1bav+PBHgJJprNgmB3eSQcWJY57j2RBEPv6PHzjDIJ iAxeYd7zUXZsJ15+GoXY8Fpkl4hlDLu4Mlz9fTjNVhdHp7sosEuETk2s0p5GxHBe/FUX XMCIpim0x/YYWMWIYlZDB29Ve4tIGLRGvm3jeWR3+UBCQrYYjwYf1B+5ySShLg+nsWmS tJijD664sbJNi2aKRfsu3Ui8PSK54ksBzZBvKxj3YNUbKs5Dwxh2f8rFGQbPN7bYnwHN TP5k/moxUULgQjWpWnuDnMt6KhNrod9HX6VlIhevaWM9KQWX0yxsEdtsuh3xnx2emJKG 9Ggg== X-Gm-Message-State: AOUpUlFO5ZjeIOgMUzt5/XpmMz5C7wkjjuwn8ZKykWH7oyo80VhkyFu2 DxP81f6jwmxOLS9lWdDeLgbCG2Klzww= X-Google-Smtp-Source: AAOMgpdkbswE0rAff4Qgs6v90rU5D2nZqYGXh5g8tuEgmpY8H2vKjExPIXrHIrQjU1y+5W0bqkTLew== X-Received: by 2002:adf:e9c1:: with SMTP id l1-v6mr1766300wrn.14.1531402825555; Thu, 12 Jul 2018 06:40:25 -0700 (PDT) Received: from redhat.com (red-hat-inc.vlan404.asr1.mad1.gblx.net. [64.215.113.190]) by smtp.gmail.com with ESMTPSA id c7-v6sm40999899wre.73.2018.07.12.06.40.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Jul 2018 06:40:25 -0700 (PDT) From: Jakub Sitnicki To: dev@openvswitch.org Date: Thu, 12 Jul 2018 15:40:06 +0200 Message-Id: <20180712134016.14336-6-jkbs@redhat.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180712134016.14336-1-jkbs@redhat.com> References: <20180712134016.14336-1-jkbs@redhat.com> 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 Subject: [ovs-dev] [PATCH v2 05/15] ovn-nbctl: Pull up releasing IDL from do_nbctl(). 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 Destroy IDL resources in the routine where we allocated them. Preparatory work for reusing the main loop in daemon mode. Signed-off-by: Jakub Sitnicki --- ovn/utilities/ovn-nbctl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ovn/utilities/ovn-nbctl.c b/ovn/utilities/ovn-nbctl.c index 51527741b..a700695fe 100644 --- a/ovn/utilities/ovn-nbctl.c +++ b/ovn/utilities/ovn-nbctl.c @@ -126,6 +126,9 @@ main(int argc, char *argv[]) main_loop(args, commands, n_commands, idl); + ovsdb_idl_destroy(idl); + idl = the_idl = NULL; + for (struct ctl_command *c = commands; c < &commands[n_commands]; c++) { ds_destroy(&c->output); table_destroy(c->table); @@ -4299,7 +4302,6 @@ do_nbctl(const char *args, struct ctl_command *commands, size_t n_commands, } ovsdb_idl_txn_destroy(txn); - ovsdb_idl_destroy(idl); return true;