Should network-manger manage virbr0 ?

2015-03-19 Thread Franck Routier (perso)

Hi list,

I'm using Ubuntu and just upgraded to (still in development) Vivid.
Now I see that network-manager handles my virbr0 bridge (libvirt), which 
it didn't before.

Vivid currently ships with nm 0.9.10.0.

I can't make a decision whether this is a (packaging ?) bug or an 
intended feature, and what will be the consequences of nm mananging virbr0.


Can anyone enlighten me ?

thanks,
Franck
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Should network-manger manage virbr0 ?

2015-03-19 Thread Dan Williams
On Thu, 2015-03-19 at 09:18 +0100, Franck Routier (perso) wrote:
> Hi list,
> 
> I'm using Ubuntu and just upgraded to (still in development) Vivid.
> Now I see that network-manager handles my virbr0 bridge (libvirt), which 
> it didn't before.

NM will recognize and "manage" all network interfaces, but that does not
mean that NM actually touches the interfaces.  If the interface already
has a configuration, NM simply assumes the existing configuration and
waits for you to tell it to do something.  That's a difference from
older versions of NM (0.9.8 and earlier) where NM was mostly ignorant of
existing configuration.

We know that NM 0.9.10 still has a few edge cases where it touches
interfaces and shouldn't, but almost all of those have already been
fixed in NM 1.0 and later.

Dan

> Vivid currently ships with nm 0.9.10.0.
> 
> I can't make a decision whether this is a (packaging ?) bug or an 
> intended feature, and what will be the consequences of nm mananging virbr0.
> 
> Can anyone enlighten me ?
> 
> thanks,
> Franck
> ___
> networkmanager-list mailing list
> networkmanager-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/networkmanager-list


___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Should network-manger manage virbr0 ?

2015-03-19 Thread Franck Routier (perso)

Hi Dan,

thanks for your input.

The point is that virbr0 is handled differently than, say, vboxnet0:

virbr0 appears as "Bridge (virbr0)" and has a _disconnect_ option.
vboxnet0 appears as "Ethernet Network (vboxnet0)" and has no option, 
only saying "device not managed"...


I was under the impression that both should have been treated the same 
way. Isn't it the case ?


Franck

On 19/03/2015 15:23, Dan Williams wrote:

On Thu, 2015-03-19 at 09:18 +0100, Franck Routier (perso) wrote:

Hi list,

I'm using Ubuntu and just upgraded to (still in development) Vivid.
Now I see that network-manager handles my virbr0 bridge (libvirt), which
it didn't before.

NM will recognize and "manage" all network interfaces, but that does not
mean that NM actually touches the interfaces.  If the interface already
has a configuration, NM simply assumes the existing configuration and
waits for you to tell it to do something.  That's a difference from
older versions of NM (0.9.8 and earlier) where NM was mostly ignorant of
existing configuration.

We know that NM 0.9.10 still has a few edge cases where it touches
interfaces and shouldn't, but almost all of those have already been
fixed in NM 1.0 and later.

Dan


Vivid currently ships with nm 0.9.10.0.

I can't make a decision whether this is a (packaging ?) bug or an
intended feature, and what will be the consequences of nm mananging virbr0.

Can anyone enlighten me ?

thanks,
Franck
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list




___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: NMClient.IP4Config get_addresses() not always populated when signal 'notify::ip4-config' is fired

2015-03-19 Thread Sylvain Garaud
Hello Dan,

Thank you for the answer.
I am using NM lib version 0.9.10.0
I use the dbus-monitor command you provided.
It helped me greatly to understand my problem.

In most cases the ip info I am interested in was defined when the IP4Config
propertiesChanges signal was received. But it was not always the case
depending of the network interface type and disconnection time. My routine
using the  gi.NMClient was also missing to capture some signals that I saw
with the dbus-monitor as sometimes they were arriving in a burst.

Eventually I implemented the following solution that seems to be working
properly.

1. I register a callback on the device "state-changed" signal
2. Within the callback, I try immediately to get the ip address inside the
dhcp4 config.
3. If I get it I am done, otherwise it is undefined and I simply register a
callback on the dhcp4 options signal that hopefully will arrive later.

I tested it with several configuration and it seems to work correctly.

Thank you so much,

Sylvain


On Wed, Mar 18, 2015 at 3:44 PM, Dan Williams  wrote:

> On Sun, 2015-03-15 at 12:46 +0100, Sylvain Garaud wrote:
> > Hello,
> >
> > I am writing a small javascript for gnome to grab the ip addresses of my
> > network interfaces using imports.gi.NMClient;
> > Basically I get the devices and connect each device to the
> > notify::ip4-config signal to be able to update the ip address value when
> it
> > changes
>
> Which version of NM are you using?
>
> this.client = NMC.Client.new();
> > this.devices = this.client.get_devices();
> > for each (let device in this.devices) {
> > device.connect('notify::ip4-config',Lang.bind(this,this._update));
> > }
> >
> > It works fine for the wifi connection but there is a problem with the
> > ethernet connection.
> > After turning my ethernet connection up,  the signal 'notify::ip4-config'
> > is fired, the device state is ACTIVATED, so I try to get the ip4 config.
> > with ipcfg = device.get_ip4_config();
> > I get a not null ipcfg object, unfortunately ipcfg.get_addresses() is not
> > defined yet.
>
> So that we can narrow the issue down, could you run:
>
> dbus-monitor --system
> "type='signal',sender='org.freedesktop.NetworkManager'"
>
> and reproduce the problem?  This will let us know the sequence of D-BUs
> events that come directly from NetworkManager, so that we can see the
> raw data that libnm/libnm-glib is getting.
>
> Dan


> > I see in my journalctl log few seconds later, some dhcp network manager
> > message.
> >
> >  _update: function(device) {
> >   let ipcfg = device.get_ip4_config();
> >   if (ipcfg != null) {
> >  for each(let addr in ipcfg.get_addresses()){
> > let num = addr.get_address();
> >  }
> >   }
> >},
> >
> > How to be sure ipcfg.get_addresses() will return something ?
> > Could someone tell me which signal to use for being sure the ip address
> is
> > set when calling ipcfg.get_addresses()? I tried using the
> > 'notify::dhcp4-config' signal instead 'notify::ip4-config' without much
> > success.
> >
> > Thank you very much for your help,
> >
> > Sylvain
> > ___
> > networkmanager-list mailing list
> > networkmanager-list@gnome.org
> > https://mail.gnome.org/mailman/listinfo/networkmanager-list
>
>
>
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list