virtio-9p filesharing issue

2024-05-05 Thread Taryel Hlontsi

Hi all,

Recently I was trying NetBSD10 amd64 as a KVM/QEMU guest on Linux host 
and wanted to configure a shared directory with the new vio9p driver.
However I did not succeed. It looks like something was detected as a 9P 
transport device but that's about it.


Maybe someone has some clues on how to configure it properly?

HOSTS (if it matters):
Debian 12 on Ext4
Ubuntu 24.04 on XFS

GUEST:
uname -a
NetBSD zed.home 10.0 NetBSD 10.0 (GENERIC) #0: Thu Mar 28 08:33:33 UTC 
2024 mkre...@mkrepro.netbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC 
amd64

The NetBSD current produces the same result

My libvirt filesystem config:
    
      
      
      function="0x0"/>

    

dmesg | grep -E 'vio|virtio'
[ 1.016364] virtio0 at pci0 dev 6 function 0
[ 1.016364] virtio0: console device (id 3, rev. 0x00)
[ 1.016364] virtio0: autoconfiguration error: no matching child 
driver; not configured

[ 1.016364] virtio1 at pci0 dev 7 function 0
[ 1.016364] virtio1: memory balloon device (id 5, rev. 0x00)
[ 1.016364] viomb0 at virtio1: features: 0x1000
[ 1.016364] virtio1: allocated 8192 byte for virtqueue 0 for 
inflate, size 128
[ 1.016364] virtio1: allocated 8192 byte for virtqueue 1 for 
deflate, size 128

[ 1.016364] virtio1: interrupting at ioapic0 pin 11
[ 1.016364] virtio2 at pci0 dev 8 function 0
[ 1.016364] virtio2: 9P transport device (id 9, rev. 0x00)
[ 1.016364] virtio2: autoconfiguration error: no matching child 
driver; not configured


modstat | grep -E 'vio|virtio'
if_vioif   driver   builtin  -    0   - virtio
ld_virtio  driver   builtin  -    0   - ld,virtio
viomb  driver   builtin  -    0   - virtio
vioscsi    driver   builtin  -    0   - virtio
virtio driver   builtin  -    5   - -
virtio_pci driver   builtin  -    0   - pci,virtio

Thank you



Re: virtio-9p filesharing issue

2024-05-05 Thread Aryabhata
In your libvirt configuration, ensure that the filesystem type is set to
virtio, which should match the virtio driver used for the 9P transport
device. Here's an example snippet:
  
  
  



Also Monitor the guest's system logs (/var/log/messages) for any errors
related to virtio or the vio9p driver during boot or when attempting to
access the shared directory.

On Sun, 5 May, 2024, 4:39 pm Taryel Hlontsi,  wrote:

> Hi all,
>
> Recently I was trying NetBSD10 amd64 as a KVM/QEMU guest on Linux host
> and wanted to configure a shared directory with the new vio9p driver.
> However I did not succeed. It looks like something was detected as a 9P
> transport device but that's about it.
>
> Maybe someone has some clues on how to configure it properly?
>
> HOSTS (if it matters):
> Debian 12 on Ext4
> Ubuntu 24.04 on XFS
>
> GUEST:
> uname -a
> NetBSD zed.home 10.0 NetBSD 10.0 (GENERIC) #0: Thu Mar 28 08:33:33 UTC
> 2024 mkre...@mkrepro.netbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC
> amd64
> The NetBSD current produces the same result
>
> My libvirt filesystem config:
>  
>
>
> function="0x0"/>
>  
>
> dmesg | grep -E 'vio|virtio'
> [ 1.016364] virtio0 at pci0 dev 6 function 0
> [ 1.016364] virtio0: console device (id 3, rev. 0x00)
> [ 1.016364] virtio0: autoconfiguration error: no matching child
> driver; not configured
> [ 1.016364] virtio1 at pci0 dev 7 function 0
> [ 1.016364] virtio1: memory balloon device (id 5, rev. 0x00)
> [ 1.016364] viomb0 at virtio1: features: 0x1000
> [ 1.016364] virtio1: allocated 8192 byte for virtqueue 0 for
> inflate, size 128
> [ 1.016364] virtio1: allocated 8192 byte for virtqueue 1 for
> deflate, size 128
> [ 1.016364] virtio1: interrupting at ioapic0 pin 11
> [ 1.016364] virtio2 at pci0 dev 8 function 0
> [ 1.016364] virtio2: 9P transport device (id 9, rev. 0x00)
> [ 1.016364] virtio2: autoconfiguration error: no matching child
> driver; not configured
>
> modstat | grep -E 'vio|virtio'
> if_vioif   driver   builtin  -0   - virtio
> ld_virtio  driver   builtin  -0   - ld,virtio
> viomb  driver   builtin  -0   - virtio
> vioscsidriver   builtin  -0   - virtio
> virtio driver   builtin  -5   - -
> virtio_pci driver   builtin  -0   - pci,virtio
>
> Thank you
>
>


