After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 708245 - [review] jklimes/team: applet/editor support for Team devices
[review] jklimes/team: applet/editor support for Team devices
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: nm-connection-editor
git master
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-09-17 15:03 UTC by Jiri Klimes
Modified: 2013-10-11 07:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Change how to choose the team_num for a new team device (3.24 KB, patch)
2013-09-18 08:39 UTC, Thomas Haller
none Details | Review

Description Jiri Klimes 2013-09-17 15:03:03 UTC
Please review the branch jklimes/team.

It contains patches from jpirko:
https://mail.gnome.org/archives/networkmanager-list/2013-September/msg00027.html
and I have added one patch to enhance JSON config widget.
Comment 1 Thomas Haller 2013-09-18 08:39:33 UTC
Created attachment 255156 [details] [review]
Change how to choose the team_num for a new team device

This algorithm used in page-team.c is the same as for page-bond.c, page-bridge.c, and possibly others. Maybe choose it there too?
Comment 2 Thomas Haller 2013-09-18 08:42:36 UTC
s/, and possibly others//g

nope, just bond, bridge and team AFAIS.
Comment 3 Jiri Klimes 2013-09-18 11:23:26 UTC
The patch from comment #1 looks fine. I just reverted the part creating the setting, it didn't compile.
I added the fixed patch to jklimes/team branch and rebased to master.

Thomas, please change the interface num selection also for bond and bridge and push.
Comment 4 Jiri Klimes 2013-10-03 16:24:50 UTC
I have rebased jklimes/team to master and added two commits:
25a6d1e editor: only allow adding slaves of the same type to master Team
97a4934 editor: change JSON TeamPort config widget from GEntry to GTextView

Please review so that it can be pushed soon.
Comment 5 Dan Winship 2013-10-03 21:12:00 UTC
(In reply to comment #4)
> 25a6d1e editor: only allow adding slaves of the same type to master Team

Not quite; it's "of the same arp type" really. So you can mix Ethernet and Wi-Fi, you just can't mix either of those with InfiniBand. (The bond page doesn't run into this because it doesn't support Wi-Fi.)

> 97a4934 editor: change JSON TeamPort config widget from GEntry to GTextView

Hm... the UI there (and on the Team page) makes it look like it's going to store the filename in the ifcfg file, and load the JSON data from that file at runtime. (People get confused about that with the X509 certificate selector buttons.) I think you should have just an "Import..." button (not a filechooser button), that pops up a filechooser, so that the filename of the file never shows in the editor window.
Comment 6 Jiri Klimes 2013-10-07 08:37:11 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > 25a6d1e editor: only allow adding slaves of the same type to master Team
> 
> Not quite; it's "of the same arp type" really. So you can mix Ethernet and
> Wi-Fi, you just can't mix either of those with InfiniBand. (The bond page
> doesn't run into this because it doesn't support Wi-Fi.)
> 
Updated to support either InfiniBand or (ethernet, Wi-Fi, VLAN)

> > 97a4934 editor: change JSON TeamPort config widget from GEntry to GTextView
> 
> Hm... the UI there (and on the Team page) makes it look like it's going to
> store the filename in the ifcfg file, and load the JSON data from that file at
> runtime. (People get confused about that with the X509 certificate selector
> buttons.) I think you should have just an "Import..." button (not a filechooser
> button), that pops up a filechooser, so that the filename of the file never
> shows in the editor window.
Done.
I squashed the following commits into one.
editor: change JSON TeamPort config widget from GEntry to GTextViewconnection-editor: some .ui file layout fixes for Team and Team Port
editor: change JSON Team config widget from GEntry to GTextView

Please re-review top two commits of jklimes/team.
Comment 7 Dan Winship 2013-10-07 14:36:34 UTC
looks good
Comment 8 Jiri Klimes 2013-10-07 16:37:49 UTC
Merged jklimes/team to master:

ba7652f team: merge a branch adding support for Team to applet/editor (bgo #708245)
e98d975 editor: only allow adding compatible slaves to master Team connection
697f7f4 editor: change JSON Team/TeamPort config widget from GEntry to GTextView
148d15a team: make algorithm for choosing new team_num deterministic
e2bf4cd libnm-gtk: recognize Team as a valid virtual device
9ce2701 editor: use unambiguous mnemonic kyes for Team and TeamPort pages
6ecb131 add support for team devices
Comment 9 Dan Williams 2013-10-08 04:51:43 UTC
Two things I saw in "editor: change JSON Team/TeamPort config widget from GEntry to GTextView"...

1) the import dialog should be cached and torn down in both the port and the main team page, otherwise you can click out of the import dialog, hit "Cancel" and the editor will crash with a use-after-free because the page is disposed but the response handler for the dialog still tries to use it

2) the import dialog's parent should probably be set to the page's window parent (with gtk_widget_get_parent_window() maybe?) so that it gets attached to the parent window, because it really is modal to the parent.  This would also let the shell draw it as a sheet instead of just layering it over the team tab
Comment 10 Jiri Klimes 2013-10-08 14:05:34 UTC
(In reply to comment #9)
> Two things I saw in "editor: change JSON Team/TeamPort config widget from
> GEntry to GTextView"...
> 
> 1) the import dialog should be cached and torn down in both the port and the
> main team page, otherwise you can click out of the import dialog, hit "Cancel"
> and the editor will crash with a use-after-free because the page is disposed
> but the response handler for the dialog still tries to use it
> 
Well, so make the import dialog really modal by calling gtk_dialog_run() instead of "response" signal. This will prevent users from cancelling the main page. 

> 2) the import dialog's parent should probably be set to the page's window
> parent (with gtk_widget_get_parent_window() maybe?) so that it gets attached to
> the parent window, because it really is modal to the parent.  This would also
> let the shell draw it as a sheet instead of just layering it over the team tab
Parent window set for the dialog.

See updated jklimes/team branch.
Comment 11 Dan Williams 2013-10-09 15:57:28 UTC
Only one comment about the patch, formatting:

+	if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
+	{

Also pushed a quick fixup patch for getting toplevel for team master.  The json widget won't necessarily have a toplevel parent yet at page init time, we have to wait until the widget is realized (and thus embedded in a window) to get it.  Please review that one, and feel free to squash it into yours when you merge.

Rest looks good, thanks!
Comment 12 Jiri Klimes 2013-10-11 07:21:06 UTC
Thanks for reviewing.

Fixed, squashed, pushed to master:
d43f58da694cd16f274eef19c5dde9f7d4b8ca32