Review Request 125248: Display name of process which blocks umount / eject

Igor Poboiko igor.poboiko at gmail.com
Wed Sep 16 18:07:00 UTC 2015


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/125248/
-----------------------------------------------------------

(Updated Сен. 16, 2015, 6:07 п.п.)


Review request for Plasma and Solid.


Changes
-------

Make process call async. I had to make it using lambda/cloisures magic, because I want slot to be aware of list of blocking processes as well as of error from solid itself. Also I had to keep in mind that there might be different errors from different devices simultaneously, so I can't store error somewhere inside.

Also "fuser" is not a desirable option here, because apparently it doesn't show when some process is blocking any subdirectory of mount point, while lsof does.

static_casts when connected to lambda are needed because of signal overload (QProcess::finished), see [link](https://forum.qt.io/topic/20998/qt5-new-signals-slots-syntax-does-not-work-solved/8) for more details.

If someone knows more beautiful solution, I would glad to hear :)


Repository: plasma-workspace


Description
-------

An attempt to implement feature from [bug 96107](https://bugs.kde.org/show_bug.cgi?id=96107) (see summary).

On umount/eject error it runs "lsof" executable, gets PIDs of blocking processes and obtains names of processes via KSysGuard::Process machinery. Finally it appends obtained information to error message which is shown in tooltip of Device Notifier applet.


Diffs (updated)
-----

  dataengines/devicenotifications/ksolidnotify.cpp 35d49d6 
  dataengines/devicenotifications/ksolidnotify.h a471d50 
  dataengines/devicenotifications/CMakeLists.txt 3f7fd83 

Diff: https://git.reviewboard.kde.org/r/125248/diff/


Testing
-------

Tested unmount on busy device with several processes blocking it. Did not test eject, since I have no optical disc drive :(


File Attachments
----------------

Applet with error message
  https://git.reviewboard.kde.org/media/uploaded/files/2015/09/15/3b1b64fc-abff-4633-9dca-621388edf086__snapshot11.png


Thanks,

Igor Poboiko

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20150916/efa8fa13/attachment-0001.html>


More information about the Plasma-devel mailing list