<p>fixeria has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-bts/+/24289">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">common/vty: facilitate finding duplicate PHY/TRX associations<br><br>In phy_instance_link_to_trx(), if the given PHY instance is already<br>associated with a TRX instance, unbind the later from it.<br><br>In cfg_trx_phy_cmd(), use phy_instance_link_to_trx().  Tolerate<br>duplicate entries (just print a warning) in the interactive VTY<br>mode, abort if we're reading from the configuration file.<br><br>Change-Id: I132e08fc496abef278b94254cebfac7a4285a7c2<br>---<br>M src/common/phy_link.c<br>M src/common/vty.c<br>2 files changed, 12 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/89/24289/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/common/phy_link.c b/src/common/phy_link.c</span><br><span>index 7743c22..b22d877 100644</span><br><span>--- a/src/common/phy_link.c</span><br><span>+++ b/src/common/phy_link.c</span><br><span>@@ -118,6 +118,9 @@</span><br><span> </span><br><span> void phy_instance_link_to_trx(struct phy_instance *pinst, struct gsm_bts_trx *trx)</span><br><span> {</span><br><span style="color: hsl(120, 100%, 40%);">+      /* There might already be an associated TRX */</span><br><span style="color: hsl(120, 100%, 40%);">+        if (pinst->trx != NULL)</span><br><span style="color: hsl(120, 100%, 40%);">+            pinst->trx->pinst = NULL;</span><br><span>      trx->pinst = pinst;</span><br><span>       pinst->trx = trx;</span><br><span> }</span><br><span>diff --git a/src/common/vty.c b/src/common/vty.c</span><br><span>index d4e2902..4bf9761 100644</span><br><span>--- a/src/common/vty.c</span><br><span>+++ b/src/common/vty.c</span><br><span>@@ -987,8 +987,15 @@</span><br><span>                return CMD_WARNING;</span><br><span>  }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-   trx->pinst = pinst;</span><br><span style="color: hsl(0, 100%, 40%);">-  pinst->trx = trx;</span><br><span style="color: hsl(120, 100%, 40%);">+  if (pinst->trx != NULL) {</span><br><span style="color: hsl(120, 100%, 40%);">+          vty_out(vty, "phy%s instance %s is already bound to %s%s",</span><br><span style="color: hsl(120, 100%, 40%);">+                  argv[0], argv[1], gsm_trx_name(pinst->trx), VTY_NEWLINE);</span><br><span style="color: hsl(120, 100%, 40%);">+          /* Be tolerant in the interactive VTY mode */</span><br><span style="color: hsl(120, 100%, 40%);">+         if (vty->type == VTY_FILE)</span><br><span style="color: hsl(120, 100%, 40%);">+                 return CMD_WARNING;</span><br><span style="color: hsl(120, 100%, 40%);">+   }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   phy_instance_link_to_trx(pinst, trx);</span><br><span> </span><br><span>    return CMD_SUCCESS;</span><br><span> }</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bts/+/24289">change 24289</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-bts/+/24289"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-bts </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I132e08fc496abef278b94254cebfac7a4285a7c2 </div>
<div style="display:none"> Gerrit-Change-Number: 24289 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>