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 764934 - "volume-changed" signal not fired when mounting
"volume-changed" signal not fired when mounting
Status: RESOLVED OBSOLETE
Product: gvfs
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gvfs-maint
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2016-04-12 08:45 UTC by Stefano Facchini
Modified: 2018-09-21 17:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
goa: Emit volume-changed when mounting/unmounting (5.45 KB, patch)
2016-05-12 13:26 UTC, Ondrej Holy
reviewed Details | Review

Description Stefano Facchini 2016-04-12 08:45:23 UTC
I expect the GVolume of a Google Drive to fire a volume-changed signal when it is mounted or unmounted, but that doesn't happen.

Tested in a jhbuild environment (but I'm not sure if the jhbuild version of gvfs is used, rather than the version packaged in Fedora).

I'm filing this under the GOA component because some user reported the same problem with OwnCloud.
Comment 1 Ondrej Holy 2016-04-29 06:50:31 UTC
Thanks for your bug report.

Hmm, I see such behavioral with udisks2 volume monitor, but I don't see such behavioral with gphoto2 volume monitor, nor mtp volume monitor, neither goa volume monitor. So, I am not sure the signal should be emitted, but makes sense to me...
Comment 2 Ondrej Holy 2016-05-12 13:26:58 UTC
Created attachment 327705 [details] [review]
goa: Emit volume-changed when mounting/unmounting

Attaching patch to emit volume-changed signal from goa volume monitor. Unfortunately volume-changed is not properly emitted when unmounting, because "unmounted" signal is not probably emitted from some reason... It seems there might be problem with shadow mounts...
Comment 3 Debarshi Ray 2016-06-29 13:38:36 UTC
Sorry for the late response. I have had this bug on my list for a while.

(In reply to Ondrej Holy from comment #1)
> Hmm, I see such behavioral with udisks2 volume monitor, but I don't see such
> behavioral with gphoto2 volume monitor, nor mtp volume monitor, neither goa
> volume monitor. So, I am not sure the signal should be emitted, but makes
> sense to me...

Yes, I remember wondering about the signals when I wrote the GOA volume monitor. It my first contribution to gvfs, so I am sure I got something wrong.

I will take a look at your fix. Thanks for that, by the way.
Comment 4 Debarshi Ray 2016-06-29 14:33:58 UTC
Review of attachment 327705 [details] [review]:

Looks good to me.
Comment 5 Ondrej Holy 2016-06-29 14:46:09 UTC
Thanks for review, though I have to figure out, why "unmounted" signal is not emitted, or more precisely why "mount_unmounted_cb" is never called... otherwise the patch doesn't make much sense...
Comment 6 Debarshi Ray 2016-06-29 15:05:31 UTC
Review of attachment 327705 [details] [review]:

::: monitor/goa/goavolume.c
@@ +143,3 @@
+
+  if (self->monitor)
+    g_signal_emit_by_name (self->monitor, "volume-changed", self);

I can see that GMount::unmounted is not being emitted at the moment, but ideally, we should also emit GVolumeMonitor::mount-removed here, no?
Comment 7 Ondrej Holy 2016-06-29 15:14:00 UTC
I think that this signal is emitted from GVfsProxyVolumeMonitor, but not sure though...
Comment 8 Debarshi Ray 2016-06-30 09:42:06 UTC
(In reply to Debarshi Ray from comment #6)
> Review of attachment 327705 [details] [review] [review]:
> 
> ::: monitor/goa/goavolume.c
> @@ +143,3 @@
> +
> +  if (self->monitor)
> +    g_signal_emit_by_name (self->monitor, "volume-changed", self);
> 
> I can see that GMount::unmounted is not being emitted at the moment, but
> ideally, we should also emit GVolumeMonitor::mount-removed here, no?

You are right. We don't need it because ...

(In reply to Ondrej Holy from comment #7)
> I think that this signal is emitted from GVfsProxyVolumeMonitor, but not
> sure though...

self->mount in GoaVolume is a GDaemonMount. While unmounting, first the GDaemonMount goes away. There is no way around it because GProxyShadowMount redirects to GDaemonMount. GDaemonVolumeMonitor/GDaemonMount emits mount-removed/unmounted. In response, GProxyVolume removes the GProxyShadowMount, and GProxyVolumeMonitor/GProxyShadowMount emits mount-removed/unmounted.

All this is reflected in 'gvfs-mount --monitor'. Question is, why is this not visible from the remote volume monitor process.

I understand that the mount-removed/unmounted for the shadow mount will not reach the remote volume monitor because it is all on the client-side inside GProxy*. However, self->mount is a *GDaemonMount*. I wonder if it is because the remote volume monitors are special (they use GVFS_REMOTE_VOLUME_MONITOR_IGNORE=1).
Comment 9 GNOME Infrastructure Team 2018-09-21 17:58:00 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gvfs/issues/277.