From patchwork Wed Sep 9 01:41:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 515662 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 74A2414031D for ; Wed, 9 Sep 2015 11:41:39 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 216A21087C; Tue, 8 Sep 2015 18:41:38 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx1e3.cudamail.com (mx1.cudamail.com [69.90.118.67]) by archives.nicira.com (Postfix) with ESMTPS id 35DDA1087B for ; Tue, 8 Sep 2015 18:41:37 -0700 (PDT) Received: from bar2.cudamail.com (localhost [127.0.0.1]) by mx1e3.cudamail.com (Postfix) with ESMTPS id 848484204E5 for ; Tue, 8 Sep 2015 19:41:36 -0600 (MDT) X-ASG-Debug-ID: 1441762895-03dc531aa110ab60001-byXFYA Received: from mx1-pf1.cudamail.com ([192.168.24.1]) by bar2.cudamail.com with ESMTP id DThl1lwbLxf5PVEO (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 08 Sep 2015 19:41:35 -0600 (MDT) X-Barracuda-Envelope-From: blp@nicira.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.1 Received: from unknown (HELO mail-pa0-f45.google.com) (209.85.220.45) by mx1-pf1.cudamail.com with ESMTPS (RC4-SHA encrypted); 9 Sep 2015 01:41:35 -0000 Received-SPF: unknown (mx1-pf1.cudamail.com: Multiple SPF records returned) X-Barracuda-RBL-Trusted-Forwarder: 209.85.220.45 Received: by padhy16 with SMTP id hy16so138095825pad.1 for ; Tue, 08 Sep 2015 18:41:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=LRDMUNWoBV43yi5hdzYIDBuNqwaporqUv1AYgJD0ubI=; b=ldEZNq5DwUVIC2Sn+SCShBWqz/Bk9mVGwpuWAxoqtGrJ+991jXvQKduwc4sQCzwqBr HQRArj7Oy6cT3raIZEPjeI5MFdvIOjXLht5UXsN9lf+Ep+jZs3/CZVGAAS2uHH0KLi2T bFrumFIMyu886S+xt5wnYsYfefq7lqJahkeeYUXyh2KOI+/C+IWBTmVwSstpj5pBtSII DhUTxebnB5XwxN0cIUPKSKBMxE1Sagy4UFLUCHxj7Tv1c3L/4XsiwbTVfQvzcPajELE0 gPQWfTC8srHjmoNeXBb+y8bYi8bket+L5Gip5ojSfITJ1UAP1FrQvKUJzgYjaffA5hTy 845A== X-Gm-Message-State: ALoCoQlAtaylnfwXUWRtym1SjjdliYJuOuLM2ePOoKRo3iam5Px3IcNUuh+stE9FyNeKkMsDCGpo X-Received: by 10.66.220.2 with SMTP id ps2mr24358468pac.128.1441762894431; Tue, 08 Sep 2015 18:41:34 -0700 (PDT) Received: from nicira.com (173-228-112-165.dsl.dynamic.fusionbroadband.com. [173.228.112.165]) by smtp.gmail.com with ESMTPSA id xv1sm4915679pbb.25.2015.09.08.18.41.32 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Sep 2015 18:41:33 -0700 (PDT) Date: Tue, 8 Sep 2015 18:41:43 -0700 X-Barracuda-Apparent-Source-IP: 173.228.112.165 X-CudaMail-Envelope-Sender: blp@nicira.com From: Ben Pfaff To: Russell Bryant X-CudaMail-Whitelist-To: dev@openvswitch.org X-CudaMail-MID: CM-E1-907109171 X-CudaMail-DTE: 090815 X-CudaMail-Originating-IP: 209.85.220.45 Message-ID: <20150909014143.GB30877@nicira.com> X-ASG-Orig-Subj: [##CM-E1-907109171##]Re: [ovs-dev] [PATCH] smap: New macro SMAP_INIT1 for initializing immutable 1-member smaps. References: <1441139751-8836-1-git-send-email-blp@nicira.com> <55E6438C.5050406@redhat.com> <20150908204240.GE3766@nicira.com> <55EF82B3.6000407@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <55EF82B3.6000407@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Barracuda-Connect: UNKNOWN[192.168.24.1] X-Barracuda-Start-Time: 1441762895 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: dev@openvswitch.org Subject: Re: [ovs-dev] [PATCH] smap: New macro SMAP_INIT1 for initializing immutable 1-member smaps. 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: , Errors-To: dev-bounces@openvswitch.org Sender: "dev" On Tue, Sep 08, 2015 at 08:52:03PM -0400, Russell Bryant wrote: > On 09/08/2015 04:42 PM, Ben Pfaff wrote: > > My first name for this was SMAP_CONST_INIT1, but it was too long in my > > opinion; it forces lines elsewhere to be split. Do you like > > SMAP_CONST1? > > SMAP_CONST1 sounds great. It's still short, yet nicely informative. Thanks. Besides that change, I added another use for code that had snuck in during review of this patch: and applied this to master. diff --git a/ovn/controller/ovn-controller.c b/ovn/controller/ovn-controller.c index 0f09c1e..8c858bb 100644 --- a/ovn/controller/ovn-controller.c +++ b/ovn/controller/ovn-controller.c @@ -95,10 +95,8 @@ create_br_int(struct controller_ctx *ctx, bridge = ovsrec_bridge_insert(ctx->ovs_idl_txn); ovsrec_bridge_set_name(bridge, bridge_name); ovsrec_bridge_set_fail_mode(bridge, "secure"); - struct smap other_config = SMAP_INITIALIZER(&other_config); - smap_add(&other_config, "disable-in-band", "true"); - ovsrec_bridge_set_other_config(bridge, &other_config); - smap_destroy(&other_config); + const struct smap oc = SMAP_CONST1(&oc, "disable-in-band", "true"); + ovsrec_bridge_set_other_config(bridge, &oc); ovsrec_bridge_set_ports(bridge, &port, 1); struct ovsrec_bridge **bridges;