All of lore.kernel.org
 help / color / mirror / Atom feed
* kvm-ifup bug with complex default routes
@ 2007-04-01 18:28 Baruch Even
       [not found] ` <20070401182810.GT25760-xGn4Jn0woyz+OtfAA3OxFg@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Baruch Even @ 2007-04-01 18:28 UTC (permalink / raw)
  To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

A user just submitted a bug report against the kvm-18 debian package.
You can find the bug report at
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=417151

The user has a default route with extra features and the kvm-ifup script
fails for him, his default route looks like:
default via 10.0.0.138 dev br0  metric 1 realm 10

His suggestion to fix is:
-switch=$(/sbin/ip route list | awk '/^default / { print $NF }')
+switch=$(ip route ls | awk '/^default / { for(i=0;i<$NF;i++) { if ($(i) == "dev") print $(i+1) }}')

Cheers,
Baruch

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: kvm-ifup bug with complex default routes
       [not found] ` <20070401182810.GT25760-xGn4Jn0woyz+OtfAA3OxFg@public.gmane.org>
@ 2007-04-01 21:30   ` Dor Laor
       [not found]     ` <64F9B87B6B770947A9F8391472E032160B21EF6C-yEcIvxbTEBqsx+V+t5oei8rau4O3wl8o3fe8/T/H7NteoWH0uzbU5w@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Dor Laor @ 2007-04-01 21:30 UTC (permalink / raw)
  To: Baruch Even, kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

>
>A user just submitted a bug report against the kvm-18 debian package.
>You can find the bug report at
>http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=417151
>
>The user has a default route with extra features and the kvm-ifup
script
>fails for him, his default route looks like:
>default via 10.0.0.138 dev br0  metric 1 realm 10
>
>His suggestion to fix is:
>-switch=$(/sbin/ip route list | awk '/^default / { print $NF }')
>+switch=$(ip route ls | awk '/^default / { for(i=0;i<$NF;i++) { if
($(i) ==
>"dev") print $(i+1) }}')

Actually using the default route in order to get the bridge name is a
bad thing. The best is to use brctl show and pick the bridge that has
the interface attached.

>
>Cheers,
>Baruch
>
>-----------------------------------------------------------------------
--
>Take Surveys. Earn Cash. Influence the Future of IT
>Join SourceForge.net's Techsay panel and you'll get the chance to share
>your
>opinions on IT & business topics through brief surveys-and earn cash
>http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVD
EV
>_______________________________________________
>kvm-devel mailing list
>kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
>https://lists.sourceforge.net/lists/listinfo/kvm-devel

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: kvm-ifup bug with complex default routes
       [not found]     ` <64F9B87B6B770947A9F8391472E032160B21EF6C-yEcIvxbTEBqsx+V+t5oei8rau4O3wl8o3fe8/T/H7NteoWH0uzbU5w@public.gmane.org>
@ 2007-04-02  6:53       ` Baruch Even
       [not found]         ` <20070402065330.GU25760-xGn4Jn0woyz+OtfAA3OxFg@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Baruch Even @ 2007-04-02  6:53 UTC (permalink / raw)
  To: Dor Laor; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

* Dor Laor <dor.laor-atKUWr5tajBWk0Htik3J/w@public.gmane.org> [070402 00:43]:
> >
> >A user just submitted a bug report against the kvm-18 debian package.
> >You can find the bug report at
> >http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=417151
> >
> >The user has a default route with extra features and the kvm-ifup
> script
> >fails for him, his default route looks like:
> >default via 10.0.0.138 dev br0  metric 1 realm 10
> >
> >His suggestion to fix is:
> >-switch=$(/sbin/ip route list | awk '/^default / { print $NF }')
> >+switch=$(ip route ls | awk '/^default / { for(i=0;i<$NF;i++) { if
> ($(i) ==
> >"dev") print $(i+1) }}')
> 
> Actually using the default route in order to get the bridge name is a
> bad thing. The best is to use brctl show and pick the bridge that has
> the interface attached.

The current approach has its problems, especially if there is no bridge
defined. But what if I have multiple bridges? You will need to figure
out which one of them to use.

But then, this script can't take care of all situations, only of simple
and common ones, the fix suggested above just improves coverage for a
few more cases.

Baruch

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: kvm-ifup bug with complex default routes
       [not found]         ` <20070402065330.GU25760-xGn4Jn0woyz+OtfAA3OxFg@public.gmane.org>
@ 2007-04-02  7:44           ` Avi Kivity
       [not found]             ` <4610B478.3030107-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Avi Kivity @ 2007-04-02  7:44 UTC (permalink / raw)
  To: Baruch Even; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Baruch Even wrote:
