[Ovirt-devel] [PATCH] Merge developer/bundled appliance into a single appliance: ovirt-appliance

Perry N. Myers pmyers at redhat.com
Thu Jul 3 18:18:57 UTC 2008


Jeff Schroeder wrote:
> On Thu, Jul 3, 2008 at 10:57 AM, Chris Lalancette <clalance at redhat.com> wrote:
>> Perry N. Myers wrote:
>>> Jeff Schroeder wrote:
>>> [snip]
>>>>> However you did point out two things here, first is that the check for
>>>>> ifcfg-eth1 may not be sufficient to detect whether or not the designated
>>>>> interface is running.  Secondly there may be portability issues with using
>>>>> ifconfig.  I'll see if I can refactor these checks to use something like ip.
>>>>>  Suggestions from our friends working in other distros would be appreciated
>>>>> here.
>>>> What makes this more portable than the same thing using ifconfig?
>>>> "ip addr show $bridge > /dev/null 2>&1 ; bridge_dev_present=$?"
>>> No idea :) Chris just mentioned to me that ifconfig may not be portable,
>>> if you suggest that ifconfig is fairly prevalent then I am content to
>>> leave it that way for the time being.  If another random distro wants to
>>> use oVirt, then they can refactor the script accordingly.
>>>
>> I think we mis-understood each other.  ifconfig is definitely portable, it's the
>> existence of /etc/sysconfig/network-script files that is very RedHat/Fedora
>> specific.  I think these days the "ip" command is slightly preferred to the
>> "ifconfig" command, but I think either should be fine from a cross-distro point
>> of view.
> 
> Oh well in that case I agree.
> 
> For Debian-based distributions this does what you want:
> egrep -q "^(iface|auto) $bridge" /etc/network/interfaces
> 
> If the interface has been hand defined (iface...) or if the interface
> is brought up
> and magic along the lines of network-manager brings it up (auto) this
> will find it.

I'll add this logic in for Debian and keep the 
/etc/sysconfig/network-scripts/if- method as a fallback.

Perry




More information about the ovirt-devel mailing list