From patchwork Wed Jul 11 19:27:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Sitnicki X-Patchwork-Id: 942646 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 41Qpzh3vMYz9s01 for ; Thu, 12 Jul 2018 05:29:36 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 97ADF1058; Wed, 11 Jul 2018 19:27:31 +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 00E851045 for ; Wed, 11 Jul 2018 19:27:29 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com [74.125.82.41]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 80C99771 for ; Wed, 11 Jul 2018 19:27:28 +0000 (UTC) Received: by mail-wm0-f41.google.com with SMTP id i139-v6so3410728wmf.4 for ; Wed, 11 Jul 2018 12:27:28 -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=DOzZcuqJ8bA7ucqnGvgZg1yzghZFLR6iJmsGng1KqvH0xK8oXNW6g04Vfll3diCPAR 2dfIRtIDfec3QV3fM8+TtVITqTJbECbFaI16M/6meXC9Ir3FNZP757L9j6CV2u/Ezcfm ozw7t7bQlgMDOHN1H9zK9TciA7KB+0mDyqAhk7eNp7XgtkKXtVnAiS4zYKUyH0oll6GX W4vq6yDhiMwIGT9J5I1KdP2dfixgXXYRuP8n1p4zKmiokFMBswNDCqXFUpoJwMVa4kSb n8cgi8nEUN88sFUbeb4IVTVeMVMITwpvTQMRZKln/PpoCPjkeRpVg8ROYpPKnqKEhNnb xPwg== X-Gm-Message-State: APt69E2DFYcejwWpvGFdET8AvtIr+Eip6yKWaTiCqXVFi+8q4lZYAE9g /jubpv58zLm+5pDKCf0MzPgXFnl/wio= X-Google-Smtp-Source: AAOMgpce9mfu6jjKXFc4y0djfyaWxJNJj01Asx7Cpdf/JkrsIzGe/bxcFBAz2xsT1BVGiqRgKUiHNw== X-Received: by 2002:a1c:84d0:: with SMTP id g199-v6mr20071921wmd.90.1531337246982; Wed, 11 Jul 2018 12:27:26 -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 73-v6sm4467324wmu.37.2018.07.11.12.27.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Jul 2018 12:27:26 -0700 (PDT) From: Jakub Sitnicki To: dev@openvswitch.org Date: Wed, 11 Jul 2018 21:27:07 +0200 Message-Id: <20180711192717.21409-6-jkbs@redhat.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180711192717.21409-1-jkbs@redhat.com> References: <20180711192717.21409-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 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;