<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Sun, Jun 11, 2017 at 9:35 AM Edward Haas &lt;<a href="mailto:ehaas@redhat.com">ehaas@redhat.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sat, Jun 10, 2017 at 1:27 AM, Dan Kenigsberg <span dir="ltr">&lt;<a href="mailto:danken@redhat.com" target="_blank">danken@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On Fri, Jun 9, 2017 at 10:09 PM, Edward Haas &lt;<a href="mailto:ehaas@redhat.com" target="_blank">ehaas@redhat.com</a>&gt; wrote:<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;&gt; On 9 Jun 2017, at 19:44, Dan Kenigsberg &lt;<a href="mailto:danken@redhat.com" target="_blank">danken@redhat.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt;&gt; On Fri, Jun 9, 2017 at 2:49 PM, Pavel Gashev &lt;<a href="mailto:Pax@acronis.com" target="_blank">Pax@acronis.com</a>&gt; wrote:<br>
&gt;&gt;&gt; Hello,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; I have a question about dependencies of vdsm libraries. Could somebody<br>
&gt;&gt;&gt; suggest how I can use vdsm.network.ipwrapper from vdsm.storage?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Specifically, I need a way to determine that an IP address of NFS path is<br>
&gt;&gt;&gt; local. The right way to determine that is as simple as the following:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; # /sbin/ip route get X.X.X.X | grep -q ^local &amp;&amp; echo IP is local<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; This is why I need to use vdsm.network.ipwrapper. See details at<br>
&gt;&gt;&gt; <a href="https://gerrit.ovirt.org/#/c/68822/" rel="noreferrer" target="_blank">https://gerrit.ovirt.org/#/c/68822/</a><br>
&gt;&gt;<br>
&gt;&gt; I think that we should create a new<br>
&gt;&gt; vdsm.network.api.is_local_address() for this. Do you have a better<br>
&gt;&gt; idea, Edy?<br>
&gt;&gt;<br>
&gt;&gt; P.S I just notice that we have a similar problem in already merged to iscsi.py:<br>
&gt;&gt;<br>
&gt;&gt; from vdsm.network.netinfo.routes import getRouteDeviceTo<br>
&gt;&gt;<br>
&gt;&gt; should be similarly avoided.<br>
&gt;<br>
&gt; Anyone outside the network subtree accessing anything except the api module is in risk, as internals may be changed or removed. It is equivalent to accessing a private attribute in python.<br>
&gt;<br>
&gt; In general I am not in favor of contacting the network package for things that are not really its main business logic. Asking it if an IP is under one of the networks it manages seems fine, but asking this in general for the host is something else.<br>
&gt; This could fit a helper in common.network, but we&#39;ll need execCmd moved to common first.<br>
<br>
</span>I&#39;d like to assist Paval ASAP, and removing the storage dep on network<br>
internal is also urgent for the task of network separation. Do we have<br>
a short timeline for moving execCmd? If not, would you consider ad-hoc<br>
api entries?<br></blockquote><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>It&#39;s actually not urgent for network separation, storage is dependent on network anyway and it is part of it&#39;s strategy on how to separate itself.<br></div></div></div></div></blockquote><div><br></div><div>I don&#39;t know about any dependency on network in storage, except the </div><div>iscsi rp filter, which should be fixed by moving this functionality to common.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div></div><div>I have no plans for execCmd, it required too much changes for moving it to common</div></div></div></div></blockquote><div><br></div><div>execCmd will move to common soon, together will all the code under lib/vdsm/</div><div><br></div><div>We will not create another copy of execCmd, in common, we need to remove</div><div>the unneeded copy under network instead.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> and we found a workaround (network.cmd).<br></div><div>We could implement a simple local exec command using C/Popen under common.network if you are ok with it. And we will need to implement part of the parsing (or use grep as suggested).<br></div></div></div></div></blockquote><div><br></div><div>Why not move the ipwrapper module to common? This module should</div><div>not have anything which with network business logic, just an easy way</div><div>to run this command - just like udevadm, this does not belong to any</div><div>subsystem.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div></div><div>I do not think we should expose &quot;ip route..&quot; commands as vdsm-network api (network.api), it feels wrong.<br></div></div></div></div></blockquote><div><br></div><div>Pavel needs a way to detect if an ip address (ipv4/6) is the address of</div><div>the local host, so we can use bind mount instead of regular mount.</div><div>See <a href="https://gerrit.ovirt.org/68822">https://gerrit.ovirt.org/68822</a></div><div><br></div><div>I don&#39;t see a need to depend on network package for this, this is not</div><div>a service of the network package.</div><div><br></div><div>If you think these should be a service of the network package, we</div><div>need an entry point to access these apis.</div><div><br></div><div>Nir</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div></div><div><br></div></div><br></div></div>
_______________________________________________<br>
Devel mailing list<br>
<a href="mailto:Devel@ovirt.org" target="_blank">Devel@ovirt.org</a><br>
<a href="http://lists.ovirt.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.ovirt.org/mailman/listinfo/devel</a></blockquote></div></div>