QEMU/KVM: virtiofs causing major freeze problem

Yes, it does look like virtiofsd is the default now. I checked ‘/usr/libexec/virtiofsd --version’ and it is 1.6.1 which is the latest available from the gitlab site. Six months ago, this was not the case. I needed the option ‘–inode-file-handles’ and it was not available in the default version, so I downloaded it manually from the gitlab site and used it in my scripts. It appears I will no longer need to do that. Thanks for pointing that out.

As for how the scripts are executed, I create a script named ‘start_viofs_all.sh’ in the location ‘/etc/libvirt/hooks/qemu.d/<vm_guest_name>/prepare/begin’.

‘start_viofs_all.sh’ starts the virtiofsd processes for each of the shared folders for each guest vm. The processes each run inside of a screen session. Permissions are set on the socket and pid files so that qemu can access them.

#!/bin/bash
screen -d -m /root/start_<vm_guest_name>viofs<share_name_1>.sh
screen -d -m /root/start_<vm_guest_name>viofs<share_name_2>.sh
screen -d -m /root/start_<vm_guest_name>viofs<share_name_3>.sh
sleep 2
chown qemu:qemu /tmp/virtiofsd-<vm_guest_name>*
chmod 0600 /tmp/virtiofsd-<vm_guest_name>*

Here is one of the scripts that actually runs the virtiofsd process, with the desired options, for one of the shares:

#!/bin/bash
touch /tmp/virtiofsd-<vm_guest_name>-<share_name_1>
chmod 0600 /tmp/virtiofsd-<vm_guest_name>-<share_name_1>
/usr/libexec/virtiofsd --socket-path /tmp/virtiofsd-<vm_guest_name>-<share_name_1> --shared-dir /mnt/<share_name_1> --log-level trace --inode-file-handles=mandatory --posix-acl --thread-pool-size=64