Open gasinvein opened 3 years ago
as per: https://wiki.archlinux.org/title/udisks seems like there are two ways to interact with udisks: dbus and cli. cli probably would be much easier to implement.
or seems like there is much interesting way: https://doc.qt.io/qt-5/qdbusinterface.html
I believe DBus API is the proper way to integrate apps with udisks2. udisksctl
is just a very limited console UI, it's probably not supposed to be invoked from apps.
or seems like there is much interesting way: https://doc.qt.io/qt-5/qdbusinterface.html
Yeah, Qt DBus module should do.
api reference: http://storaged.org/doc/udisks2-api/latest/
Yeah, we don't need much of the API here, just two interfaces and two method calls. Probably the only thing to note is that when calling LoopSetup
method on org.freedesktop.UDisks2.Manager
interface, we should set no-part-scan
option to true
, so the filesystem interface appears for the whole loopback block device and we won't need to poke into partitions to mount the filesystem.
UDisks is a privileged daemon with D-Bus API for for manipulating block devices and filesystems. Q4Wine could ask UDisks2 to mount a disk image for it. This gives several advantages over exec'ing CLI tools for mount:
fusermount
when using FUSE)Key difference from current mount approach, as I see it, is that UDisks2 sets up a mountpoint for us automatically (usually in
/media
or/run/media/
) when mounting a filesystem, which means we can't select it ourselves.To mount an image, client app would need to call two D-Bus methods sequentially:
org.freedesktop.UDisks2.Manager.LoopSetup
to create a block device backed by given image (returns object path of the created device), and thenorg.freedesktop.UDisks2.Filesystem.Mount
(method of the block device object we just created) to mount the filesystem (returns path to the mount point).