Re: virtio-9p filesharing issue

2024-05-05 Thread Valery Ushakov
On Sun, May 05, 2024 at 13:08:52 +0200, Taryel Hlontsi wrote:

> dmesg | grep -E 'vio|virtio'
[...]
> [ 1.016364] virtio2 at pci0 dev 8 function 0
> [ 1.016364] virtio2: 9P transport device (id 9, rev. 0x00)
> [ 1.016364] virtio2: autoconfiguration error: no matching child driver;
> not configured
> 
> modstat | grep -E 'vio|virtio'
> if_vioif   driver   builtin  -    0   - virtio
> ld_virtio  driver   builtin  -    0   - ld,virtio
> viomb  driver   builtin  -    0   - virtio
> vioscsi    driver   builtin  -    0   - virtio
> virtio driver   builtin  -    5   - -
> virtio_pci driver   builtin  -    0   - pci,virtio

You don't seem to have vio9p compiled-in/modloaded in your kernel.


-uwe


Re: virtio-9p filesharing issue

2024-05-05 Thread Taryel Hlontsi
It is turned out that GENERIC kernel indeed doesn't have this driver 
included for some reason, so I had to compile and install a custom kernel.


Then I had to make a device node:

mknod /dev/vio9p0 c 356 0

where 356 is a major number of the device I found in 
/usr/src/sys/conf/majors


Not sure if this is the correct way how it should be configured but it 
works like a charm and I am happy :)


Thank you guys for taking a look into this!

|
|

On 5/5/24 19:05, Valery Ushakov wrote:

On Sun, May 05, 2024 at 13:08:52 +0200, Taryel Hlontsi wrote:


dmesg | grep -E 'vio|virtio'

[...]

[ 1.016364] virtio2 at pci0 dev 8 function 0
[ 1.016364] virtio2: 9P transport device (id 9, rev. 0x00)
[ 1.016364] virtio2: autoconfiguration error: no matching child driver;
not configured

modstat | grep -E 'vio|virtio'
if_vioif   driver   builtin  -    0   - virtio
ld_virtio  driver   builtin  -    0   - ld,virtio
viomb  driver   builtin  -    0   - virtio
vioscsi    driver   builtin  -    0   - virtio
virtio driver   builtin  -    5   - -
virtio_pci driver   builtin  -    0   - pci,virtio

You don't seem to have vio9p compiled-in/modloaded in your kernel.


-uwe

Re: virtio-9p filesharing issue

2024-05-05 Thread Martin Husemann
On Sun, May 05, 2024 at 09:10:36PM +0200, Taryel Hlontsi wrote:
> Then I had to make a device node:
> 
> mknod /dev/vio9p0 c 356 0
> 
> where 356 is a major number of the device I found in
> /usr/src/sys/conf/majors

The official way is something like:

cd /dev && sh MAKEDEV vio9p0

(so you don't have to go digging for the number, and sometimes devices
come in groups like tty* and dty*, MAKEDEV will handle that).

Martin