Re: Turing the NM UI into an agent



On Wed, 2008-03-26 at 18:35 +0100, Marcel Holtmann wrote:
> Hi Dan,
> 
> since you are re-working most of the D-Bus APIs based around Network  
> Manager, I like to propose a radical change on how you handle the UI  
> part. Personally I think that the current UI inside Network Manager  
> (even with 0.7) has too much tasks to fulfill. I prefer having a  
> "stupid" UI.
> 
> So my main concern is that replacing the current UI is too  
> complicated. One reason is that you need a well known bus name for the  
> UI on the system bus. This makes it impossible to install two UI  
> components or split tasks between two applications. We did the same in  
> the early days of BlueZ and I think it is not a good design to hard- 
> code a well known bus name into the daemon and have the UI use the  
> same one. So for BlueZ we came up with the D-Bus agent concept. So let  
> me try to explain it.
> 
> So the UI only gets a unique name (no need for a D-Bus security file).  
> Then it registers itself a object path (the actual path value is  
> unimportant). After that it calls a RegisterAgent(object path) method  
> inside the daemon. Now the daemon knows where to find an agent (object  
> path and the unique name from the message sender value) and can call  
> into this object for additional information. It really serves as a  
> callback interface and the only things to agree on is the interface  
> description. The bus name and object path are kept random.
> 
> This concept allows an easy way of monitoring agents. So you know the  
> case when you have no agent (meaning no UI is running) or when an  
> agent dies. No unneeded D-Bus calls that might fails etc. The other  
> advantage is that in theory you can stack agents and call them in  
> order. This is useful if you have a wizard or some small cases where  
> the UI should look different from the general case. Or unregister and  
> then re-register agents. For example for multi user scenarios.

There's already a split between the UI bits and the configuration bits;
I think what you'd like to see is the User Settings service grab unique
bus names so that each user could provide their own user settings at the
same time to NetworkManager.  I'd like to go there in the future, but
then we need to figure out things that ConsoleKit will help with, but
which are still very much undefined, stuff like:

- If user A has activated a connection on eth0, is user B allowed to
control eth0 and potentially tear down user A's connection?

- If user A has activated eth0, is user B allowed to start a VPN
connection on eth0?

Stuff like that.  There might be uses for this sort of thing in
virtualization actually, but it's kind of hard to see networking as the
same sort of thing as Multi-User X, for example, where different users
get exclusive access to individual mice, keyboards, displays, and USB
flash drives.

Right now the only thing that acquires a well-known bus name is the
settings service, which doesn't have to have an UI at all.  Up until NM
0.5 it actually was a completely separate process from the applet.   If
your user has permissions to do so at the D-Bus level (ie, at_console or
whatever), then any process can call
ActivateConnection/DeactivateConnection right now.  But only 1 process
can provide the configuration data, which limits the set of what
ActivateConnection can actually connect to.

Could you describe some of the scenarios that would involve stacking UI
agents?  I'm not sure I follow the use-cases here.

Dan



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]