> * Dor Laor <dor.laor-atKUWr5tajBWk0Htik3J/w@public.gmane.org> [070402 00:43]:
>   
>>> A user just submitted a bug report against the kvm-18 debian package.
>>> You can find the bug report at
>>> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=417151
>>>
>>> The user has a default route with extra features and the kvm-ifup
>>>       
>> script
>>     
>>> fails for him, his default route looks like:
>>> default via 10.0.0.138 dev br0  metric 1 realm 10
>>>
>>> His suggestion to fix is:
>>> -switch=$(/sbin/ip route list | awk '/^default / { print $NF }')
>>> +switch=$(ip route ls | awk '/^default / { for(i=0;i<$NF;i++) { if
>>>       
>> ($(i) ==
>>     
>>> "dev") print $(i+1) }}')
>>>       
>> Actually using the default route in order to get the bridge name is a
>> bad thing. The best is to use brctl show and pick the bridge that has
>> the interface attached.
>>     
>
> The current approach has its problems, especially if there is no bridge
> defined. But what if I have multiple bridges? You will need to figure
> out which one of them to use.
>
> But then, this script can't take care of all situations, only of simple
> and common ones, the fix suggested above just improves coverage for a
> few more cases.
>   

I think the correct solution is to set up the bridge where and when 
networking is configured, using the regular configuration files and 
supported by the regular tools.  That's the only way we can deal with 
all the various options.  If there's only one bridge, qemu can use it; 
if there's more, qemu-ifup should read some configuration file to select 
the bridge.

Fedora has some support for bridging in initscripts: I have an ifcfg-sw0 
with TYPE=Bridge and ifcfg-eth0 with BRIDGE=sw0.  Seems to work fine, 
and no need to transfer addresses and routes and dhcp client daemons and 
whatnot.

-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: kvm-ifup bug with complex default routes
       [not found]             ` <4610B478.3030107-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2007-04-02  7:55               ` Dor Laor
  0 siblings, 0 replies; 5+ messages in thread
From: Dor Laor @ 2007-04-02  7:55 UTC (permalink / raw)
  To: Avi Kivity, Baruch Even; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

>Baruch Even wrote:
>> * Dor Laor <dor.laor-atKUWr5tajBWk0Htik3J/w@public.gmane.org> [070402 00:43]:
>>
>>>> A user just submitted a bug report against the kvm-18 debian
package.
>>>> You can find the bug report at
>>>> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=417151
>>>>
>>>> The user has a default route with extra features and the kvm-ifup
>>>>
>>> script
>>>
>>>> fails for him, his default route looks like:
>>>> default via 10.0.0.138 dev br0  metric 1 realm 10
>>>>
>>>> His suggestion to fix is:
>>>> -switch=$(/sbin/ip route list | awk '/^default / { print $NF }')
>>>> +switch=$(ip route ls | awk '/^default / { for(i=0;i<$NF;i++) { if
>>>>
>>> ($(i) ==
>>>
>>>> "dev") print $(i+1) }}')
>>>>
>>> Actually using the default route in order to get the bridge name is
a
>>> bad thing. The best is to use brctl show and pick the bridge that
has
>>> the interface attached.
>>>
>>
>> The current approach has its problems, especially if there is no
bridge
>> defined. But what if I have multiple bridges? You will need to figure
>> out which one of them to use.
>>
>> But then, this script can't take care of all situations, only of
simple
>> and common ones, the fix suggested above just improves coverage for a
>> few more cases.
>>
>
>I think the correct solution is to set up the bridge where and when
>networking is configured, using the regular configuration files and
>supported by the regular tools.  That's the only way we can deal with
>all the various options.  If there's only one bridge, qemu can use it;
>if there's more, qemu-ifup should read some configuration file to
select
>the bridge.
>
>Fedora has some support for bridging in initscripts: I have an
ifcfg-sw0
>with TYPE=Bridge and ifcfg-eth0 with BRIDGE=sw0.  Seems to work fine,
>and no need to transfer addresses and routes and dhcp client daemons
and
>whatnot.

In general you're right. The only problem is that the ifcfg-XX scripts 
do not work well while having bridge over bond interface.
If someone of our Redhat friends and also at debian will pick up the
glove 
and fix it we will do the same.
Anyway I think qemu guys use such call to external script because there
are
plenty of distributions.

So first the script should use the existing bridge, then the standard
bridge
creation tools can be used.


>
>--
>Do not meddle in the internals of kernels, for they are subtle and
quick to
>panic.


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-04-02  7:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-01 18:28 kvm-ifup bug with complex default routes Baruch Even
     [not found] ` <20070401182810.GT25760-xGn4Jn0woyz+OtfAA3OxFg@public.gmane.org>
2007-04-01 21:30   ` Dor Laor
     [not found]     ` <64F9B87B6B770947A9F8391472E032160B21EF6C-yEcIvxbTEBqsx+V+t5oei8rau4O3wl8o3fe8/T/H7NteoWH0uzbU5w@public.gmane.org>
2007-04-02  6:53       ` Baruch Even
     [not found]         ` <20070402065330.GU25760-xGn4Jn0woyz+OtfAA3OxFg@public.gmane.org>
2007-04-02  7:44           ` Avi Kivity
     [not found]             ` <4610B478.3030107-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-04-02  7:55               ` Dor Laor

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.