GNOME Bugzilla – Bug 764934
"volume-changed" signal not fired when mounting
Last modified: 2018-09-21 17:58:00 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.
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...
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...
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.
Review of attachment 327705 [details] [review]: Looks good to me.
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...
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?
I think that this signal is emitted from GVfsProxyVolumeMonitor, but not sure though...
(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).
-- 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.