[UDisks2] Power down drive on remove if supported
ClosedPublic

Authored by bruns on Oct 3 2018, 11:46 PM.

Details

Summary

It is preferable to to do a controlled shutdown prior to disconnecting
and eventually cutting of power to the drive.

BUG: 270808
Closes T9730

Test Plan

Connect external drive, select "Savely Remove" from context menu

  1. if drive has only on partition, fs is unmounted and drive spins down
  2. if drive has multiple partitions: a) first (not last) partition can be unmounted and remounted b) "Remove"ing last partition spins down drive

Diff Detail

Repository
R245 Solid
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
bruns created this revision.Oct 3 2018, 11:46 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptOct 3 2018, 11:47 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
bruns requested review of this revision.Oct 3 2018, 11:47 PM
ngraham edited the summary of this revision. (Show Details)Oct 3 2018, 11:48 PM
ngraham edited the summary of this revision. (Show Details)Oct 3 2018, 11:57 PM
ngraham accepted this revision.Oct 4 2018, 1:55 AM

Works great with the unencrypted and LUKS-unencrypted single- and multi-partition ext4 disks that I tried out. Code change looks sane too. Wonderful work!

This revision is now accepted and ready to land.Oct 4 2018, 1:55 AM
broulik added a subscriber: broulik.Oct 4 2018, 7:40 AM
broulik added inline comments.
src/solid/devices/backends/udisks2/udisksstorageaccess.cpp
186

Why this change?

bruns updated this revision to Diff 42905.Oct 5 2018, 3:13 AM
  • do not create additional connections on the system bus
  • avoid disconnecting optical drives, no need to power down
broulik accepted this revision.Oct 5 2018, 7:17 AM

Please wait till after Frameworks tagging (due tomorrow) so we can have more test exposure as Solid changes are usually quite delicate

This revision was automatically updated to reflect the committed changes.
bruns marked an inline comment as done.