Ok, so I have isolated this to some libvirt quirk or config.

I followed this:

https://virtio-fs.gitlab.io/howto-qemu.html

Started virtiofsd manually and then the vm through qemu (running as root
on the host):

# export TESTDIR=/tmp
# /usr/lib/qemu/virtiofsd --socket-path=/tmp/vhostqemu -o source=$TESTDIR -o 
cache=always &
# qemu-system-x86_64 -M pc -cpu host --enable-kvm -smp 2 \
     -m 4G -object 
memory-backend-file,id=mem,size=4G,mem-path=/dev/shm,share=on -numa 
node,memdev=mem \
     -chardev socket,id=char0,path=/tmp/vhostqemu -device 
vhost-user-fs-pci,queue-size=1024,chardev=char0,tag=myfs \
     -chardev stdio,mux=on,id=mon -mon chardev=mon,mode=readline -device 
virtio-serial-pci -device virtconsole,chardev=mon -vga none -display none \
     -drive if=virtio,file=/var/lib/libvirt/images/ubuntu22.04.qcow2


We can see that the vm boots: 

# /usr/lib/qemu/virtiofsd --socket-path=/tmp/vhostqemu -o source=$TESTDIR -o 
cache=always &
[1] 17313
root@jammy-laptop:/var/log/libvirt/qemu# virtio_session_mount: Waiting for 
vhost-user socket connection...

root@jammy-laptop:/var/log/libvirt/qemu# qemu-system-x86_64 -M pc -cpu host 
--enable-kvm -smp 2      -m 4G -object 
memory-backend-file,id=mem,size=4G,mem-path=/dev/shm,share=on -numa 
node,memdev=mem      -chardev socket,id=char0,path=/tmp/vhostqemu -device 
vhost-user-fs-pci,queue-size=1024,chardev=char0,tag=myfs      -chardev 
stdio,mux=on,id=mon -mon chardev=mon,mode=readline -device virtio-serial-pci 
-device virtconsole,chardev=mon -vga none -display none      -drive 
if=virtio,file=/var/lib/libvirt/images/ubuntu22.04.qcow2
virtio_session_mount: Received vhost-user socket connection
virtio_loop: Entry
fv_queue_set_started: qidx=0 started=1
fv_queue_set_started: qidx=1 started=1
fv_queue_thread: Start for queue 0 kick_fd 9
fv_queue_thread: Start for queue 1 kick_fd 12

Ubuntu 22.04.4 LTS ubuntu-server hvc0

ubuntu-server login:


I was able to login and mount the filesystem with the command: 

sudo mount -t virtiofs myfs /mnt/tmp

Shutting it down gives me the sequence of messages from virtiosfd:

# sudo shutdown -h now
fv_queue_set_started: qidx=0 started=0
fv_queue_thread: kill event on queue 0 - quitting
fv_remove_watch: TODO! fd=9
fv_queue_set_started: qidx=1 started=0
fv_queue_thread: kill event on queue 1 - quitting
fv_remove_watch: TODO! fd=12
virtio_loop: Unexpected poll revents 11
virtio_loop: Exit
[1]+  Done                    /usr/lib/qemu/virtiofsd 
--socket-path=/tmp/vhostqemu -o source=$TESTDIR -o cache=always


So this is something to do with how libvirt spawns virtiosfd I think... I'm not 
sure I understand that mechanism.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2083988

Title:
  Cannot use virtiofs on Ubuntu 22.04

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/2083988/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to