support idmapped mounts

Tested locally with xfstests (see https://lore.kernel.org/linux-fsdevel/20240815092429.103356-1-aleksandr.mikhalitsyn@canonical.com/T/#m89156c62e966171108cde3d407205de28fa72e59)

cd virtiofsd
cargo build
./target/debug/virtiofsd --socket-path=/tmp/vfsd.sock --shared-dir /home/alex/my_test_dir \
        --announce-submounts --inode-file-handles=mandatory

and Qemu configuration like that:

RAM=32G
qemu-system-x86_64					\
   -pidfile qemu.pid \
   -drive file=jammy-server-cloudimg-amd64-disk-kvm.img,format=qcow2 \
         -object memory-backend-memfd,id=mem,size=$RAM,share=on \
        -numa node,memdev=mem \
           -chardev socket,id=char0,path=/tmp/vfsd.sock \
        -device vhost-user-fs-pci,queue-size=1024,chardev=char0,tag=myfs \
-kernel mslinux-build/arch/x86/boot/bzImage \
-initrd initrd.img \
-append "root=PARTUUID=4853c128-a69d-4671-bb8a-1dfecd488bae ro console=tty1 console=ttyS0 panic=0" \
	-m $RAM						\
  -smp 16 \
  -device virtio-net-pci,netdev=eth0 -netdev type=user,id=eth0,hostfwd=tcp::2222-:22 \
 -cpu host \
 -enable-kvm \
-serial mon:stdio \
-nographic

Inside guest:

mount -t virtiofs myfs /mnt/my_virtiofs_mount
./mount-idmapped --map-mount b:1000:0:2 /mnt/my_virtiofs_mount /mnt/my_virtiofs_mount_idmapped

(tool from https://raw.githubusercontent.com/brauner/mount-idmapped/master/mount-idmapped.c )

Depends on kernel changes from: https://lore.kernel.org/linux-fsdevel/20240903151626.264609-1-aleksandr.mikhalitsyn@canonical.com/#r

Edited by alexander-mihalicyn

Merge request reports

Loading