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 732218 - Some fixes to the new sharing plugin
Some fixes to the new sharing plugin
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: sharing
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2014-06-25 10:33 UTC by Giovanni Campagna
Modified: 2014-06-25 17:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
sharing: use UUIDs instead of IDs for NM connection identification (3.96 KB, patch)
2014-06-25 10:33 UTC, Giovanni Campagna
needs-work Details | Review
sharing: include wwan connection types as broadband (1.36 KB, patch)
2014-06-25 10:33 UTC, Giovanni Campagna
committed Details | Review
sharing: fix deactivation of services when changing network (4.55 KB, patch)
2014-06-25 10:33 UTC, Giovanni Campagna
accepted-commit_now Details | Review
sharing: don't shutdown rygel if not autostarted (1.32 KB, patch)
2014-06-25 10:33 UTC, Giovanni Campagna
committed Details | Review
sharing: Fix deactivation of services when changing network (4.37 KB, patch)
2014-06-25 13:23 UTC, Bastien Nocera
committed Details | Review

Description Giovanni Campagna 2014-06-25 10:33:23 UTC
From code review
Comment 1 Giovanni Campagna 2014-06-25 10:33:26 UTC
Created attachment 279205 [details] [review]
sharing: use UUIDs instead of IDs for NM connection identification

Despite the name, the connection ID is a human readable string
and is not guaranteed to be unique.
Comment 2 Giovanni Campagna 2014-06-25 10:33:31 UTC
Created attachment 279206 [details] [review]
sharing: include wwan connection types as broadband

For wwan modems directly attached to the computer.
Comment 3 Giovanni Campagna 2014-06-25 10:33:36 UTC
Created attachment 279207 [details] [review]
sharing: fix deactivation of services when changing network

When switching between networks that both allow sharing in general,
we need to check the enabled connections for each service and
possibly stop it.
Comment 4 Giovanni Campagna 2014-06-25 10:33:41 UTC
Created attachment 279208 [details] [review]
sharing: don't shutdown rygel if not autostarted

Rygel is also dbus activated, so we should not call it unless
we know it is running.
Comment 5 Bastien Nocera 2014-06-25 10:35:04 UTC
Review of attachment 279208 [details] [review]:

Looks good.
Comment 6 Bastien Nocera 2014-06-25 10:36:29 UTC
Review of attachment 279207 [details] [review]:

How do you switch between networks without going through the "" (empty) network, and thus bringing down all services?
Comment 7 Bastien Nocera 2014-06-25 10:36:51 UTC
Review of attachment 279206 [details] [review]:

Yes.
Comment 8 Bastien Nocera 2014-06-25 10:38:28 UTC
Review of attachment 279205 [details] [review]:

That breaks the UI. The UUIDs would be shown directly in the UI.
Comment 9 Giovanni Campagna 2014-06-25 10:43:04 UTC
(In reply to comment #6)
> Review of attachment 279207 [details] [review]:
> 
> How do you switch between networks without going through the "" (empty)
> network, and thus bringing down all services?

You can switch primary without disconnecting the old one - for example by plugging a cable while connected to wifi. NM will switch the default route when the cable is set up (thus changing PrimaryConnection), but will not disconnect wifi automatically.

(In reply to comment #8)
> Review of attachment 279205 [details] [review]:
> 
> That breaks the UI. The UUIDs would be shown directly in the UI.

Then the UI needs to resolve them...
Comment 10 Bastien Nocera 2014-06-25 10:45:49 UTC
(In reply to comment #9)
> (In reply to comment #6)
> > Review of attachment 279207 [details] [review] [details]:
> > 
> > How do you switch between networks without going through the "" (empty)
> > network, and thus bringing down all services?
> 
> You can switch primary without disconnecting the old one - for example by
> plugging a cable while connected to wifi. NM will switch the default route when
> the cable is set up (thus changing PrimaryConnection), but will not disconnect
> wifi automatically.

OK, will review.

> (In reply to comment #8)
> > Review of attachment 279205 [details] [review] [details]:
> > 
> > That breaks the UI. The UUIDs would be shown directly in the UI.
> 
> Then the UI needs to resolve them...

The UI doesn't use NetworkManager, and I'd like to keep it that way.
Comment 11 Bastien Nocera 2014-06-25 10:50:52 UTC
Review of attachment 279207 [details] [review]:

Looks good otherwise.

::: plugins/sharing/gsd-sharing-manager.c
@@ +147,3 @@
 {
+        char **connections;
+        int j;

"guint i" instead.

@@ +169,3 @@
         if (!service->started ||
             service->process == NULL) {
+                return;

Whitespace changes.

@@ +189,3 @@
                 ServiceInfo *service = l->data;
+                gboolean should_be_started = manager->priv->sharing_status == GSD_SHARING_STATUS_AVAILABLE &&
+                        service_is_enabled_on_current_connection (manager, service);

Make a proper conditional out of this.
Comment 12 Giovanni Campagna 2014-06-25 10:57:29 UTC
(In reply to comment #10)
> (In reply to comment #9)
> > (In reply to comment #8)
> > > Review of attachment 279205 [details] [review] [details] [details]:
> > > 
> > > That breaks the UI. The UUIDs would be shown directly in the UI.
> > 
> > Then the UI needs to resolve them...
> 
> The UI doesn't use NetworkManager, and I'd like to keep it that way.

I don't see how that's possible, given that, once again, connections "ids" are human readable (and editable) names that are not guaranteed to be unique, and are not an appropriate way to identify connections.
Besides, gnome-control-center already uses NM for the network panel, and the whole sharing plugin is useless without NM, so I don't see the big deal in using NM in the sharing panel.
Comment 13 Bastien Nocera 2014-06-25 10:57:57 UTC
Attachment 279206 [details] pushed as 5ac1250 - sharing: include wwan connection types as broadband
Attachment 279208 [details] pushed as 7b2feef - sharing: don't shutdown rygel if not autostarted
Comment 14 Bastien Nocera 2014-06-25 13:23:09 UTC
Created attachment 279222 [details] [review]
sharing: Fix deactivation of services when changing network

When switching between networks that both allow sharing in general,
we need to check the enabled connections for each service and
possibly stop it.
Comment 15 Bastien Nocera 2014-06-25 14:22:04 UTC
Attachment 279205 [details] pushed as bc3be2b - sharing: use UUIDs instead of IDs for NM connection identification
Attachment 279222 [details] pushed as 5ebf6fa - sharing: Fix deactivation of services when changing network
Comment 16 Marc-Antoine Perennou 2014-06-25 17:09:36 UTC
https://bugzilla.gnome.org/show_bug.cgi?id=732218 broke the build without networkmanager support because of service_is_enabled_on_current_connection being defined in an #ifdef block.