Commit f136702d authored by Kwon-Young Choi's avatar Kwon-Young Choi
Browse files

BackingFile property should be use with StorageVolume instead of StorageAccess

BUG: 434617

When mounting an iso with `udisksctl`, first a loop device is created
`/dev/loop0` then a second device `/dev/loop0p1` is used to mount it on
a filesystem location.

Querying for StorageAccess devices sometimes only returns the `/dev/loop0p1`
device without the `/dev/loop0` device and the BackingFile property does not
work on `/dev/loop0p1`.

Solution: query for StorageVolume instead which returns all loop devices:
`/dev/loop0` and `/dev/loop1`.

Warning: Because StorageVolume returns more devices, the function
`getDeviceFromBackingFile` could be a little bit slower.
parent 7a58858b
......@@ -78,7 +78,7 @@ MountIsoAction::MountIsoAction(QObject *parent, const QVariantList &)
const Solid::Device getDeviceFromBackingFile(const QString &backingFile)
{
const QList<Solid::Device> blockDevices =
Solid::Device::listFromQuery("[ IS StorageAccess AND IS GenericInterface ]");
Solid::Device::listFromQuery("[ IS StorageVolume AND IS GenericInterface ]");
for (const Solid::Device &device : blockDevices) {
auto genericDevice = device.as<Solid::GenericInterface>();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment