Thanks, pushed.<br><br><div class="gmail_quote">On Thu, Apr 29, 2010 at 3:48 PM, Justin Pettit <span dir="ltr">&lt;<a href="mailto:jpettit@nicira.com">jpettit@nicira.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Looks good to me.<br>
<br>
--Justin<br>
<div><div></div><div class="h5"><br>
<br>
On Apr 29, 2010, at 3:21 PM, Jesse Gross wrote:<br>
<br>
&gt; Previously we would keep interfaces around that couldn&#39;t be opened<br>
&gt; because they might be internal interfaces that are created later.<br>
&gt; However, this leads to a race condition if the interface appears<br>
&gt; after we try to create it and fails since some operations may<br>
&gt; succeed.  Instead, give up on the interface immediately if it can&#39;t<br>
&gt; be opened and isn&#39;t internal (which we control and so won&#39;t have<br>
&gt; this issue).<br>
&gt; ---<br>
&gt; vswitchd/bridge.c |   29 +++++++++++++++++++----------<br>
&gt; 1 files changed, 19 insertions(+), 10 deletions(-)<br>
&gt;<br>
&gt; diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c<br>
&gt; index 6254251..c883cf5 100644<br>
&gt; --- a/vswitchd/bridge.c<br>
&gt; +++ b/vswitchd/bridge.c<br>
&gt; @@ -1474,7 +1474,13 @@ bridge_reconfigure_one(const struct ovsrec_open_vswitch *ovs_cfg,<br>
&gt;         if (!port) {<br>
&gt;             port = port_create(br, node-&gt;name);<br>
&gt;         }<br>
&gt; +<br>
&gt;         port_reconfigure(port, node-&gt;data);<br>
&gt; +        if (!port-&gt;n_ifaces) {<br>
&gt; +            VLOG_WARN(&quot;bridge %s: port %s has no interfaces, dropping&quot;,<br>
&gt; +                      br-&gt;name, port-&gt;name);<br>
&gt; +            port_destroy(port);<br>
&gt; +        }<br>
&gt;     }<br>
&gt;     shash_destroy(&amp;old_ports);<br>
&gt;     shash_destroy(&amp;new_ports);<br>
&gt; @@ -3604,6 +3610,19 @@ iface_create(struct port *port, const struct ovsrec_interface *if_cfg)<br>
&gt;     iface-&gt;netdev = NULL;<br>
&gt;     iface-&gt;cfg = if_cfg;<br>
&gt;<br>
&gt; +    /* Attempt to create the network interface in case it doesn&#39;t exist yet. */<br>
&gt; +    if (!iface_is_internal(port-&gt;bridge, iface-&gt;name)) {<br>
&gt; +        error = set_up_iface(if_cfg, iface, true);<br>
&gt; +        if (error) {<br>
&gt; +            VLOG_WARN(&quot;could not create iface %s: %s&quot;, iface-&gt;name,<br>
&gt; +                      strerror(error));<br>
&gt; +<br>
&gt; +            free(iface-&gt;name);<br>
&gt; +            free(iface);<br>
&gt; +            return NULL;<br>
&gt; +        }<br>
&gt; +    }<br>
&gt; +<br>
&gt;     if (port-&gt;n_ifaces &gt;= port-&gt;allocated_ifaces) {<br>
&gt;         port-&gt;ifaces = x2nrealloc(port-&gt;ifaces, &amp;port-&gt;allocated_ifaces,<br>
&gt;                                   sizeof *port-&gt;ifaces);<br>
&gt; @@ -3613,16 +3632,6 @@ iface_create(struct port *port, const struct ovsrec_interface *if_cfg)<br>
&gt;         port-&gt;bridge-&gt;has_bonded_ports = true;<br>
&gt;     }<br>
&gt;<br>
&gt; -    /* Attempt to create the network interface in case it<br>
&gt; -     * doesn&#39;t exist yet. */<br>
&gt; -    if (!iface_is_internal(port-&gt;bridge, iface-&gt;name)) {<br>
&gt; -        error = set_up_iface(if_cfg, iface, true);<br>
&gt; -        if (error) {<br>
&gt; -            VLOG_WARN(&quot;could not create iface %s: %s&quot;, iface-&gt;name,<br>
&gt; -                    strerror(error));<br>
&gt; -        }<br>
&gt; -    }<br>
&gt; -<br>
&gt;     VLOG_DBG(&quot;attached network device %s to port %s&quot;, iface-&gt;name, port-&gt;name);<br>
&gt;<br>
&gt;     bridge_flush(port-&gt;bridge);<br>
&gt; --<br>
&gt; 1.7.0.4<br>
&gt;<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; dev mailing list<br>
&gt; <a href="mailto:dev@openvswitch.org">dev@openvswitch.org</a><br>
&gt; <a href="http://openvswitch.org/mailman/listinfo/dev_openvswitch.org" target="_blank">http://openvswitch.org/mailman/listinfo/dev_openvswitch.org</a><br>
<br>
</blockquote></div><br>