Prompted by Adam Williamson’s comment, I decided to see if we can use filelight on a guestmount (FUSE-mounted) virtual machine.

Obviously the answer is yes, but it’s pretty slow. It took a few minutes for filelight to scan /usr/share/doc from the virtual machine (about 5300 files). I gave up on scanning the whole VM disk.
The reason is that filelight makes ordinary system calls to scan the disk. These are redirected through the magic of FUSE through to discrete libguestfs calls into the appliance (see the libguestfs architecture diagram here). Compare that to the “du” example which is far more efficient — a single “du” message is sent to the appliance which then processes everything internally before sending a single response message back. The du command is far faster, even though it must be doing roughly the same amount of work.
If filelight (or baobab) was able to make native libguestfs calls, then we could make it a lot more efficient.

