<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jun 11, 2017 at 12:50 PM, Nir Soffer <span dir="ltr"><<a href="mailto:nsoffer@redhat.com" target="_blank">nsoffer@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div><div class="h5"><div dir="ltr">On Sun, Jun 11, 2017 at 9:35 AM Edward Haas <<a href="mailto:ehaas@redhat.com" target="_blank">ehaas@redhat.com</a>> 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"><<a href="mailto:danken@redhat.com" target="_blank">danken@redhat.com</a>></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 <<a href="mailto:ehaas@redhat.com" target="_blank">ehaas@redhat.com</a>> wrote:<br>
><br>
><br>
><br>
>> On 9 Jun 2017, at 19:44, Dan Kenigsberg <<a href="mailto:danken@redhat.com" target="_blank">danken@redhat.com</a>> wrote:<br>
>><br>
>>> On Fri, Jun 9, 2017 at 2:49 PM, Pavel Gashev <<a href="mailto:Pax@acronis.com" target="_blank">Pax@acronis.com</a>> wrote:<br>
>>> Hello,<br>
>>><br>
>>><br>
>>><br>
>>> I have a question about dependencies of vdsm libraries. Could somebody<br>
>>> suggest how I can use vdsm.network.ipwrapper from vdsm.storage?<br>
>>><br>
>>><br>
>>><br>
>>> Specifically, I need a way to determine that an IP address of NFS path is<br>
>>> local. The right way to determine that is as simple as the following:<br>
>>><br>
>>><br>
>>><br>
>>> # /sbin/ip route get X.X.X.X | grep -q ^local && echo IP is local<br>
>>><br>
>>><br>
>>><br>
>>> This is why I need to use vdsm.network.ipwrapper. See details at<br>
>>> <a href="https://gerrit.ovirt.org/#/c/68822/" rel="noreferrer" target="_blank">https://gerrit.ovirt.org/#/c/<wbr>68822/</a><br>
>><br>
>> I think that we should create a new<br>
>> vdsm.network.api.is_local_<wbr>address() for this. Do you have a better<br>
>> idea, Edy?<br>
>><br>
>> P.S I just notice that we have a similar problem in already merged to iscsi.py:<br>
>><br>
>> from vdsm.network.netinfo.routes import getRouteDeviceTo<br>
>><br>
>> should be similarly avoided.<br>
><br>
> 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>
><br>
> 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>
> This could fit a helper in common.network, but we'll need execCmd moved to common first.<br>
<br>
</span>I'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's actually not urgent for network separation, storage is dependent on network anyway and it is part of it's strategy on how to separate itself.<br></div></div></div></div></blockquote><div><br></div></div></div><div>I don'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><span class=""><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></span><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></div></blockquote><div><br></div><div>I do not see this happening any-time soon unless you know anyone who took this task on himself.<br></div><div>Network has now a very simple version as it does not need any special functionality.<br></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_quote"><span class=""><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></span><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><div><br></div><div>Because ipwrapper does 100 things and you now just need 1 of those.<br></div><div>We should move to common only heavy used functionality with enough complexity to be worth it.<br></div><div>Contaminating common with too much noise is also bad, we need some balance.<br></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_quote"><span class=""><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 "ip route.." commands as vdsm-network api (network.api), it feels wrong.<br></div></div></div></div></blockquote><div><br></div></span><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" target="_blank">https://gerrit.ovirt.org/<wbr>68822</a></div><div><br></div><div>I don'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></div></blockquote><div><br></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_quote"><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>
______________________________<wbr>_________________<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/<wbr>mailman/listinfo/devel</a></blockquote></div></div>
</blockquote></div><br></div></div>