fix device RO check
ClosedPublic

Authored by sitter on Jun 28 2017, 8:12 AM.

Details

Summary
  • mark deviceNode const
  • copy it as deviceName
  • mutate deviceName by removing /dev/
  • use the new deviceName for the read-only check

this makes sure we emit the unmodified deviceNode (e.g. /dev/vda) rather
than the name (e.g. vda). unbreaks for example calamares which doesn't
know what to do with "vda".

CCBUG: 378607

Test Plan
  • without fix clamares fails to list devices
  • with the fix calamares lists devices

Diff Detail

Repository
R16 KPMCore
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
sitter created this revision.Jun 28 2017, 8:12 AM

Ah, FWIW this broke in a35702e9113d655ffcc4b2ffc06e791f256d0beb before that commit deviceNode was not a thing but multiple string instances were obtained from the device stringlist, so they where all save to mutate without side effects.

stikonas accepted this revision.Jun 28 2017, 11:39 AM

Hmm, strange that it worked for partition manager. I thought QString::remove returns another string, doesn't modify the original one...

As for const QString, I actually noticed it soon I made commit :(. But somehow I didn't expect things to break with calamares, so I didn't make another commit.

This revision is now accepted and ready to land.Jun 28 2017, 11:39 AM
This revision was automatically updated to reflect the committed changes.